GroupContact.php
This api exposes CiviCRM GroupContact records.
This api is for adding/removing contacts from a group, or fetching a list of groups for a contact.
Important note: This api does not fetch smart groups for a contact. To fetch all contacts in a smart group, use the Contact api passing a contact_id and group_id.
To create/delete groups, use the group api instead.
Table of Contents
Functions
- civicrm_api3_group_contact_get() : array<string|int, mixed>
- Fetch a list of groups for a contact, or contacts for a group.
- _civicrm_api3_group_contact_create_spec() : mixed
- Adjust metadata for Create action.
- civicrm_api3_group_contact_create() : array<string|int, mixed>
- Add contact(s) to group(s).
- civicrm_api3_group_contact_delete() : array<string|int, mixed>
- Delete group contact record.
- _civicrm_api3_group_contact_delete_spec() : mixed
- Adjust metadata.
- civicrm_api3_group_contact_pending() : array<string|int, mixed>|int
- Get pending group contacts.
- _civicrm_api3_group_contact_common() : array<string|int, mixed>
- Group contact helper function.
- civicrm_api3_group_contact_update_status() : bool
- Update group contact status.
- _civicrm_api3_group_contact_deprecation() : array<string|int, mixed>
- Deprecated function notices.
Functions
civicrm_api3_group_contact_get()
Fetch a list of groups for a contact, or contacts for a group.
civicrm_api3_group_contact_get(array<string|int, mixed> $params) : array<string|int, mixed>
Parameters
- $params : array<string|int, mixed>
-
Name value pair of contact information.
Tags
Return values
array<string|int, mixed> —list of groups, given contact subsribed to
_civicrm_api3_group_contact_create_spec()
Adjust metadata for Create action.
_civicrm_api3_group_contact_create_spec(array<string|int, mixed> &$params) : mixed
Parameters
- $params : array<string|int, mixed>
civicrm_api3_group_contact_create()
Add contact(s) to group(s).
civicrm_api3_group_contact_create(array<string|int, mixed> $params) : array<string|int, mixed>
This api has a legacy/nonstandard signature. On success, the return array will be structured as follows:
array(
"is_error" => 0,
"version" => 3,
"count" => 3,
"values" => array(
"not_added" => integer,
"added" => integer,
"total_count" => integer
)
)
On failure, the return array will be structured as follows:
array(
'is_error' => 1,
'error_message' = string,
'error_data' = mixed or undefined
)
Parameters
- $params : array<string|int, mixed>
-
Input parameters:
- "contact_id" (required): First contact to add, or array of Contact IDs
- "group_id" (required): First group to add contact(s) to, or array of Group IDs
- "status" (optional): "Added" (default), "Pending" or "Removed" Legacy input parameters (will be deprecated):
- "contact_id.1" etc. (optional): Additional contact_id to add to group(s)
- "group_id.1" etc. (optional): Additional groups to add contact(s) to
Return values
array<string|int, mixed> —Information about operation results
civicrm_api3_group_contact_delete()
Delete group contact record.
civicrm_api3_group_contact_delete(array<string|int, mixed> $params) : array<string|int, mixed>
Parameters
- $params : array<string|int, mixed>
Tags
Return values
array<string|int, mixed>_civicrm_api3_group_contact_delete_spec()
Adjust metadata.
_civicrm_api3_group_contact_delete_spec(array<string|int, mixed> &$params) : mixed
Parameters
- $params : array<string|int, mixed>
civicrm_api3_group_contact_pending()
Get pending group contacts.
civicrm_api3_group_contact_pending(array<string|int, mixed> $params) : array<string|int, mixed>|int
Parameters
- $params : array<string|int, mixed>
Return values
array<string|int, mixed>|int_civicrm_api3_group_contact_common()
Group contact helper function.
_civicrm_api3_group_contact_common(array<string|int, mixed> $params[, string $op = 'Added' ]) : array<string|int, mixed>
Parameters
- $params : array<string|int, mixed>
- $op : string = 'Added'
Tags
Return values
array<string|int, mixed>civicrm_api3_group_contact_update_status()
Update group contact status.
- this should be part of create but need to know we aren't missing something
civicrm_api3_group_contact_update_status(array<string|int, mixed> $params) : bool
Parameters
- $params : array<string|int, mixed>
Tags
Return values
bool_civicrm_api3_group_contact_deprecation()
Deprecated function notices.
api notice
_civicrm_api3_group_contact_deprecation() : array<string|int, mixed>
Return values
array<string|int, mixed> —Array of deprecated actions