Package com.sinch.sdk.domains.sms.api.v1
Interface GroupsService
public interface GroupsService
Groups Service
-
Method Summary
Modifier and TypeMethodDescriptioncreate()Create an unnamed and empty groupcreate(GroupRequest groupRequest) Create a group This endpoint allows you to create a group of recipients.voidDelete a group This operation deletes the group with the provided group ID.Retrieve a group This operation retrieves a specific group with the provided group ID.list()List Groups (using default parameters) With the list operation you can list all groups that you have created.list(ListGroupsQueryParameters queryParameter) List Groups With the list operation you can list all groups that you have created.listMembers(String groupId) Get phone numbers for a group This operation retrieves the members of the group with the provided group ID.replace(String groupId, GroupRequest groupRequest) Replace a group The replace operation will replace all parameters, including members, of an existing group with new values.update(String groupId, GroupUpdateRequest groupUpdateRequest) Update a group With the update group operation, you can add and remove members in an existing group as well as rename the group.
-
Method Details
-
create
Create a group This endpoint allows you to create a group of recipients. A new group must be created with a group name. This is represented by the `name` field which can be up to 20 charecters. In addition, there are a number of optional fields: - `members` field enables groups to be created with an initial list of contacts - `auto_update` allows customers to auto subscribe to a new group. This contains three fields. The `to` field contains the group creator's number. (This number **must be provisioned by contacting your account manager**.) The `add` and `remove` fields are objects containing the keywords that customers need to text to join or leave a group.- Parameters:
groupRequest- (required)- Returns:
- Group
- Throws:
ApiException- if fails to make API call
-
delete
Delete a group This operation deletes the group with the provided group ID.- Parameters:
groupId- ID of a group that you are interested in getting. (required)- Throws:
ApiException- if fails to make API call
-
listMembers
Get phone numbers for a group This operation retrieves the members of the group with the provided group ID.- Parameters:
groupId- ID of a group that you are interested in getting. (required)- Returns:
- List<String>
- Throws:
ApiException- if fails to make API call
-
list
List Groups (using default parameters) With the list operation you can list all groups that you have created. This operation supports pagination. Groups are returned in reverse chronological order.- Returns:
- ListGroupsResponse
- Throws:
ApiException- if fails to make API call
-
list
List Groups With the list operation you can list all groups that you have created. This operation supports pagination. Groups are returned in reverse chronological order.- Parameters:
queryParameter- (optional)- Returns:
- ListGroupsResponse
- Throws:
ApiException- if fails to make API call
-
replace
Replace a group The replace operation will replace all parameters, including members, of an existing group with new values. Replacing a group targeted by a batch message scheduled in the future is allowed and changes will be reflected when the batch is sent.- Parameters:
groupId- ID of a group that you are interested in getting. (required)groupRequest- (required)- Returns:
- Group
- Throws:
ApiException- if fails to make API call
-
get
Retrieve a group This operation retrieves a specific group with the provided group ID.- Parameters:
groupId- ID of a group that you are interested in getting. (required)- Returns:
- Group
- Throws:
ApiException- if fails to make API call
-
update
Update a group With the update group operation, you can add and remove members in an existing group as well as rename the group. This method encompasses a few ways to update a group: 1. By using `add` and `remove` arrays containing phone numbers, you control the group movements. Any list of valid numbers in E.164 format can be added. 2. By using the `auto_update` object, your customer can add or remove themselves from groups. 3. You can also add or remove other groups into this group with `add_from_group` and `remove_from_group`. #### Other group update info - The request will not be rejected for duplicate adds or unknown removes. - The additions will be done before the deletions. If an phone number is on both lists, it will not be apart of the resulting group. - Updating a group targeted by a batch message scheduled in the future is allowed. Changes will be reflected when the batch is sent.- Parameters:
groupId- ID of a group that you are interested in getting. (required)groupUpdateRequest- (required)- Returns:
- Group
- Throws:
ApiException- if fails to make API call
-
create
Create an unnamed and empty group- Returns:
- See
create(GroupRequest) - Throws:
ApiException- Since:
- 1.5
-