Group API
Add
Delete
Update
Add Respondents
Remove Respondents
Get
https://host/restModule/group/add
Creates a list of groups, with an optional list of phone numbers.
group_names = myGroup,myGroup2 - a comma (',') separated list of the names of the groups to add (REQUIRED)
respondent_numbers = 447977503087 - a comma (',') separated list of numbers of respondents to be added to the group. International Format. Only legal if 1 group is specified in group_names. (OPTIONAL)
respondent_ids = 1,2 - a comma (',') separated list of ids of respondents to be added to the group. International Format. Only legal if 1 group is specified in group_names. (OPTIONAL)
Errors:
- RespondentDoesNotExistError
- RespondentGroupExistsError
- ToManyGroupsSpecifiedError - when group_names has more than one group and respondent_numbers is specified
https://host/restModule/respondent/delete
Deletes a list of groups.
group_names = myGroup,myGroup2 - a comma (',') separated list of the names of the groups to delete (EITHER group_names OR group_ids MUST be provided)
group_ids = 1,2 - a comma (',') separated list of the ids of the groups to delete (EITHER group_names OR group_ids MUST be provided)
Errors:
- RespondentGroupDoesNotExistError
https://host/restModule/group/update
Renames a group.
group_name = myGroup - the name of the group to update (EITHER group_name OR group_id MUST be provided)
group_id = 1 - the id of the groups to update (EITHER group_name OR group_id MUST be provided)
new_group_name = newGroup - the new name of the group (REQUIRED)
Errors:
https://host/restModule/group/addRespondents
Adds a list of phone numbers to a group.
group_name = myGroup - the name of the group to add respondents to (EITHER group_name OR group_id MUST be provided)
group_id = 1 - the id of the group to add respondents to (EITHER group_name OR group_id MUST be provided)
respondent_numbers = 447977503087 - a comma (',') separated list of respondent numbers to be added. International Format. (EITHER respondent_numbers OR respondent_ids MUST be provided)
respondent_ids = 1,2 - a comma (',') separated list of respondent ids to be added. (EITHER respondent_numbers OR respondent_ids MUST be provided)
dispatch_to_dispatched = (true|false) - whether to dispatch respondent for dispatches active for this group. Default is false. (OPTIONAL)
dispatch_names = myDispatch,myDispatch2 - a ',' separated list of the names of the dispatches for which respodent will be dispatched if dispatch_to_dispatched is set to true. Respondent will be dispached for all active dispatches if neither dispatch_names or dispatch_ids is specified. (OPTIONAL)
dispatch_ids = 1,2 - a ',' separated list of the ids of the dispatches for which respodent will be dispatched if dispatch_to_dispatched is set to true. Respondent will be dispached for all active dispatches if neither dispatch_names or dispatch_ids is specified. (OPTIONAL)
Errors:
- RespondentDoesNotExistError
- RespondentGroupDoesNotExistError
- DispatchDoesNotExistError
https://host/restModule/group/removeRespondents
Removes a list of phone numbers from a group.
group_name = myGroup - the name of the group to remove respondents to (ONE OF group_name OR group_id must exist)
group_id = 1 - the id of the group to remove respondents to (ONE OF group_name OR group_id must exist)
respondent_numbers = 447977503087 - a comma (',') separated list of respondent numbers to be removed. International Format. (EITHER respondent_numbers OR respondent_ids MUST be provided)
respondent_ids = 1,2 - a comma (',') separated list of respondent ids to be removed. (EITHER respondent_numbers OR respondent_ids MUST be provided)
Errors:
- RespondentDoesNotExistError
- RespondentGroupDoesNotExistError
https://host/restModule/group/get
Fetches a list of groups, with all their phone numbers. If neither group_names or group_ids is specified then all the groups are returned.
group_names = myGroup,myGroup2 - a comma (',') separated list of the names of the groups to get (OPTIONAL)
group_ids = 1,2 - a comma (',') separated list of the ids of the groups to get (OPTIONAL)
Errors:
- RespondentGroupDoesNotExistError
Returns:
<groups xmlns="http://www.embracemobile.com/socrates2/1.0" >
<group name="myGroup" id="1" >
<respondent number="447977503087" id="12" />
<respondent number="447977506687" id="13" />
</group>
<group name="myGroup2" id="2" >
<respondent number="447977503087" id="12" />
<respondent number="447977506687" id="13" />
</group>
</groups>
|