Campaign
Campaign feature is intended to send a single message text to multiple destination numbers via a single API request. The Campaign API supports sending messages up to 100 000 destination numbers with one campaign.
Messages to all recipients may not be delivered instantly. Messages are dequeued for delivery based on the rate limits configured for the account.
Campaign endpoints are meant to send and monitor campaigns scheduled by the account.
Method: Update
Operation updates the details of a campaign or cancels a scheduled campaign by changing its status.
URL | /v1/campaigns/{id} |
Method Type | PUT |
Authorization | API Key |
Request Content-Type | JSON |
Response Content-Type | JSON |
Headers
Name | Type | Description | Status |
---|---|---|---|
X-Dexatel-Key | string | API key | Required |
Request Body
Name | Type | Description | Status |
---|---|---|---|
data | object |
Details (see data object below) |
Required |
Name | Type | Description |
---|---|---|
name | string | Name of the campaign |
schedule | string | Scheduled date if there is any |
Response Parameters
Name | Type | Description |
---|---|---|
data | object |
Details (see data object below) |
Name | Type | Description |
---|---|---|
id | string | Unique identifier of the campaign |
account_id | string | Unique identifier of the account |
template_id | string | Unique identifier of the template |
audience_id | string | Unique identifier of the audience |
name | string | Unique name of the campaign |
status | string |
Status of the campaign. Possible values: • scheduled • in_progress • completed • failed • canceled |
schedule | string | Scheduled date if there is any |
channel | string |
Delivery channel of the massage. Possible values: SMS VIBER |
create_date | string | Creation date of the campaign in UTC, formatted as yyyyMM-dd HH:mm:ss |
update_date | string | Update date of the campaign in UTC, formatted as yyyyMM-dd HH:mm:ss |
messages | object |
Details (see messages object below) |
links | object |
Details (see links object below) |
Name | Type | Description |
---|---|---|
total | integer | Total count of all messages |
delivered | integer | Count of delivered messages |
failed | integer | Count of failed messages |
Name | Type | Description |
---|---|---|
self | string | URL of the campaign |
account | string | URL of the account |
template | string | URL of the template |
audience | string | URL of the audience |
Example of request body
Example of response body
Error Codes
The following error codes are returned in response to a user’s request which contains bad syntax or cannot be fulfilled.
Code | Description |
---|---|
1522 | Schedule date should be after current date |
1601 | Campaign is not found |
1602 | Invalid campaign identifier |
1603 | 'data.from' is required |
1604 | 'data.from' is invalid |
1605 | 'data.audience' is required |
1606 | 'data.audience' is invalid |
1607 | 'data.template' is required |
1608 | 'data.template' is invalid |
1609 | 'data.schedule' is invalid |
1611 | 'data.status' can not be changed |
1612 | Campaign cannot be deleted |
1613 | Campaign audience and template do not match |
1616 | Template ID does not exist for this channel |
1617 | Audience ID does not exist for this channel |