Interface GroupsService
-
Method Summary
Modifier and TypeMethodDescriptioncreate()Create an unnamed and empty groupcreate(GroupRequest groupRequest) Create a groupvoidDelete a groupRetrieve a grouplist()List Groups (using default parameters)list(ListGroupsQueryParameters queryParameter) List GroupslistMembers(String groupId) Get phone numbers for a groupreplace(String groupId, GroupRequest groupRequest) Replace a groupupdate(String groupId, GroupUpdateRequest groupUpdateRequest) Update a group
-
Method Details
-
create
Create a groupThis 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 groupThis 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
-
get
Retrieve a groupThis 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
-
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 GroupsWith 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
-
listMembers
Get phone numbers for a groupThis 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
-
replace
Replace a groupThe 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
-
update
Update a groupWith 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
-