Note: In this system, a "Cohort" is a group of users, similar to a "User Segment".
core_cohort_add_cohort_members
This function adds one or more users to a specified cohort.
Let's review the POST parameters for this function:
- Required Parameters:
- The entire
members object is required to identify the user and the cohort. members[0][cohorttype][type]= string (Required: How to identify the cohort. Use 'id' for the numeric ID or 'idnumber' for the alphanumeric ID.)members[0][cohorttype][value]= string (Required: The actual ID or idnumber of the cohort.)members[0][usertype][type]= string (Required: How to identify the user. Use 'id' for the numeric user ID or 'username' for the alphanumeric username.)members[0][usertype][value]= string (Required: The actual ID or username of the user.)
cURL Command Example (Adding a User to a Cohort):
core_cohort_delete_cohort_members
This function removes one or more users from a specified cohort.
Let's review the POST parameters for this function:
- Required Parameters:
members[0][cohortid]= int (Required: The numeric ID of the cohort.)members[0][userid]= int (Required: The numeric ID of the user to be removed.)
cURL Command Example (Removing a User from a Cohort):
core_cohort_create_cohorts
This function creates one or more new cohorts.
Let's review the POST parameters for this function:
- Required Parameters:
cohorts[0][categorytype][type]= string (Required: The context for the cohort. Use 'system' for site-level.)cohorts[0][categorytype][value]= string (Required: The value for the context. If type is 'system', this can be 0 or 1.)cohorts[0][name]= string (Required: The name of the cohort.)cohorts[0][idnumber]= string (Required: A unique alphanumeric ID for the cohort.)
- Optional Parameters:
cohorts[0][description]= string (Optional: A description for the cohort.)cohorts[0][visible]= int (Optional: Set to 1 for visible, 0 for hidden. Defaults to 1.)
cURL Command Example (Creating a New Cohort):
core_cohort_delete_cohorts
This function deletes one or more cohorts based on their IDs.
Let's review the POST parameters for this function:
- Required Parameter:
cohortids[0]= int (Required: The numeric ID of the cohort to delete. Pass multiple to delete more than one.)
cURL Command Example (Deleting a Cohort):
core_cohort_get_cohorts
This function retrieves information about one or more cohorts.
Let's review the POST parameters for this function:
- Optional Parameter:
cohortids[0]= int (Optional: The numeric ID of a cohort to retrieve. If omitted, the system may return all cohorts.)
cURL Command Example (Getting Specific Cohorts):