Perform batch operations on select Conversation API resources.
Conversation API - Batch API | Sinch (1.0)
Send a message to one or many recipients. This API supports the same channels as Conversation API.
Request
Creates a batch of up to 1000 contacts as specified by the list of contacts.
The contacts are created asynchronously. A CONTACT_CREATE event will be generated for every successfully created contact.
The unique ID of the project. You can find this on the Sinch Dashboard.
List of contacts to be created in Conversation API.
List of channel identities. Array must contain at least one item.
The channel identity. This will differ from channel to channel. For example, a phone number for SMS, WhatsApp, and Viber Business.
The identifier of the channel you want to include. Must be one of the enum values.
| Enum Value | Description |
|---|---|
The WhatsApp channel. | |
| RCS | The RCS channel. |
| SMS | The SMS channel. |
| MESSENGER | The Facebook Messenger channel. |
| VIBERBM | The Viber Business Messages channel. |
| MMS | The MMS channel. |
The Instagram channel. | |
| TELEGRAM | The Telegram channel. |
| KAKAOTALK | The KakaoTalk channel. |
| KAKAOTALKCHAT | The KakaoTalk chat channel (used primarily in ConsultationTalk). |
Required if using a channel that uses app-scoped channel identities. Currently, FB Messenger, Instagram, LINE, and WeChat use app-scoped channel identities, which means contacts will have different channel identities on different Conversation API apps. These can be thought of as virtual identities that are app-specific and, therefore, the app_id must be included in the API call.
| Enum Value | Description |
|---|---|
| AF | Afrikaans |
| SQ | Albanian |
| AR | Arabic |
| AZ | Azerbaijani |
| BN | Bengali |
| BG | Bulgarian |
| CA | Catalan |
| ZH | Chinese |
| ZH_CN | Chinese (CHN) |
| ZH_HK | Chinese (HKG) |
List of channels defining the channel priority. The channel at the top of the list is tried first.
| Items Enum Value | Description |
|---|---|
The WhatsApp channel. | |
| RCS | The RCS channel. |
| SMS | The SMS channel. |
| MESSENGER | The Facebook Messenger channel. |
| VIBERBM | The Viber Business Messages channel. |
| MMS | The MMS channel. |
The Instagram channel. | |
| TELEGRAM | The Telegram channel. |
| KAKAOTALK | The KakaoTalk channel. |
| KAKAOTALKCHAT | The KakaoTalk chat channel (used primarily in ConsultationTalk). |
- The {region} variable must be set to either us, eu, or brhttps://us.conversationbatch.api.sinch.com/v1/projects/{project_id}/contacts
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X POST \
'https://us.conversationbatch.api.sinch.com/v1/projects/{project_id}/contacts' \
-H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
-H 'Content-Type: application/json' \
-d '{
"contacts": [
{
"channel_identities": [
{
"channel": "WHATSAPP",
"identity": "{{PHONE_NUMBER_1}}"
}
],
"language": "EN_US"
},
{
"channel_identities": [
{
"channel": "RCS",
"identity": "{{PHONE_NUMBER_2}}"
}
],
"language": "EN_US"
},
{
"channel_identities": [
{
"channel": "RCS",
"identity": "{{PHONE_NUMBER_3}}"
}
],
"language": "EN_US"
}
]
}'Request
Deletes a batch of up to 1000 contacts as specified by the list of contact IDs.
The contacts are deleted asynchronously. A CONTACT_DELETE event will be generated for every successfully deleted contact.
The unique ID of the project. You can find this on the Sinch Dashboard.
- The {region} variable must be set to either us, eu, or brhttps://us.conversationbatch.api.sinch.com/v1/projects/{project_id}/contacts
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X DELETE \
'https://us.conversationbatch.api.sinch.com/v1/projects/{project_id}/contacts' \
-H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
-H 'Content-Type: application/json' \
-d '{
"contact_ids": [
"{{CONTACT_1}}",
"{{CONTACT_2}}",
"{{CONTACT_3}}",
"{{CONTACT_4}}",
"{{CONTACT_5}}"
]
}'