Download OpenAPI specification:Download
A group is a set of phone numbers (or MSISDNs) that can be used as a target when sending an SMS. An phone number (MSISDN) can only occur once in a group and any attempts to add a duplicate are ignored but not rejected.
With the list operation you can list all groups that you have created. This operation supports pagination.
Groups are returned in reverse chronological order.
service_plan_id required | string Your service plan ID. You can find this on your Dashboard. Example: jd63jf88477ll123ab4567cd89012ef3 |
A successful response, or an Error.
import fetch from 'node-fetch'; async function run() { const servicePlanId = 'YOUR_service_plan_id_PARAMETER'; const region = 'us'; const resp = await fetch( `https://${region}.sms.api.sinch.com/xms/v1/${servicePlanId}/groups`, { method: 'GET', headers: { Authorization: 'Bearer <YOUR_TOKEN_HERE>' } } ); const data = await resp.text(); console.log(data); } run();
{- "page": 50,
- "page_size": 50,
- "count": 0,
- "groups": [
- {
- "name": "string",
- "members": [
- "+453234457784"
], - "child_groups": [
- "string"
], - "auto_update": {
- "to": "string",
- "add": {
- "first_word": "string",
- "second_word": "string"
}, - "remove": {
- "first_word": "string",
- "second_word": "string"
}
}
}
]
}
A group is a set of phone numbers (MSISDNs) that can be used as a target in the send_batch_msg
operation. An MSISDN can only occur once in a group and any attempts to add a duplicate would be ignored but not rejected.
service_plan_id required | string Your service plan ID. You can find this on your Dashboard. Example: jd63jf88477ll123ab4567cd89012ef3 |
name | string <= 20 characters Name of the group |
members | |
child_groups | Array of strings <= 10 items Phone numbers (MSISDNs) of child group will be included in this group. If present then this group will be auto populated. Constraints: Elements must be group IDs. |
object |
Created, or an Error.
{- "members": [
- "member_MSISDNs",
- "as_strings_in_array",
- "16051234567"
], - "name": "YOUR_group_name"
}
{- "id": "01FC66621VHDBN119Z8PMV1QPU",
- "name": "My new customers",
- "size": 2,
- "created_at": "2019-08-24T14:15:22Z",
- "modified_at": "2019-08-24T14:15:22Z",
- "child_groups": [
- "01FC66621VHDBN119Z8PMV1AHY"
], - "auto_update": {
- "to": 15551231234,
- "add": "string",
- "remove": "string"
}
}
This operation retrieves a specific group with the provided group ID.
service_plan_id required | string Your service plan ID. You can find this on your Dashboard. Example: jd63jf88477ll123ab4567cd89012ef3 |
group_id required | string ID of a group that you are interested in getting. |
A successful response, or an Error.
import fetch from 'node-fetch'; async function run() { const servicePlanId = 'YOUR_service_plan_id_PARAMETER'; const groupId = 'YOUR_group_id_PARAMETER'; const region = 'us'; const resp = await fetch( `https://${region}.sms.api.sinch.com/xms/v1/${servicePlanId}/groups/${groupId}`, { method: 'GET', headers: { Authorization: 'Bearer <YOUR_TOKEN_HERE>' } } ); const data = await resp.text(); console.log(data); } run();
{- "id": "01FC66621VHDBN119Z8PMV1QPU",
- "name": "My new customers",
- "size": 2,
- "created_at": "2019-08-24T14:15:22Z",
- "modified_at": "2019-08-24T14:15:22Z",
- "child_groups": [
- "01FC66621VHDBN119Z8PMV1AHY"
], - "auto_update": {
- "to": 15551231234,
- "add": "string",
- "remove": "string"
}
}
With the update group operation, you can add and remove members in an existing group as well as rename the group.
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 in both lists, then it will not be apart of the resulting group.
To remove an existing name set, name explicitly to the JSON value null. Omitting name from the JSON body will leave the name unchanged.
Updating a group targeted by a batch message scheduled in the future is allowed and changes will be reflected until the batch is sent.
service_plan_id required | string Your service plan ID. You can find this on your Dashboard. Example: jd63jf88477ll123ab4567cd89012ef3 |
group_id required | string ID of a group that you are interested in getting. |
A successful response, or an Error.
{- "name": "Homeowners",
- "auto_update": {
- "to": "443456789012",
- "add": {
- "first_word": "Join"
}, - "remove": {
- "first_word": "Stop"
}
}
}
{- "id": "01FC66621VHDBN119Z8PMV1QPU",
- "name": "My new customers",
- "size": 2,
- "created_at": "2019-08-24T14:15:22Z",
- "modified_at": "2019-08-24T14:15:22Z",
- "child_groups": [
- "01FC66621VHDBN119Z8PMV1AHY"
], - "auto_update": {
- "to": 15551231234,
- "add": "string",
- "remove": "string"
}
}
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.
service_plan_id required | string Your service plan ID. You can find this on your Dashboard. Example: jd63jf88477ll123ab4567cd89012ef3 |
group_id required | string ID of a group that you are interested in getting. |
members required | Array of strings <e.164> (msisdn) <= 10000 items The initial members of the group. Constraints: Elements must be phone numbers in E.164 format MSISDNs. |
name | string <= 20 items Name of group. |
A successful response, or an Error.
{- "members": [
- "123456789",
- "987654321"
], - "name": "New Name of the Group"
}
{- "id": "01FC66621VHDBN119Z8PMV1QPU",
- "name": "My new customers",
- "size": 2,
- "created_at": "2019-08-24T14:15:22Z",
- "modified_at": "2019-08-24T14:15:22Z",
- "child_groups": [
- "01FC66621VHDBN119Z8PMV1AHY"
], - "auto_update": {
- "to": 15551231234,
- "add": "string",
- "remove": "string"
}
}
This operation deletes the group with the provided group ID.
service_plan_id required | string Your service plan ID. You can find this on your Dashboard. Example: jd63jf88477ll123ab4567cd89012ef3 |
group_id required | string ID of a group that you are interested in getting. |
A successful response , or an Error.
import fetch from 'node-fetch'; async function run() { const servicePlanId = 'YOUR_service_plan_id_PARAMETER'; const groupId = 'YOUR_group_id_PARAMETER'; const region = 'us'; const resp = await fetch( `https://${region}.sms.api.sinch.com/xms/v1/${servicePlanId}/groups/${groupId}`, { method: 'DELETE', headers: { Authorization: 'Bearer <YOUR_TOKEN_HERE>' } } ); const data = await resp.text(); console.log(data); } run();
This operation retrieves the members of the group with the provided group ID.
service_plan_id required | string Your service plan ID. You can find this on your Dashboard. Example: jd63jf88477ll123ab4567cd89012ef3 |
group_id required | string ID of a group that you are interested in getting. |
import fetch from 'node-fetch'; async function run() { const servicePlanId = 'YOUR_service_plan_id_PARAMETER'; const groupId = 'YOUR_group_id_PARAMETER'; const region = 'us'; const resp = await fetch( `https://${region}.sms.api.sinch.com/xms/v1/${servicePlanId}/groups/${groupId}/members`, { method: 'GET', headers: { Authorization: 'Bearer <YOUR_TOKEN_HERE>' } } ); const data = await resp.text(); console.log(data); } run();
[- "+453234457784"
]