Documentazione API
Analizza esempi di richieste API, controlla l'elenco completo dei codici di errore.
SMS API (1.0.2)
The SMS Connexion™ Messaging API is RESTful and is served only over HTTPS. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body.
You can use your favorite HTTP/REST library for your programming language to consume our API, or you can use one of our SDKs.
- Requests are sent over HTTPS.
- Request and response bodies are JSON formatted.
- Query parameters naming is
snake_case
(eg. short_response, start_date, end_date) - Request/response bodies parameters (from JSON objects) are
camelCase
(eg. phoneNumbers, allowInvalid)
All dates are in UTC and the datetime format used is YYYY-MM-DD HH:MM:SS
e.g. 2021-07-12 14:54:13
All phone numbers should match the international format E.164, wich define that numbers are formatted with "+" sign, followed by the country code and the subscriber number and can have a maximum length of 15 digits.
e.g. +4915123xxxxxx
for Germany, +3361231xxxx
for France, +39312311xxxx
for Italy
All country names an country codes in this API are represented as two-letter country codes defined in ISO-3166 alpha 2 standard.
e.g. DE
for Germany, FR
for France, IT
for Italy
The currency code is in ISO-4217 format.
e.g. eur
for Euro, usd
for US Dollar
The SMS.CX Messaging API supports the Oauth2 client credentials flow (RFC 6749).
The Oauth2 uses scopes to provide a certain rights management for specific endpoints. Please check the full list of available scopes.
Authenticating via Oauth2 method requires the following steps:
- Create a Client (or reffered as an Application) - you will get
client_id
andclient_secret
- Generate an Access Token
- Make Authenticated Requests
1. Create a Client (or Application)
First go to the Admin Dashboard > HTTP API > Oauth2 and create a new Application (or Client).
*Admin Dashoard*
You will have to select the token expiration (1 day, 1 week or never) for all the access tokens issued by this Application, and to select the scopes allowed (sms, viber, whatsapp, groups, reports, etc.).
From the Admin Dashboard you will get the Application ID and Application Secret that will be used as parameters client_id
and client_secret
on the next step.
2. Generate an access token
To generate an access token your app makes a POST request to the Authorization endpoint /oauth/token
, with the following parameters:
Parameter | Type | Description |
---|---|---|
client_id | required | Client ID |
client_secret | required | Client secret |
grant_type | required | Must be client_credentials |
scope | optional | A url encoded list of space-delimited, case-sensitive strings. If left empty, the access token issued will be granted with all scopes (full privileges) |
The POST request needs to use the HTTP Basic authentication scheme, by encoding client_id:client_secret
string to Base64 string and use it in the header:
Authorization: Basic czZCaGRSa3F0Mzo3RmpmcDBaQnIxS3REUmJuZlZkbUl3
Alternatively, the authorization server supports including the client authentication in the request-body.
Including the client credentials in the request-body using the two parameters
client_id
andclient_secret
is not recommended and should be limited to apps/clients that are unable to directly utilize the HTTP Basic authentication scheme.
Example with client authentication as Basic Auth header [RECOMMENDED]
POST /oauth/token HTTP/1.1
Authorization: Basic client_id:client_secret (base64 encoded value)
Content-Type: application/x-www-form-urlencoded
grant_type=client_credentials
Example with client authentication in request body
POST /oauth/token HTTP/1.1
Content-Type: application/x-www-form-urlencoded
client_id=<CLIENT_ID>&client_secret=<CLIENT_SECRET>&grant_type=client_credentials
The Authorization endpoint will validate the request and if successfull will respond with an access token:
An example successful response:
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Cache-Control: no-store
Pragma: no-cache
{
"access_token": "1d0d303679dba1135e372a9eccda02b0601eb4f9",
"expires_in": 86400,
"token_type": "Bearer",
"scope": "sms viber whatsapp multichannel conversations reports groups originators templates shortlinks attachments optouts account applications numbers"
}
Note: Each scope represents a resource, an endpoint.
For example, if your access token does not have
groups
scope granted, then the resource/groups
will not be available. If scopessms
,groups
,templates
are granted, then the access token can send SMS, create/edit/delete groups, add contacts to groups, create/edit/delete templates
3. Make authenticated requests
Once the access token is obtained, it has to be provided on each request as a bearer token within the Authorization http header (Bearer Token Usage RFC 6750).
Example using the access token as bearer authorization
POST /sms HTTP/1.1
Authorization: Bearer REPLACE_ACCESS_TOKEN
GET /groups HTTP/1.1
Authorization: Bearer REPLACE_ACCESS_TOKEN
If an access token is compromised, go to Admin Dashboard and revoke all tokens for that specific application. If needed, you can reset the application secret from the same section.
API keys, like access tokens, have a set of capabilities assigned to them. However, unlike access tokens wich provides more fine-grained access control and can have limited lifetime, API keys provides full access to all the account resources and are long-lived.
To authenticate an API request just add the custom header X-API-KEY
to the request header.
You can generate and manage your API keys in the Admin Dashboard > HTTP API > API Keys.
*Admin Dashoard*
If an API Key is compromised, go to Admin Dashboard and deactivate or delete that API Key.
The API uses standard HTTP status codes to indicate the success or failure of the API calls.
Status code | Description |
---|---|
200 OK | The request has succeeded |
201 Created | This code indicates that the request led to the creation of a resource |
In case of success the response body contains a JSON object with the following structure:
info
- object of objects - contains information about the fetched/created resource, e.g. ids, summary of fetched/processed collections, etc.data
- array of objects - contains the collection of data fetched or processed
Request to get group details
GET /groups/4360975
Authorization: Bearer 202f9f782e***************a2e1ff58103b971
Response with info
and data
200 OK
Content-Type: application/json
{
"info": {
"id": 17,
"name": "My group 3",
"totalPhoneNumbers": 3,
"totalCost": 0.123,
"totalOptouts": 1,
"phoneNumbersByCountry": {
"ES": 1,
"FR": 1,
"GB": 1
},
"createdAt": "2021-07-10 13:03:08"
},
"data": [
{
"id": 44631,
"phoneNumber": "+33612935399",
"countryIso": "FR",
"firstName": "Anton",
"lastName": "Maheu",
"email": null,
"field1": null,
"field2": null,
"field3": null,
"field4": null,
"field5": null,
"groupId": 17,
"optout": true,
"dateAdded": "2021-07-10 13:03:09"
},
{
"id": 44632,
"phoneNumber": "+34612160806",
"countryIso": "ES",
"firstName": "Almanza",
"lastName": "Quintero",
"email": "almanza.quintero123@tempmail.com",
"field1": null,
"field2": null,
"field3": null,
"field4": null,
"field5": null,
"groupId": 17,
"optout": false,
"dateAdded": "2021-07-10 13:03:09"
},
{
"id": 44633,
"phoneNumber": "+447400547989",
"countryIso": "GB",
"firstName": "Hayden",
"lastName": "Francis",
"email": null,
"field1": null,
"field2": null,
"field3": null,
"field4": null,
"field5": null,
"groupId": 17,
"optout": false,
"dateAdded": "2021-07-10 13:03:09"
}
]
}
Request to create new group of contacts
POST /groups
Content-Type: application/json
Authorization: Bearer 202f9f782e***************a2e1ff58103b971
{
"name": "My new group"
}
Response only with info
201 Created
Content-Type: application/json
{
"info": {
"id": 18,
"name": "My new group"
}
}
Request to delete a shortlink
DELETE /shortlinks/xYuQ
Authorization: Bearer 202f9f782e***************a2e1ff58103b971
Response only with info
200 OK
Content-Type: application/json
{
"info": {
"id": "xYuQ"
}
}
The API uses standard HTTP status codes to indicate the failure of and API request. The body of the error response will always be a JSON object in the following format:
HTTP/1.1 400 Bad Request
{
"error": {
"type": "invalid_param",
"message": "The name is empty or parameter 'name' not set",
"uri": "https://sms.cx/docs/api/errors",
"code": 1204
}
}
Description of error
object
Property | Type | Description |
---|---|---|
type | string |
The type of error returned (invalid_param, not_found, access_denied, invalid_client, insufficient_scope, etc) |
message | string |
A short, human-readable description of the error |
uri | string |
A URI reference in the documentation that provides further information |
code | integer |
An internal code of the error |
There are some specific cases - when validating phone numbers - in wich the response body contains the error
object plus the property invalid
wich is an array with invalid phone numbers.
The endpoints that validate phone numbers at runtime and throw errors if invalid are:
/sms
/viber
/whatsapp
/multichannel
/groups/{groupId}
Note: Pparameter
allowInvalid
with valuetrue
can be used in the request body in order not to throw an error and continue execution. The valid phone numbers will be added to the group, the invalid numbers will be placed in theinfo.invalid
object.
Request to add phone numbers to a group
POST /groups/4339812
Content-Type: application/json
Authorization: Bearer 202f9f782e***************a2e1ff58103b971
{
"phoneNumbers": [
"+336129353",
"+33612970283",
"+3361211",
"+43664187834",
"+41781218472",
"+351912110421",
"+4915123473140",
"+4915123595",
"+4915123966046"
]
}
Response only with error
and invalid
400 Bad Request
Content-Type: application/json
{
"error": {
"type": "invalid_param",
"message": "The phone numbers provided are invalid",
"uri": "https://sms.cx/docs/api/errors",
"code": 1210
},
"invalid": [
"+336129353",
"+3361211",
"+4915123595"
]
}
SMS.CX Messaging API uses the HTTP status codes for errors:
For 4XX response there was some problem with your authentication, the privileges, the structure of your request or rate limited.
A 5XX response indicate an internal error occurred, you should retry your request with an exponential backoff method.
HTTP code | Error type | Description |
---|---|---|
400 | invalid_param | The parameters provided are invalid or are missing |
400 | duplicate_id | The ID already exist (for shortlinks and attachments) |
400 | duplicate_value | The value already exists |
400 | insufficient_credit | Your account balance is too low for the request |
400 | otp_verified | The OTP was already verified |
400 | otp_cancelled | The OTP was canceled |
400 | otp_expired | The OTP has expired |
400 | otp_failed | The OTP failed (max attempts reached) |
400 | invalid_pin | The PIN provided does not verify |
400 | invalid_body | The request body did not contain valid JSON |
400 | invalid_request | The request is missing a required parameter (grant_type) |
400 | invalid_scope | The requested scope is invalid, unknown, or malformed |
400 | unsupported_grant_type | The grant type is not supported (only client_credentials) |
401 | invalid_api_key | The api key provided is not valid |
401 | invalid_client | Your access token is not valid |
403 | no_coverage | No coverage or restricted destination |
403 | access_denied | The action is not allowed or not enough permission to perform |
403 | insufficient_scope | The resource requested requires higher privileges than provided by the access token |
404 | not_found | The ID provided does not exist |
405 | invalid_method | The request method is not supported by the target resource |
429 | rate_limit | The request was rate limited |
500 | server_error | An internal server error occurred |
HTTP code | Code | Error type | Description |
---|---|---|---|
400 | 1101 | invalid_param | The parameter groups is empty or not set |
400 | 1102 | invalid_param | Group is empty |
400 | 1103 | invalid_param | The phone numbers array is too big (max. allowed: 25000 numbers) |
400 | 1104 | invalid_param | The parameter to is empty or not set |
400 | 1105 | invalid_param | The parameter from is empty or not set |
400 | 1106 | invalid_param | The parameter from is not valid (min 3, max 15 characters) |
400 | 1107 | invalid_param | The parameter text is empty or not set |
400 | 1108 | invalid_param | The parameter scheduledDate is not a valid date |
400 | 1109 | invalid_param | The parameter dlrCallbackUrl is not a valid URL |
400 | 1110 | invalid_param | Invalid alphabet. Must be one of: NONE , NON_GSM , RUSSIAN_CYRILLIC , BULGARIAN_CYRILLIC , UKRAINIAN_CYRILLIC , MACEDONIAN_CYRILLIC , BELARUSIAN_CYRILLIC , SERBIAN_CYRILLIC , POLISH , ROMANIAN , TURKISH , GREEK |
400 | 1111 | invalid_param | Idempotency Id provided is not a valid UUID (v1-v5) |
400 | 1112 | invalid_param | The shortlink/attachment ID provided for tracking is invalid or not found |
400 | 1113 | insufficient_credit | Insufficient credit |
400 | 1114 | insufficient_credit | Credit limit reached. To increase the credit limit, please contact your account manager |
400 | 1115 | invalid_param | Message ID provided is not valid |
400 | 1116 | invalid_param | The scheduled date is in the past |
400 | 1117 | invalid_body | Invalid JSON |
400 | 1120 | invalid_param | The parameter strategy is empty or not set |
400 | 1121 | invalid_param | The parameter strategy must have at least two channels |
400 | 1122 | invalid_param | The parameter strategy must have channel sms as last element |
400 | 1123 | invalid_param | The parameter channel is not valid. Allowed values: |
400 | 1124 | invalid_param | The parameter ttl is not a number |
400 | 1125 | invalid_param | Min value for ttl is 300 seconds |
400 | 1126 | invalid_param | The parameter templateId is not set |
400 | 1127 | invalid_param | The parameter templateId is not valid |
400 | 1128 | invalid_param | The template ID provided is not a valid template |
400 | 1129 | invalid_param | The parameter strategy contains duplicate channels |
400 | 1130 | insufficient_credit | Insufficient credit for failover sending |
400 | 1134 | invalid_param | Max value for ttl is 1209600 seconds (14 days) |
400 | 1135 | invalid_param | The parameter transliteration should be an object |
400 | 1136 | invalid_param | Invalid number of characters for the placeholder {{numbers}} |
400 | 1136 | invalid_param | Invalid number of characters for the placeholder {{letters}} |
400 | 1136 | invalid_param | Invalid number of characters for the placeholder {{alphanumeric}} |
400 | 1137 | invalid_param | Number of characters for placeholders can be between 1 and 20 |
400 | 1140 | invalid_param | Group ID is not a valid group |
400 | 1155 | invalid_param | Campaign ID provided is not valid |
400 | 1165 | invalid_param | Campaign ID or msg ID provided is not valid |
400 | 1203 | invalid_param | The parameter phoneNumbers is empty or not set |
400 | 1205 | invalid_param | The phone numbers array is too big (max. allowed: 40000 numbers) |
400 | 1204 | invalid_param | The name is empty or parameter name not set |
400 | 1206 | invalid_param | The name provided is invalid (min 3, max 60 characters) |
400 | 1207 | invalid_param | The phone number provided is not valid |
400 | 1208 | invalid_param | The parameter phoneNumbers must be an array of phone numbers |
400 | 1209 | invalid_param | The parameter lookupCallbackUrl is not a valid URL |
400 | 1210 | invalid_param | The phone numbers provided are invalid |
400 | 1211 | duplicate_value | You already have a group with this name |
400 | 1212 | invalid_param | Invalid request parameters |
400 | 1213 | invalid_param | At least one parameter required (phoneNumber, firstName, lastName, email, field1, field2, field3, field4, field5, customFields) |
400 | 1215 | duplicate_value | The phone number already exists |
400 | 1216 | invalid_param | No valid numbers provided or no coverage |
400 | 1217 | invalid_param | The lookupId provided is invalid |
400 | 1218 | invalid_param | The lookupBulkId provided is invalid |
400 | 1301 | invalid_param | The originator is empty or parameter originator not set |
400 | 1303 | invalid_param | The parameter originator can contain only letters and numbers |
400 | 1304 | invalid_param | The alphanumeric originator provided is invalid (min 3, max 11 characters) |
400 | 1305 | invalid_param | The numeric originator provided is invalid (min 3, max 15 characters) |
400 | 1306 | duplicate_value | Originator already exists |
400 | 1401 | invalid_param | The URL is empty or parameter url not set |
400 | 1402 | invalid_param | The URL provided is invalid |
400 | 1404 | invalid_param | The parameter name is invalid (min 3, max 25 characters) |
400 | 1405 | duplicate_id | Short ID already exists |
400 | 1406 | invalid_param | At least one parameter required (name, url) |
400 | 1407 | duplicate_value | You already have a shortlink with this name |
400 | 1425 | duplicate_id | Attachment ID already exists |
400 | 1427 | duplicate_value | You already have an attachment with this name |
400 | 1441 | invalid_param | No valid phone numbers were provided or already in the optout list |
400 | 1503 | invalid_param | The parameter removeEmojis is not boolean (true or false) |
400 | 1521 | invalid_param | The channel requested is not valid |
400 | 1522 | invalid_param | Invalid country iso or mcc |
400 | 1801 | invalid_param | The text message is empty or parameter text not set |
400 | 1802 | invalid_param | The parameter text is invalid |
400 | 1803 | invalid_param | The name provided is invalid (min 3, max 100 characters) |
400 | 1804 | invalid_param | At least one parameter required (name, text) |
400 | 1805 | duplicate_value | You already have a template with this name |
400 | 1806 | invalid_param | The parameter channel is not valid. Allowed values: |
400 | 1808 | invalid_param | Button caption is too long (min 1, max. 30 characters) |
400 | 1809 | invalid_param | Invalid target URL |
400 | 1810 | invalid_param | Invalid image URL |
400 | 1811 | invalid_param | Text message too long (max 1000 characters) |
400 | 1820 | invalid_param | The parameter period is not a valid date (format Y-m or Y) |
400 | 1821 | invalid_param | The parameter start_date is not a valid date |
400 | 1822 | invalid_param | The parameter end_date is not a valid date |
400 | 1823 | invalid_param | The end date is before the start date |
400 | 1824 | invalid_param | No period parameter or interval (start_date , end_date ) |
400 | 1825 | invalid_param | The parameter source is not valid |
400 | 1826 | invalid_param | The parameter delivery_report is not valid (delivered, failed or sent) |
400 | 1827 | invalid_param | The parameter country_iso is not for a valid country |
400 | 1828 | invalid_param | The parameter channel is not valid (sms, viber, whatsapp, multichannel) |
400 | 1829 | invalid_param | Invalid dimension. Accepted dimensions: source, channel, country, traffic, delivery |
400 | 1600 | invalid_request | The request is missing a required parameter (grant_type) |
400 | 1600 | invalid_scope | The requested scope is invalid, unknown, or malformed |
400 | 1600 | unsupported_grant_type | The grant type is not supported (only client_credentials) |
400 | 2001 | invalid_param | The parameter phoneNumber is empty or not set |
400 | 2002 | invalid_param | The parameter countryIso is empty or not set |
400 | 2003 | invalid_param | Country ISO provided is invalid |
400 | 2004 | invalid_param | The parameter from is empty or not set |
400 | 2005 | invalid_param | The parameter from is not valid (min 3, max 15 characters) |
400 | 2006 | invalid_param | The parameter template is empty or not set |
400 | 2006 | invalid_param | The parameter template does not contain placeholder {{pin}} |
400 | 2007 | invalid_param | The parameter ttl is not a number |
400 | 2008 | invalid_param | Min value for ttl is 60 seconds |
400 | 2009 | invalid_param | Max value for ttl is 1800 seconds (30 mins) |
400 | 2010 | invalid_param | The parameter maxAttempts is not a number |
400 | 2011 | invalid_param | Min value for maxAttempts is 1 |
400 | 2012 | invalid_param | Max value for maxAttempts is 10 |
400 | 2013 | invalid_param | The parameter pinType is empty or not set |
400 | 2014 | invalid_param | Invalid parameter pinType . Must be one of: letters, numbers, alphanumeric |
400 | 2015 | invalid_param | The parameter pinLength is not a number |
400 | 2016 | invalid_param | Min value for pinLength is 4 |
400 | 2017 | invalid_param | Max value for pinLength is 10 |
400 | 2018 | invalid_param | Track ID provided (parameter trackId ) is not a valid UUID (v1-v5) |
400 | 2019 | invalid_param | The parameter otpCallbackUrl is not a valid URL |
400 | 2020 | invalid_param | The phone number provided is invalid |
404 | 2021 | not_found | Otp ID not found |
400 | 2022 | invalid_param | The parameter pin is empty or not set |
400 | 2023 | otp_verified | The OTP was already verified |
400 | 2024 | otp_cancelled | The OTP was canceled |
400 | 2025 | otp_expired | The OTP has expired |
400 | 2026 | otp_failed | The OTP has failed, maximum attempts reached |
400 | 2027 | otp_failed | Max attempts reached |
400 | 2028 | otp_expired | The PIN has expired |
400 | 2029 | invalid_pin | The PIN provided does not verify |
400 | 1221 | invalid_param | The rentId provided is invalid |
400 | 1222 | invalid_param | Invalid parameter numberId |
400 | 1224 | invalid_param | Rent period is invalid (1, 7 or 30 days) |
400 | 1225 | invalid_param | Parameter autorenew must be type boolean |
400 | 1226 | invalid_param | The parameter callbackUrl is not a valid url |
400 | 1229 | invalid_param | Rent period is lower than the minimum rent period of this number |
400 | 1233 | invalid_param | At least one parameter required (autoRenew, callbackUrl) |
400 | 1234 | invalid_param | Registration ID provided is invalid or not found |
401 | 1601 | invalid_api_key | Invalid Api Key |
401 | 1600 | invalid_client | Invalid client |
401 | 1604 | invalid_client | Client authentication failed |
403 | 1118 | access_denied | Only scheduled campaigns/messages can be deleted |
403 | 1119 | no_coverage | No coverage or restricted destination |
403 | 1214 | no_coverage | No coverage or restricted destination |
403 | 1131 | access_denied | The strategy contains channels that are not active: |
403 | 1132 | access_denied | The template ID provided is not approved |
403 | 1133 | access_denied | The template ID provided is not locked |
403 | 1181 | access_denied | Cannot reply with channel Viber. More than 24 hours since user reply |
403 | 1182 | access_denied | Cannot reply with channel Whatsapp. More than 24 hours since user reply |
403 | 1443 | access_denied | Cannot delete this phone number from the optout list because it was added via optout type link . Allowed optout type to delete: admin |
403 | 1523 | no_coverage | No coverage |
403 | 1602 | access_denied | The Api Key provided is not active |
403 | 1603 | insufficient_scope | The request requires higher privileges than provided by the access token |
403 | 1605 | access_denied | Access denied for this IP address |
403 | 1606 | access_denied | The channel Viber is not active. Register from Admin Dashboard |
403 | 1607 | access_denied | The channel Whatsapp is not active. Register from Admin Dashboard |
403 | 1608 | access_denied | The channel Multichannel is not active. Register from Admin Dashboard |
403 | 1812 | access_denied | Template is locked for editing |
403 | 2030 | access_denied | Otp already cancelled |
403 | 2031 | access_denied | You cannot cancel a non-pending Otp |
403 | 3600 | access_denied | Account locked. Please contact your account manager |
404 | 1100 | not_found | Message ID provided was not found or is not scheduled |
404 | 1150 | not_found | Campaign ID provided was not found or is not scheduled |
403 | 1227 | access_denied | Cannot cancel this rent. More than 30 minutes passed from start of renting period |
403 | 1227 | access_denied | Cannot cancel this rent. More than 30 minutes passed from start of renting period |
403 | 1232 | access_denied | Cannot cancel this rent. The number has already been used for inbound SMS |
403 | 1231 | access_denied | Cannot rent this phone number (already rented) |
404 | 1160 | not_found | Campaign ID or msg ID provided was not found |
404 | 1180 | not_found | Conversation ID not found |
404 | 1200 | not_found | Group ID not found |
404 | 1202 | not_found | Phone number ID not found |
404 | 1219 | not_found | Lookup ID not found |
404 | 1220 | not_found | Lookup Bulk ID not found |
404 | 1300 | not_found | Originator ID not found |
404 | 1400 | not_found | Shortlink ID not found |
404 | 1420 | not_found | Attachment ID not found |
404 | 1440 | not_found | Optout ID not found |
404 | 1500 | not_found | Application ID not found |
404 | 1800 | not_found | Template ID not found |
404 | 1900 | not_found | The requested resource could not be found |
404 | 2021 | not_found | Otp ID not found |
404 | 1223 | not_found | Rent ID not found |
404 | 1230 | not_found | Number ID not found or number is not available for rent anymore |
405 | 1901 | invalid_method | HTTP Method must be one of: GET, POST, DELETE, PATCH |
429 | 1700 | rate_limit | Request rate limit exceeded, please try again later. Check Header X-Rate-Limit-Reset . Contact Support in order to change the rate limits for your account |
500 | 1000 | server_error | The server encountered an unexpected condition which prevented it from fulfilling the request |
When sending an SMS, the API allows to track the success or failure of the SMS by providing different statuses.
The following statuses are available:
Status | Status Code | Type | Description |
---|---|---|---|
ACCEPTED | 0 | Intermediate | The initial status of an SMS. It means that your request was received and the SMS is about to be sent |
SENT | 3 | Intermediate | The message was sent to the recipient but no final status is available yet |
DELIVERED | 1 | Final | Message was delivered to the mobile phone |
FAILED | 2 | Final | Message was not delivered |
NO COVERAGE | 5 | Final | Message was not accepted for delivery because there is no coverage to specified destination. You will not be billed for messages with this status |
REJECTED | 4 | Final | Message was not accepted for delivery (the recipient is in blacklist/optout list). You will not be billed for rejected messages |
SCHEDULED | 9 | Intermediate | Message was scheduled for processing at the specified date and time |
Note that statuses of type Intermediate will not trigger a request to your callback URL. They can only be reported if you request the status by message ID.
The errorCode
parameter in the DLR callback gives more information about a failed delivery. A non-null value indicates that the message could not be delivered.
errorCode | Type | Description |
---|---|---|
null | No error | No error in the handling of the message |
1 | Unknown | Message was not delivered, and no reason could be provided |
2 | Unknown Number | The destination number is unknown or no longer exists |
3 | Roaming | The destination number is in roaming and cannot accept the message |
4 | Number Blocked | The destination number is blocked by the network operator to receive the message |
5 | Carrier Rejection | The message was blocked by the operator's anti-spam filter. Check the content of your message |
50 | Regulation Error | Unknown country specific regulation error |
60 | General Error | There was an error in the routing of the message |
The API supports idempotency for safely retrying requests without accidentally performing the same operation twice. This is useful when an API call is disrupted in transit and you do not receive a response. For example, if a request to send a SMS campaign to 20.000 phone numbers does not respond due to a network connection error, you can retry the request with the same idempotency id to guarantee that no more than one campaign is sent and you are not billed twice.
To perform an idempotent request, provide an additional idempotencyId
parameter to the request body. To confirm that the server understood the request, the response will contain the header X-Idempotency-Id
with your unique value.
SMS.CX Messaging API's idempotency works by saving the resulting status code and body of the first request made for any given idempotency ID, only if the incoming parameters pass validation and the API endpoint begin execution. Subsequent requests with the same id return the same result, including 500
errors. If incoming parameters failed validation (HTTP status 4XX), no idempotent result is saved because no API endpoint began execution. It is safe to retry these requests.
An idempotency ID is a unique value generated by the client which the server uses to recognize subsequent retries of the same request. The unique values you create must be valid UUIDs (from v1 to v5) to avoid collisions.
Idempotency IDs are removed from the system automatically after they're at least 24 hours old.
Idempotency IDs are supported on POST
requests that affects the billing. Sending idempotency ids in GET
and DELETE
requests has no effect, as these requests are idempotent by definition.
The Messaging API is fast and can validate and send up to 25.000 SMS/Viber/Whatsapp in a single request. If the response from the API is intrerrupted due to a network connectivity error and you retry the request with the same idempotency ID, if the execution of the API endpoint didn't finished you will get the following intermediary reseponse:
{
"info": {
"idempotencyId": "287c1e8d-4842-4106-8fe9-4debf8855743",
"route": "/sms",
"status": "processing"
}
}
In this case you should safely retry the request with an exponential backoff method.
The methods that accept an idempotency id are the following:
There are limits to the number of API calls that your application can make against a particular endpoint. Each API response you receive will include the headers X-Rate-Limit-Limit
and X-Rate-Limit-Remaining
Exceeding a rate limit will result in an HTTP 429 Too Many Requests
status code. It will include an X-Rate-Limit-Reset
header that indicates the remaining window before the rate limit resets, in UTC epoch seconds (e.g. 1626119010).
Each API request has an associated request identifier. You can find this value in the response headers, under X-Request-Id
. If you need to contact us about a specific request, providing the request identifier will ensure the fastest possible resolution.
For improved security you can create a list of allowed IP addresses. Only IP addresses in the allowed list can make API calls using the applications credentials (Access Tokens, API Keys). If the list is left empty, all IP addresses are allowed.
To add an IP address to the allowed list, go to Admin Dashboard.
*Admin Dashboard - HTTP API - Security*
Note: Only IPv4 addresses are supported
API requests made from an IP address not in the allowed list will result in the following response:
403 Forbidden
Content-Type: application/json
{
"error": {
"type": "access_denied",
"message": "Access denied for this IP address",
"uri": "https://developers.sms.cx/docs/rest/ip-access/errors",
"code": 1605
}
}
When making data requests it is likely that there is more data than can be returned in a single response. When that is the case the response will include a paging
object with a next
token, previous
token and size
of the returned collection. Whenever a next
token is provided, there is additional data to retrieve so you will need to keep making API requests. If the next
token is null
then you reached the end of the data collection.
To request the next page of data, you must make the exact same query as the original, and also include a next
request parameter set to the value from the previous response.
The same applies for previous
token, except that the first request will have the previous token as null
.
You can limit the number of results returned with the query parameter limit
. The default and the maximum limit in the same time is 500.
Webhooks are an addition to an API, and rather of your code making the request for data, the API sends data to you. The data makes it to your application in the form of a HTTP request.
The API will make HTTP requests to your endpoints, saved in the application settings or that are set during your API calls. Your endpoints must return status HTTP 200 OK
for the callback request to be marked as successful. If not successful, the API will retry the request using an exponential backoff algorithm.
The retry policy will follow this delay from the initial attempt:
Retry attempt | Delay |
---|---|
1 | 1 minute |
2 | 2 minutes |
3 | 5 minutes |
4 | 10 minutes |
5 | 30 minutes |
6 | 1 hour |
7 | 2 hours |
8 | 4 hours |
9 | 8 hours |
10 | 24 hours |
SMS.CX API allows you to set a different callback/webhook URL for each resource that accepts this parameter.
However, if you want you can use only one endpoint for receiving data from SMS.CX API. The sent data is standardized across all callbacks, every request will have two objects: event
and data
. This makes it easier to use only one endpoint for all callbacks and identify the correct event for specific processing.
The event
parameter can have the following values:
- dlr_update
- receive_sms
- receive_viber
- receive_whatsapp
- shortlink_hit
- shortlink_hit_update
- attachment_hit
- attachment_hit_update
- new_optout
- otp_update
- number_lookup
The SMS.CX API groups the data by event type in the data
object and send up to 200 events in one single callback request. Therefore, your endpoint must expect to parse and iterate trough all the data
object.
Note: If by any reason your endpoint cannot handle bulk event grouping, please contact us so we can switch your callback settings to single request. Also, you can request increase or decrease in the data object grouping (eg. 40 events per request, 500 events per request, etc.)
Example of callback request with event type "dlr_update" and 3 events grouped in the data object:
{
"event": "dlr_update",
"data": [
{
"campaignId": "961dbfa9-8e12-4f96-b59d-6c0c79c53edc",
"msgId": "4dd5e899-6ced-4fd5-bbb6-34e51507e3df",
"trackData": "7f543bdc-dcc5-47c3-b54a-ee425f78cb3c",
"statusCode": 1,
"status": "DELIVERED",
"datetime": "2022-03-03 15:30:24"
},
{
"campaignId": "0ef52a99-10b1-4813-af84-9b285edfbc30",
"msgId": "a710a44a-e784-4199-b73c-a2c8bfd41b59",
"trackData": "7f543bdc-dcc5-47c3-b54a-ee425f78cb3c",
"statusCode": 1,
"status": "DELIVERED",
"datetime": "2022-03-03 15:30:24"
},
{
"campaignId": "961dbfa9-8e12-4f96-b59d-6c0c79c53edc",
"msgId": "4dd5e899-6ced-4fd5-bbb6-34e51507e3df",
"trackData": "7f543bdc-dcc5-47c3-b54a-ee425f78cb3c",
"statusCode": 1,
"status": "DELIVERED",
"datetime": "2022-03-03 15:30:24"
}
]
}
For complete details of each callback event (parameters list, examples) read the specific section:
Method | Resource | Description | Reference |
---|---|---|---|
POST | /sms | Send new SMS (single or bulk) | Link |
POST | /sms/estimate | Estimate cost of SMS (single or bulk) | Link |
POST | /sms/campaign | Send SMS campaign (to existing groups of contacts) | Link |
POST | /sms/campaign/estimate | Estimate cost of SMS campaign | Link |
DELETE | /sms/scheduled/{msgId} | Delete scheduled SMS | Link |
DELETE | /sms/scheduled/campaign/{campaignId} | Delete scheduled SMS campaign | Link |
POST | https://{{your-endpoint}}/path-for-dlr-update | [Webhook] Receive delivery report for a sent SMS | Link |
POST | https://{{your-endpoint}}/path-for-receive-sms | [Webhook] Receive data for inbound SMS | Link |
Method | Resource | Description | Reference |
---|---|---|---|
POST | /viber | Send new Viber (single or bulk) | Link |
POST | /viber/estimate | Estimate cost of Viber (single or bulk) | Link |
POST | /viber/campaign | Send Viber campaign (to existing groups of contacts) | Link |
POST | /viber/campaign/estimate | Estimate cost of Viber campaign | Link |
DELETE | /viber/scheduled/{msgId} | Delete scheduled Viber | Link |
DELETE | /viber/scheduled/campaign/{campaignId} | Delete scheduled Viber campaign | Link |
Method | Resource | Description | Reference |
---|---|---|---|
POST | Send new Whatsapp (single or bulk) | Link | |
POST | /whatsapp/estimate | Estimate cost of Whatsapp (single or bulk) | Link |
POST | /whatsapp/campaign | Send Whatsapp campaign (to existing groups of contacts) | Link |
POST | /whatsapp/campaign/estimate | Estimate cost of Whatsapp campaign | Link |
DELETE | /whatsapp/scheduled/{msgId} | Delete scheduled Whatsapp | Link |
DELETE | /whatsapp/scheduled/campaign/{campaignId} | Delete scheduled Whatsapp campaign | Link |
Method | Resource | Description | Reference |
---|---|---|---|
POST | /multichannel | Send new Multichannel (single or bulk) | Link |
POST | /multichannel/estimate | Estimate cost of Multichannel (single or bulk) | Link |
POST | /multichannel/campaign | Send Multichannel campaign (to existing groups of contacts) | Link |
POST | /multichannel/campaign/estimate | Estimate cost of Multichannel campaign | Link |
DELETE | /multichannel/scheduled/{msgId} | Delete scheduled Multichannel | Link |
DELETE | /multichannel/scheduled/campaign/{campaignId} | Delete scheduled Multichannel campaign | Link |
Method | Resource | Description | Reference |
---|---|---|---|
GET | /conversations | Get list of conversations | Link |
GET | /conversations/{conversationId} | Get conversations details | Link |
GET | /conversations/{conversationId}/read | Mark conversation as read | Link |
POST | /conversations/{conversationId}/sms | Reply to conversation via SMS | Link |
POST | /conversations/{conversationId}/viber | Reply to conversation via Viber | Link |
POST | /conversations/{conversationId}/whatsapp | Reply to conversation via Whatsapp | Link |
Method | Resource | Description | Reference |
---|---|---|---|
GET | /groups | Get list of groups | Link |
POST | /groups | Create new group | Link |
GET | /groups/{groupId} | Get all contacts in a group | Link |
POST | /groups/{groupId} | Add contacts to group | Link |
DELETE | /groups/{groupId} | Delete group | Link |
GET | /groups/{groupId}/empty | Empty a group | Link |
GET | /groups/{groupId}/xlsx | Export contacts from group as XLSX | Link |
GET | /groups/{groupId}/csv | Export contacts from group as CSV | Link |
DELETE | /groups/{groupId}/{phoneNumberId} | Delete contact from group | Link |
PATCH | /groups/{groupId}/{phoneNumberId} | Update contact in group | Link |
Method | Resource | Description | Reference |
---|---|---|---|
GET | /reports | Get advanced reports | Link |
GET | /reports/xlsx | Export advanced report to XLSX | Link |
GET | /reports/csv | Export advanced report to CSV | Link |
GET | /reports/campaigns | Get list of all sent campaigns | Link |
GET | /reports/campaigns/{campaignId} | Get report for a campaign | Link |
GET | /reports/campaigns/{campaignId}/xlsx | Export campaign report to XLSX | Link |
GET | /reports/campaigns/{campaignId}/csv | Export campaign report to CSV | Link |
GET | /reports/single/{msgId} | Get report for single SMS/Viber/Whatsapp/Multichannel | Link |
GET | /reports/summary/{dimension} | Get summary report for a dimension (channel, source, etc ) | Link |
Method | Resource | Description | Reference |
---|---|---|---|
POST | /numbers/validate | Validate phone numbers in bulk | Link |
GET | /numbers/validate/{phoneNumer} | Validate single phone number | Link |
POST | /numbers/lookup | Lookup phone numbers in bulk | Link |
GET | /numbers/lookup/{phoneNumer} | Lookup single phone number | Link |
POST | https://{{your-endpoint}}/path-for-receive-number-lookup | [Webhook] Receive details for Bulk Lookup of Phone Numbers | Link |
Method | Resource | Description | Reference |
---|---|---|---|
GET | /shortlinks | Get the list of shortlinks | Link |
POST | /shortlinks | Create new shortlink | Link |
GET | /shortlinks/{shortId} | Get details for a shortlink | Link |
GET | /shortlinks/{shortId}/xlsx | Export shortlink details in XLSX | Link |
GET | /shortlinks/{shortId}/csv | Export shortlink details in CSV | Link |
DELETE | /shortlinks/{shortId} | Delete a shortlink | Link |
PATCH | /shortlinks/{shortId} | Edit/update a shortlink | Link |
POST | https://{{your-endpoint}}/path-for-shortlink-hit | [Webhook] Receive details of visitor of shortlink | Link |
Method | Resource | Description | Reference |
---|---|---|---|
GET | /attachments | Get the list of attachments | Link |
GET | /attachments/{attachmentId} | Get details for a attachment | Link |
GET | /attachments/{attachmentId}/xlsx | Export attachment details in XLSX | Link |
GET | /attachments/{attachmentId}/csv | Export attachment details in CSV | Link |
DELETE | /attachments/{attachmentId} | Delete a attachment | Link |
POST | https://{{your-endpoint}}/path-for-attachment-hit | [Webhook] Receive details of visitor of attachment | Link |
Method | Resource | Description | Reference |
---|---|---|---|
GET | /optouts | Get the list of contacts that opted out | Link |
GET | /optouts/xlsx | Export optouts contacts to XLSX | Link |
GET | /optouts/csv | Export optouts contacts to CSV | Link |
POST | /optouts | Add phone numbers to opt-out list | Link |
DELETE | /optouts/{phoneNumberId} | Delete phone number from opt-out list | Link |
POST | https://{{your-endpoint}}/path-for-new-optout | [Webhook] Receive details of a new optout | Link |
Method | Resource | Description | Reference |
---|---|---|---|
GET | /account/balance | Get account balance | Link |
GET | /account/pricing/{channel} | Get full pricing of channel (SMS,Viber, Whatsapp) | Link |
GET | /account/pricing/{channel}/{countryIso} | Get full pricing of channel for specific country | Link |
GET | /account/channels/status | Get status (active/inactive) of channels (SMS, Viber, Whatsapp) | Link |
Get access token
Generate an access token.
The POST request must use the HTTP Basic authentication scheme, by encoding client_id:client_secret
string to Base64 string and use it in the header:
Authorization: Basic czZCaGRSa3F0Mzo3RmpmcDBaQnIxS3REUmJuZlZkbUl3
The request body should have the mandatory grant_type
parameter with value client_credentials
The content type must be application/x-www-form-urlencoded
.
Errors for POST /oauth/token
HTTP code | Error code | Type | Description |
---|---|---|---|
400 | 1600 | invalid_request | The request is missing a required parameter (grant_type) |
400 | 1600 | invalid_scope | The requested scope is invalid, unknown, or malformed |
400 | 1600 | unsupported_grant_type | The grant type is not supported (only client_credentials) |
401 | 1600 | invalid_client | Invalid client |
Authorizations:
Request Body schema: application/x-www-form-urlencoded
grant_type required | string Value: "client_credentials" Grant type (or flow) represents the methods through which the application will get Access Tokens. Must have value |
scope | string A list of space-delimited, case-sensitive strings. If left empty or ommited, the issued access token will be granted with all scopes (full privileges) |
Responses
Request samples
- Payload
- Shell + Curl
- Python + Requests
- Java + Okhttp
- Node + Native
- Javascript + Xhr
- Php + Curl
- Go + Native
- Ruby + Native
- Csharp + Restsharp
grant_type=client_credentials
Response samples
- 200
- 400
- 401
- 403
- 405
- 429
- 500
{- "access_token": "a60e4455ec782fd54f37b8b9684dfa7a02c50cc0",
- "expires_in": 86400,
- "token_type": "Bearer",
- "scope": "sms viber whatsapp multichannel conversations reports groups originators templates shortlinks attachments optouts account applications numbers"
}
Receive delivery report for a sent SMS Webhook
POST
https://{{your-endpoint}}/path-for-dlr-update
The SMS.CX API will make a POST
request to your webhook endpoint, which must return HTTP response 200
. If the response is not HTTP 200, SMS.CX API will retry the callback request for the next 24 hours using an exponential backoff algorithm.
Authorizations:
Request Body schema: application/json
event required | string Value: "dlr_update" Event for which the callback request is made |
required | Array of objects (DataDlrUpdate) Event data, grouped in multiple objects (up to 200 in a request) |
Responses
Request samples
- Payload
{- "event": "dlr_update",
- "data": [
- {
- "campaignId": "961dbfa9-8e12-4f96-b59d-6c0c79c53edc",
- "msgId": "4dd5e899-6ced-4fd5-bbb6-34e51507e3df",
- "trackData": "e2ea0b0a-8eee-469c-8e24-e9c4cb6d328e",
- "statusCode": 1,
- "status": "DELIVERED",
- "datetime": "2022-03-03 15:30:24"
}, - {
- "campaignId": "0ef52a99-10b1-4813-af84-9b285edfbc30",
- "msgId": "a710a44a-e784-4199-b73c-a2c8bfd41b59",
- "trackData": "c15f2ece-ce6e-46f9-b265-60a0326d1e9d",
- "statusCode": 1,
- "status": "DELIVERED",
- "datetime": "2022-03-03 15:30:04"
}, - {
- "campaignId": "961dbfa9-8e12-4f96-b59d-6c0c79c53edc",
- "msgId": "4dd5e899-6ced-4fd5-bbb6-34e51507e3df",
- "trackData": "57d7c966-bd65-4b8f-95e3-6a705fc1b060",
- "statusCode": 1,
- "status": "DELIVERED",
- "datetime": "2022-03-03 15:30:24"
}
]
}
Receive data for inbound SMS Webhook
POST
https://{{your-endpoint}}/path-for-receive-sms
The SMS.CX API will make a POST
request to your webhook endpoint, which must return HTTP response 200
. If the response is not HTTP 200, SMS.CX API will retry the callback request for the next 24 hours using an exponential backoff algorithm.
Authorizations:
Request Body schema: application/json
event required | string Value: "receive_sms" Event for which the callback request is made |
required | Array of objects (DataReceiveSms) Event data, grouped in multiple objects (up to 200 in a request) |
Responses
Request samples
- Payload
{- "event": "receive_sms",
- "data": [
- {
- "msgId": "a079b9d0-2e2d-4de5-a895-dc476c98b4fb",
- "from": "+4915123130793",
- "countryIso": "DE",
- "to": "+4915123960390",
- "text": "I reply confirming the appointment with Dr. Mark",
- "cost": 0,
- "receivedAt": "2022-02-12 08:16:05"
}, - {
- "msgId": "0ef52a99-10b1-4813-af84-9b285edfbc30",
- "from": "+33612103411",
- "countryIso": "FR",
- "to": "+33612485587",
- "text": "Je veux annuler la commande",
- "cost": 0,
- "receivedAt": "2022-02-12 08:16:05"
}, - {
- "msgId": "961dbfa9-8e12-4f96-b59d-6c0c79c53edc",
- "from": "+393123495814",
- "countryIso": "IT",
- "to": "+393123350655",
- "text": "Confermo l'ordine effettuato sul tuo sito",
- "cost": 0,
- "receivedAt": "2022-02-12 08:16:05"
}
]
}
Send SMS
Sends SMS to a single phone number or to a list of phone numbers.
This endpoint was designed to handle big data objects (up to 25.000 SMS in one request).
If you have loops or iterations we recommend building the send object in your application, and make a single request to this endpoint. The time of making the requests will decrease - by doing a single request with multiple send objects vs making requests in a loop - and you won't have to worry about making concurrent API calls.
Note: This endpoint accepts idempotent requests by providing an additional
idempotencyId
parameter in body with a unique value generated by the client of type UUID v1-v5. To confirm that the server understood the request, the response will contain the headerX-Idempotency-Id
with your unique value. By using idempotency you can retry requests in case of network error or server not responding in time, without accidentally performing the same operation twice and have a guarantee of not being billed twice.
Errors for POST /sms
HTTP code | Error code | Type | Description |
---|---|---|---|
400 | 1103 | invalid_param | The phone numbers array is too big (max. allowed: 25000 numbers) |
400 | 1104 | invalid_param | The parameter to is empty or not set |
400 | 1105 | invalid_param | The parameter from is empty or not set |
400 | 1106 | invalid_param | The parameter from is not valid (min 3, max 15 characters) |
400 | 1107 | invalid_param | The parameter text is empty or not set |
400 | 1108 | invalid_param | The parameter scheduledDate is not a valid date |
400 | 1109 | invalid_param | The parameter dlrCallbackUrl is not a valid URL |
400 | 1111 | invalid_param | Idempotency Id provided is not a valid UUID (v1-v5) |
400 | 1112 | invalid_param | The shortlink/attachment ID provided for tracking is invalid or not found |
400 | 1116 | invalid_param | The scheduled date is in the past |
400 | 1207 | invalid_param | The phone number provided is not valid |
400 | 1210 | invalid_param | The phone numbers provided are invalid |
403 | 1119 | no_coverage | No coverage or restricted destination |
400 | 1113 | insufficient_credit | Insufficient credit |
400 | 1114 | insufficient_credit | Credit limit reached. To increase the credit limit, please contact your account manager |
400 | 1110 | invalid_param | Invalid alphabet. Must be one of: NONE , NON_GSM , RUSSIAN_CYRILLIC , BULGARIAN_CYRILLIC , UKRAINIAN_CYRILLIC , MACEDONIAN_CYRILLIC , BELARUSIAN_CYRILLIC , SERBIAN_CYRILLIC , POLISH , ROMANIAN , TURKISH , GREEK |
400 | 1135 | invalid_param | The parameter 'transliteration' should be an object |
400 | 1503 | invalid_param | The parameter removeEmojis is not boolean (true or false) |
400 | 1136 | invalid_param | Invalid number of characters for the placeholder {{numbers}} |
400 | 1136 | invalid_param | Invalid number of characters for the placeholder {{letters}} |
400 | 1136 | invalid_param | Invalid number of characters for the placeholder {{alphanumeric}} |
400 | 1137 | invalid_param | Number of characters for placeholders can be between 1 and 20 |
Authorizations:
Request Body schema: application/json
to required | Array of strings A string with single phone number or an array of phone numbers in international E.164 format or national format. If national format is provided, for better validation you must use the parameter |
from required | string [ 3 .. 15 ] characters The originator (sender name) of the text message (min 3, max 15 characters). If the originator used in this value is not approved, it will be overwritten by a default system originator (eg. InfoText). Read more about sender names |
text required | string A standard GSM message is limited to 160 characters. If a text message contains even one (or more) Unicode characters (for example ç, ö, ü) the character limit then becomes 70 characters per message part. Long text messages are concatenated into a multipart SMS. A text message can have up to 1530 characters (10 message parts).
|
countryIso | string 2 characters Country ISO (two-letter) of the destination phone numbers (if provided in national format). Please note that if an international E.164 phone number format is provided in the |
allowInvalid | boolean Default: false By default an error will be thrown if any invalid numbers are detected in the |
scheduledDate | string <date-time> If you want to schedule the SMS at a later date. The date provided must be in format YYYY-MM-DD HH:MM:SS (Eg. 2021-06-23 14:26:10). By default, the date and time in this parameter is treated as |
isUtc | boolean Default: true If set to |
dlrCallbackUrl | string <url> A valid URL to receive the delivery report update for the sent SMS. If this parameter is set, it will overwrite the setting from Admin Dashboard > HTTP API > Oauth2 > Application settings |
trackData | string <uuid> 36 characters ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]... Allows to track messages a client provided ID. The |
shortResponse | boolean Default: false If set to |
noTextDetails | boolean Default: false The response will not have the parameters |
showTimezone | boolean Default: false Shows the parameter |
idempotencyId | string <uuid> 36 characters ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]... A unique idempotency id generated by the client. For more information, refer to Idempotent requests. The API will return an error if the value provided is not a valid UUID (v1-v5) |
object (Transliteration) Convert special characters from Unicode to GSM 03.38 charset, or replace them if no GSM equivalent. Eg. If this parameter is set, it will overwrite the settings from Admin Dashboard > HTTP API > Oauth2 > Application settings |
Responses
Request samples
- Payload
- Shell + Curl
- Python + Requests
- Java + Okhttp
- Node + Native
- Javascript + Xhr
- Php + Curl
- Go + Native
- Ruby + Native
- Csharp + Restsharp
{- "to": [
- "+31612469333"
], - "from": "InfoText",
- "text": "Your confirmation code is 5443"
}
Response samples
- 200
- 400
- 401
- 403
- 405
- 429
- 500
{- "info": {
- "campaignId": "287c1e8d-4842-4106-8fe9-4debf8855743",
- "totalPhoneNumbers": 1,
- "totalValid": 1,
- "totalInvalid": 0,
- "totalCost": 0.041,
- "totalParts": 1,
- "phoneNumbersByCountry": {
- "NL": 1
}, - "scheduled": false
}, - "data": [
- {
- "msgId": "287c1e8d-4842-4106-8fe9-4debf8855743",
- "status": "ACCEPTED",
- "statusCode": 0,
- "inQuietHours": false,
- "createdAt": "2021-07-10 12:12:10",
- "cost": 0.041,
- "to": "+31612469333",
- "countryIso": "NL",
- "from": "InfoText",
- "text": "Your confirmation code is 5443",
- "parts": 1,
- "textAnalysis": {
- "length": 30,
- "unicode": false,
- "parts": 1
}
}
]
}
Estimate new SMS
Estimate the cost of sending a SMS message.
This endpoint is identical to /sms
endpoint, but it will only simulate the SMS sending (no billing).
The request body and the response are the same as for /sms
endpoint.
curl --location --request POST 'https://api.sms.cx/sms/estimate' \
--header 'Authorization: Bearer d34a5e82f8d5e45ad1968deb5d3a3674ea6b46f6' \
--header 'Content-Type: application/json' \
--data-raw '{
"to": [
"+31612469822",
"+31612469333"
],
"from": "InfoText",
"text": "Second text message"
}'
Errors for POST /sms/estimate
HTTP code | Error code | Type | Description |
---|---|---|---|
400 | 1104 | invalid_param | The parameter to is empty or not set |
400 | 1105 | invalid_param | The parameter from is empty or not set |
400 | 1106 | invalid_param | The parameter from is not valid (min 3, max 15 characters) |
400 | 1107 | invalid_param | The parameter text is empty or not set |
400 | 1108 | invalid_param | The parameter scheduledDate is not a valid date |
400 | 1109 | invalid_param | The parameter dlrCallbackUrl is not a valid URL |
400 | 1112 | invalid_param | The shortlink/attachment ID provided for tracking is invalid or not found |
400 | 1116 | invalid_param | The scheduled date is in the past |
400 | 1103 | invalid_param | The phone numbers array is too big (max. allowed: 25000 numbers) |
400 | 1207 | invalid_param | The phone number provided is not valid |
400 | 1210 | invalid_param | The phone numbers provided are invalid |
403 | 1119 | no_coverage | No coverage or restricted destination |
400 | 1113 | insufficient_credit | Insufficient credit |
400 | 1114 | insufficient_credit | Credit limit reached. To increase the credit limit, please contact your account manager |
400 | 1110 | invalid_param | Invalid alphabet. Must be one of: NONE , NON_GSM , RUSSIAN_CYRILLIC , BULGARIAN_CYRILLIC , UKRAINIAN_CYRILLIC , MACEDONIAN_CYRILLIC , BELARUSIAN_CYRILLIC , SERBIAN_CYRILLIC , POLISH , ROMANIAN , TURKISH , GREEK |
400 | 1135 | invalid_param | The parameter 'transliteration' should be an object |
400 | 1503 | invalid_param | The parameter removeEmojis is not boolean (true or false) |
400 | 1136 | invalid_param | Invalid number of characters for the placeholder {{numbers}} |
400 | 1136 | invalid_param | Invalid number of characters for the placeholder {{letters}} |
400 | 1136 | invalid_param | Invalid number of characters for the placeholder {{alphanumeric}} |
400 | 1137 | invalid_param | Number of characters for placeholders can be between 1 and 20 |
Authorizations:
Request Body schema: application/json
to required | Array of strings A string with single phone number or an array of phone numbers in international E.164 format or national format. If national format is provided, for better validation you must use the parameter |
from required | string [ 3 .. 15 ] characters The originator (sender name) of the text message (min 3, max 15 characters). If the originator used in this value is not approved, it will be overwritten by a default system originator (eg. InfoText). Read more about sender names |
text required | string A standard GSM message is limited to 160 characters. If a text message contains even one (or more) Unicode characters (for example ç, ö, ü) the character limit then becomes 70 characters per message part. Long text messages are concatenated into a multipart SMS. A text message can have up to 1530 characters (10 message parts).
|
countryIso | string 2 characters Country ISO (two-letter) of the destination phone numbers (if provided in national format). Please note that if an international E.164 phone number format is provided in the |
allowInvalid | boolean Default: false By default an error will be thrown if any invalid numbers are detected in the |
scheduledDate | string <date-time> If you want to schedule the SMS at a later date. The date provided must be in format YYYY-MM-DD HH:MM:SS (Eg. 2021-06-23 14:26:10). By default, the date and time in this parameter is treated as |
isUtc | boolean Default: true If set to |
dlrCallbackUrl | string <url> A valid URL to receive the delivery report update for the sent SMS. If this parameter is set, it will overwrite the setting from Admin Dashboard > HTTP API > Oauth2 > Application settings |
trackData | string <uuid> 36 characters ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]... Allows to track messages a client provided ID. The |
shortResponse | boolean Default: false If set to |
noTextDetails | boolean Default: false The response will not have the parameters |
showTimezone | boolean Default: false Shows the parameter |
object (Transliteration) Convert special characters from Unicode to GSM 03.38 charset, or replace them if no GSM equivalent. Eg. If this parameter is set, it will overwrite the settings from Admin Dashboard > HTTP API > Oauth2 > Application settings |
Responses
Request samples
- Payload
- Shell + Curl
- Python + Requests
- Java + Okhttp
- Node + Native
- Javascript + Xhr
- Php + Curl
- Go + Native
- Ruby + Native
- Csharp + Restsharp
{- "to": [
- "+31612469822",
- "+31612469333"
], - "from": "InfoText",
- "text": "Second text message",
- "transliteration": {
- "alphabet": "NON_GSM",
- "removeEmojis": true
}
}
Response samples
- 200
- 400
- 401
- 403
- 405
- 429
- 500
{- "info": {
- "campaignId": "88202091-0ee9-412b-840c-775f38e7cdd8",
- "totalPhoneNumbers": 2,
- "totalValid": 2,
- "totalInvalid": 0,
- "totalCost": 0.082,
- "totalParts": 2,
- "phoneNumbersByCountry": {
- "NL": 2
}, - "transliterationAnalysis": {
- "totalOriginalCost": 0.082,
- "totalOriginalParts": 2,
- "totalReplacedCost": 0.082,
- "totalReplacedParts": 2,
- "totalCostSaved": 0,
- "totalPartsSaved": 0,
- "text": {
- "original": {
- "text": "Second text message",
- "length": 19,
- "parts": 1,
- "encoding": "GSM-7"
}, - "replaced": {
- "text": "Second text message",
- "length": 19,
- "parts": 1,
- "encoding": "GSM-7",
- "characters": [ ]
}
}
}, - "invalid": [ ],
- "scheduled": false
}, - "data": [
- {
- "msgId": "30f6a795-d826-40aa-ace5-c2d9295548af",
- "status": "ACCEPTED",
- "statusCode": 0,
- "inQuietHours": false,
- "createdAt": "2021-07-10 12:15:46",
- "cost": 0.041,
- "to": "+31612469822",
- "countryIso": "NL",
- "from": "InfoText",
- "text": "Second text message",
- "parts": 1,
- "textAnalysis": {
- "length": 19,
- "unicode": false,
- "parts": 1
}
}, - {
- "msgId": "ac9b5668-595e-4780-9306-ab2f1e5e3a3f",
- "status": "ACCEPTED",
- "statusCode": 0,
- "inQuietHours": false,
- "createdAt": "2021-07-10 12:15:46",
- "cost": 0.041,
- "to": "+31612469333",
- "countryIso": "NL",
- "from": "InfoText",
- "text": "Second text message",
- "parts": 1,
- "textAnalysis": {
- "length": 19,
- "unicode": false,
- "parts": 1
}
}
]
}
Send SMS campaign
Sends SMS to existing group(s) of contacts.
Note: This endpoint accepts idempotent requests by providing an additional
idempotencyId
parameter in body with a unique value generated by the client of type UUID v1-v5. To confirm that the server understood the request, the response will contain the headerX-Idempotency-Id
with your unique value. By using idempotency you can retry requests in case of network error or server not responding in time, without accidentally performing the same operation twice and have a guarantee of not being billed twice.
We recommend to always use Idempotency ID when sending SMS campaigns
Errors for POST /sms/campaign
HTTP code | Error code | Type | Description |
---|---|---|---|
400 | 1101 | invalid_param | The parameter groups is empty or not set |
400 | 1140 | invalid_param | Group ID is not a valid group |
400 | 1102 | invalid_param | Group is empty |
400 | 1103 | invalid_param | The phone numbers array is too big (max. allowed: 25000 numbers) |
400 | 1105 | invalid_param | The parameter from is empty or not set |
400 | 1106 | invalid_param | The parameter from is not valid (min 3, max 15 characters) |
400 | 1107 | invalid_param | The parameter text is empty or not set |
400 | 1108 | invalid_param | The parameter scheduledDate is not a valid date |
400 | 1109 | invalid_param | The parameter dlrCallbackUrl is not a valid URL |
400 | 1111 | invalid_param | Idempotency Id provided is not a valid UUID (v1-v5) |
400 | 1112 | invalid_param | The shortlink/attachment ID provided for tracking is invalid or not found |
400 | 1116 | invalid_param | The scheduled date is in the past |
403 | 1119 | no_coverage | No coverage or restricted destination |
400 | 1113 | insufficient_credit | Insufficient credit |
400 | 1114 | insufficient_credit | Credit limit reached. To increase the credit limit, please contact your account manager |
400 | 1110 | invalid_param | Invalid alphabet. Must be one of: NONE , NON_GSM , RUSSIAN_CYRILLIC , BULGARIAN_CYRILLIC , UKRAINIAN_CYRILLIC , MACEDONIAN_CYRILLIC , BELARUSIAN_CYRILLIC , SERBIAN_CYRILLIC , POLISH , ROMANIAN , TURKISH , GREEK |
400 | 1135 | invalid_param | The parameter 'transliteration' should be an object |
400 | 1503 | invalid_param | The parameter removeEmojis is not boolean (true or false) |
400 | 1136 | invalid_param | Invalid number of characters for the placeholder {{numbers}} |
400 | 1136 | invalid_param | Invalid number of characters for the placeholder {{letters}} |
400 | 1136 | invalid_param | Invalid number of characters for the placeholder {{alphanumeric}} |
400 | 1137 | invalid_param | Number of characters for placeholders can be between 1 and 20 |
Authorizations:
Request Body schema: application/json
groups required | Array of integers <int32> An array of identifiers for groups of contacts |
from required | string [ 3 .. 15 ] characters The originator (sender name) of the text message (min 3, max 15 characters). If the originator used in this value is not approved, it will be overwritten by a default system originator (eg. InfoText). Read more about sender names |
text required | string A standard GSM message is limited to 160 characters. If a text message contains even one (or more) Unicode characters (for example ç, ö, ü) the character limit then becomes 70 characters per message part. Long text messages are concatenated into a multipart SMS. A text message can have up to 1530 characters (10 message parts).
|
scheduledDate | string <date-time> If you want to schedule the SMS at a later date. The date provided must be in format YYYY-MM-DD HH:MM:SS (Eg. 2021-06-23 14:26:10). By default, the date and time in this parameter is treated as |
isUtc | boolean Default: true If set to |
dlrCallbackUrl | string <url> A valid URL to receive the delivery report update for the sent SMS. If this parameter is set, it will overwrite the setting from Admin Dashboard > HTTP API > Oauth2 > Application settings |
shortResponse | boolean Default: false If set to |
noTextDetails | boolean Default: false The response will not have the parameters |
showTimezone | boolean Default: false Shows the parameter |
idempotencyId | string <uuid> 36 characters ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]... A unique idempotency id generated by the client. For more information, refer to Idempotent requests. The API will return an error if the value provided is not a valid UUID (v1-v5) |
object (Transliteration) Convert special characters from Unicode to GSM 03.38 charset, or replace them if no GSM equivalent. Eg. If this parameter is set, it will overwrite the settings from Admin Dashboard > HTTP API > Oauth2 > Application settings |
Responses
Request samples
- Payload
- Shell + Curl
- Python + Requests
- Java + Okhttp
- Node + Native
- Javascript + Xhr
- Php + Curl
- Go + Native
- Ruby + Native
- Csharp + Restsharp
{- "groups": [
- 17
], - "from": "InfoText",
- "text": "Hi {{firstName}} {{lastName}}. Check out the brochure {{attachment:RytK}} Unsubscribe here: {{optoutLink}}",
- "idempotencyId": "00d45bbc-8642-4012-b1e9-997b4a152138"
}
Response samples
- 200
- 400
- 401
- 403
- 405
- 429
- 500
{- "info": {
- "campaignId": "5b66eea2-930a-48ed-aed9-933b88d40c41",
- "totalPhoneNumbers": 17,
- "totalValid": 17,
- "totalInvalid": 0,
- "duplicatesRemoved": 0,
- "totalCost": 0.738,
- "totalParts": 18,
- "phoneNumbersByCountry": {
- "HU": 1,
- "CH": 1,
- "ES": 2,
- "FR": 2,
- "BG": 1,
- "NL": 1,
- "PT": 2,
- "GB": 1,
- "NO": 2,
- "GR": 2,
- "FI": 1,
- "CZ": 2
}, - "groups": [
- {
- "id": 17,
- "name": "My group 3",
- "phoneNumbers": 17
}
], - "invalid": [ ],
- "scheduled": false
}, - "data": [
- {
- "msgId": "bed736dc-3825-4447-8424-55510711cc36",
- "status": "ACCEPTED",
- "statusCode": 0,
- "inQuietHours": false,
- "createdAt": "2021-07-24 19:29:10",
- "cost": 0.041,
- "to": "+36201910674",
- "countryIso": "HU",
- "from": "InfoText",
- "text": "Hi Boris Anev. Check out the brochure https://en.ax/RytK/RPlF Unsubscribe here: https://en.ax/03y4",
- "parts": 1,
- "textAnalysis": {
- "length": 100,
- "unicode": false,
- "parts": 1
}
}, - {
- "msgId": "63b7dd61-689c-4f98-a34c-4fa1c61bacea",
- "status": "ACCEPTED",
- "statusCode": 0,
- "inQuietHours": false,
- "createdAt": "2021-07-24 19:29:10",
- "cost": 0.041,
- "to": "+41781121629",
- "countryIso": "CH",
- "from": "InfoText",
- "text": "Hi Annett Goldschmidt. Check out the brochure https://en.ax/RytK/YN0G Unsubscribe here: https://en.ax/03y4",
- "parts": 1,
- "textAnalysis": {
- "length": 108,
- "unicode": false,
- "parts": 1
}
}, - {
- "msgId": "739c9b37-c275-4aeb-8a48-9b0d41280904",
- "status": "ACCEPTED",
- "statusCode": 0,
- "inQuietHours": false,
- "createdAt": "2021-07-24 19:29:10",
- "cost": 0.041,
- "to": "+34612406674",
- "countryIso": "ES",
- "from": "InfoText",
- "text": "Hi Guinerve Tovar. Check out the brochure https://en.ax/RytK/IMzm Unsubscribe here: https://en.ax/03y4",
- "parts": 1,
- "textAnalysis": {
- "length": 104,
- "unicode": false,
- "parts": 1
}
}, - {
- "msgId": "9cd95cb8-0412-4e77-bd02-ce58d85d920e",
- "status": "ACCEPTED",
- "statusCode": 0,
- "inQuietHours": false,
- "createdAt": "2021-07-24 19:29:10",
- "cost": 0.041,
- "to": "+33612935399",
- "countryIso": "FR",
- "from": "InfoText",
- "text": "Hi Anton Maheu. Check out the brochure https://en.ax/RytK/m4yu Unsubscribe here: https://en.ax/03y4",
- "parts": 1,
- "textAnalysis": {
- "length": 101,
- "unicode": false,
- "parts": 1
}
}, - {
- "msgId": "e9e18a62-aaa3-4b19-9509-6f6eb5b5ce8c",
- "status": "ACCEPTED",
- "statusCode": 0,
- "inQuietHours": false,
- "createdAt": "2021-07-24 19:29:10",
- "cost": 0.041,
- "to": "+34612160806",
- "countryIso": "ES",
- "from": "InfoText",
- "text": "Hi Almanza Quintero. Check out the brochure https://en.ax/RytK/j94K Unsubscribe here: https://en.ax/03y4",
- "parts": 1,
- "textAnalysis": {
- "length": 106,
- "unicode": false,
- "parts": 1
}
}, - {
- "msgId": "a3b93bfe-0973-4c0b-99d9-196875934740",
- "status": "ACCEPTED",
- "statusCode": 0,
- "inQuietHours": false,
- "createdAt": "2021-07-24 19:29:10",
- "cost": 0.041,
- "to": "+33612970283",
- "countryIso": "FR",
- "from": "InfoText",
- "text": "Hi René Royer. Check out the brochure https://en.ax/RytK/hfND Unsubscribe here: https://en.ax/03y4",
- "parts": 1,
- "textAnalysis": {
- "length": 100,
- "unicode": false,
- "parts": 1
}
}, - {
- "msgId": "c2ac3c46-4dd7-4d33-913f-67e1e0c9f52b",
- "status": "ACCEPTED",
- "statusCode": 0,
- "inQuietHours": false,
- "createdAt": "2021-07-24 19:29:10",
- "cost": 0.041,
- "to": "+35948964458",
- "countryIso": "BG",
- "from": "InfoText",
- "text": "Hi Fejes Gyuszi. Check out the brochure https://en.ax/RytK/OXhr Unsubscribe here: https://en.ax/03y4",
- "parts": 1,
- "textAnalysis": {
- "length": 102,
- "unicode": false,
- "parts": 1
}
}, - {
- "msgId": "56cc39c2-ed4b-4197-8312-e33da629a1a0",
- "status": "ACCEPTED",
- "statusCode": 0,
- "inQuietHours": false,
- "createdAt": "2021-07-24 19:29:10",
- "cost": 0.041,
- "to": "+31612576088",
- "countryIso": "NL",
- "from": "InfoText",
- "text": "Hi Joppe Knijn. Check out the brochure https://en.ax/RytK/BQ7n Unsubscribe here: https://en.ax/03y4",
- "parts": 1,
- "textAnalysis": {
- "length": 101,
- "unicode": false,
- "parts": 1
}
}, - {
- "msgId": "826b30f3-10ad-48d1-a66c-c98b59c9eacc",
- "status": "ACCEPTED",
- "statusCode": 0,
- "inQuietHours": false,
- "createdAt": "2021-07-24 19:29:10",
- "cost": 0.041,
- "to": "+351912938895",
- "countryIso": "PT",
- "from": "InfoText",
- "text": "Hi Rodrigues Carvalho. Check out the brochure https://en.ax/RytK/EqBi Unsubscribe here: https://en.ax/03y4",
- "parts": 1,
- "textAnalysis": {
- "length": 108,
- "unicode": false,
- "parts": 1
}
}, - {
- "msgId": "22cbdced-98af-46d7-b65d-bb5834947573",
- "status": "ACCEPTED",
- "statusCode": 0,
- "inQuietHours": false,
- "createdAt": "2021-07-24 19:29:10",
- "cost": 0.041,
- "to": "+447400547989",
- "countryIso": "GB",
- "from": "InfoText",
- "text": "Hi Hayden Francis. Check out the brochure https://en.ax/RytK/bDAh Unsubscribe here: https://en.ax/03y4",
- "parts": 1,
- "textAnalysis": {
- "length": 104,
- "unicode": false,
- "parts": 1
}
}, - {
- "msgId": "585c701f-251d-44c7-8f6b-34d2aff32545",
- "status": "ACCEPTED",
- "statusCode": 0,
- "inQuietHours": false,
- "createdAt": "2021-07-24 19:29:10",
- "cost": 0.041,
- "to": "+4740278715",
- "countryIso": "NO",
- "from": "InfoText",
- "text": "Hi Even Sørdal. Check out the brochure https://en.ax/RytK/47sk Unsubscribe here: https://en.ax/03y4",
- "parts": 1,
- "textAnalysis": {
- "length": 101,
- "unicode": false,
- "parts": 1
}
}, - {
- "msgId": "15295d00-21a7-48aa-b639-fcf4eb90e45b",
- "status": "ACCEPTED",
- "statusCode": 0,
- "inQuietHours": false,
- "createdAt": "2021-07-24 19:29:10",
- "cost": 0.041,
- "to": "+306912534172",
- "countryIso": "GR",
- "from": "InfoText",
- "text": "Hi Ariana Galanis. Check out the brochure https://en.ax/RytK/JFIh Unsubscribe here: https://en.ax/03y4",
- "parts": 1,
- "textAnalysis": {
- "length": 104,
- "unicode": false,
- "parts": 1
}
}, - {
- "msgId": "c35fc5e4-ad3e-4227-9aff-f95d22e36f4f",
- "status": "ACCEPTED",
- "statusCode": 0,
- "inQuietHours": false,
- "createdAt": "2021-07-24 19:29:10",
- "cost": 0.041,
- "to": "+306912592181",
- "countryIso": "GR",
- "from": "InfoText",
- "text": "Hi Areta Lykaios. Check out the brochure https://en.ax/RytK/gnfA Unsubscribe here: https://en.ax/03y4",
- "parts": 1,
- "textAnalysis": {
- "length": 103,
- "unicode": false,
- "parts": 1
}
}, - {
- "msgId": "16422e55-c8a2-4fd8-b59d-8e9955fa4cf4",
- "status": "ACCEPTED",
- "statusCode": 0,
- "inQuietHours": false,
- "createdAt": "2021-07-24 19:29:10",
- "cost": 0.041,
- "to": "+351912432772",
- "countryIso": "PT",
- "from": "InfoText",
- "text": "Hi Castro Souza. Check out the brochure https://en.ax/RytK/F5RL Unsubscribe here: https://en.ax/03y4",
- "parts": 1,
- "textAnalysis": {
- "length": 102,
- "unicode": false,
- "parts": 1
}
}, - {
- "msgId": "47f30e98-2c58-44f0-9ae3-6a970ddfff90",
- "status": "ACCEPTED",
- "statusCode": 0,
- "inQuietHours": false,
- "createdAt": "2021-07-24 19:29:10",
- "cost": 0.041,
- "to": "+358412810699",
- "countryIso": "FI",
- "from": "InfoText",
- "text": "Hi Jouko Sirviö. Check out the brochure https://en.ax/RytK/UyDh Unsubscribe here: https://en.ax/03y4",
- "parts": 1,
- "textAnalysis": {
- "length": 102,
- "unicode": false,
- "parts": 1
}
}, - {
- "msgId": "6b774017-5bc0-4973-a78b-a0d5fbf25817",
- "status": "ACCEPTED",
- "statusCode": 0,
- "inQuietHours": false,
- "createdAt": "2021-07-24 19:29:10",
- "cost": 0.041,
- "to": "+4740885535",
- "countryIso": "NO",
- "from": "InfoText",
- "text": "Hi Sofia Nordengen. Check out the brochure https://en.ax/RytK/bGSg Unsubscribe here: https://en.ax/03y4",
- "parts": 1,
- "textAnalysis": {
- "length": 105,
- "unicode": false,
- "parts": 1
}
}, - {
- "msgId": "54452fe2-69e0-4db4-a75c-fb94525847d7",
- "status": "ACCEPTED",
- "statusCode": 0,
- "inQuietHours": false,
- "createdAt": "2021-07-24 19:29:10",
- "cost": 0.082,
- "to": "+420601351061",
- "countryIso": "CZ",
- "from": "InfoText",
- "text": "Hi Františka Valešová. Check out the brochure https://en.ax/RytK/6qyW Unsubscribe here: https://en.ax/03y4",
- "parts": 2,
- "textAnalysis": {
- "length": 108,
- "unicode": true,
- "parts": 2
}
}
]
}
Estimate SMS campaign
Estimate the cost of sending a SMS message to groups of phone numbers.
This endpoint is identical to /sms/campaign
endpoint, but it will only simulate the SMS sending (no billing).
The request body and the response are the same as for /sms/campaign
endpoint.
Errors for POST /sms/campaign/estimate
HTTP code | Error code | Type | Description |
---|---|---|---|
400 | 1101 | invalid_param | The parameter groups is empty or not set |
400 | 1140 | invalid_param | Group ID is not a valid group |
400 | 1102 | invalid_param | Group is empty |
400 | 1103 | invalid_param | The phone numbers array is too big (max. allowed: 25000 numbers) |
400 | 1105 | invalid_param | The parameter from is empty or not set |
400 | 1106 | invalid_param | The parameter from is not valid (min 3, max 15 characters) |
400 | 1107 | invalid_param | The parameter text is empty or not set |
400 | 1108 | invalid_param | The parameter scheduledDate is not a valid date |
400 | 1109 | invalid_param | The parameter dlrCallbackUrl is not a valid URL |
400 | 1112 | invalid_param | The shortlink/attachment ID provided for tracking is invalid or not found |
400 | 1116 | invalid_param | The scheduled date is in the past |
403 | 1119 | no_coverage | No coverage or restricted destination |
400 | 1113 | insufficient_credit | Insufficient credit |
400 | 1114 | insufficient_credit | Credit limit reached. To increase the credit limit, please contact your account manager |
400 | 1110 | invalid_param | Invalid alphabet. Must be one of: NONE , NON_GSM , RUSSIAN_CYRILLIC , BULGARIAN_CYRILLIC , UKRAINIAN_CYRILLIC , MACEDONIAN_CYRILLIC , BELARUSIAN_CYRILLIC , SERBIAN_CYRILLIC , POLISH , ROMANIAN , TURKISH , GREEK |
400 | 1135 | invalid_param | The parameter 'transliteration' should be an object |
400 | 1503 | invalid_param | The parameter removeEmojis is not boolean (true or false) |
400 | 1136 | invalid_param | Invalid number of characters for the placeholder {{numbers}} |
400 | 1136 | invalid_param | Invalid number of characters for the placeholder {{letters}} |
400 | 1136 | invalid_param | Invalid number of characters for the placeholder {{alphanumeric}} |
400 | 1137 | invalid_param | Number of characters for placeholders can be between 1 and 20 |
Authorizations:
Request Body schema: application/json
groups required | Array of integers <int32> An array of identifiers for groups of contacts |
from required | string [ 3 .. 15 ] characters The originator (sender name) of the text message (min 3, max 15 characters). If the originator used in this value is not approved, it will be overwritten by a default system originator (eg. InfoText). Read more about sender names |
text required | string A standard GSM message is limited to 160 characters. If a text message contains even one (or more) Unicode characters (for example ç, ö, ü) the character limit then becomes 70 characters per message part. Long text messages are concatenated into a multipart SMS. A text message can have up to 1530 characters (10 message parts).
|
scheduledDate | string <date-time> If you want to schedule the SMS at a later date. The date provided must be in format YYYY-MM-DD HH:MM:SS (Eg. 2021-06-23 14:26:10). By default, the date and time in this parameter is treated as |
isUtc | boolean Default: true If set to |
dlrCallbackUrl | string <url> A valid URL to receive the delivery report update for the sent SMS. If this parameter is set, it will overwrite the setting from Admin Dashboard > HTTP API > Oauth2 > Application settings |
shortResponse | boolean Default: false If set to |
noTextDetails | boolean Default: false The response will not have the parameters |
showTimezone | boolean Default: false Shows the parameter |
object (Transliteration) Convert special characters from Unicode to GSM 03.38 charset, or replace them if no GSM equivalent. Eg. If this parameter is set, it will overwrite the settings from Admin Dashboard > HTTP API > Oauth2 > Application settings |
Responses
Request samples
- Payload
- Shell + Curl
- Python + Requests
- Java + Okhttp
- Node + Native
- Javascript + Xhr
- Php + Curl
- Go + Native
- Ruby + Native
- Csharp + Restsharp
{- "groups": [
- 16
], - "from": "MyCompany",
- "text": "Test message {{firstName}} {{lastName}} {{field1}}"
}
Response samples
- 200
- 400
- 401
- 403
- 405
- 429
- 500
{- "info": {
- "campaignId": "ccdd5ab1-087f-4e1c-ad1f-41f9e562256c",
- "totalPhoneNumbers": 2097,
- "totalValid": 2097,
- "totalInvalid": 0,
- "duplicatesRemoved": 0,
- "totalCost": 85.977,
- "totalParts": 2097,
- "phoneNumbersByCountry": {
- "BE": 148,
- "RU": 128,
- "NL": 119,
- "NO": 102,
- "CH": 119,
- "CZ": 119,
- "HU": 125,
- "FR": 116,
- "BG": 144,
- "IT": 124,
- "GB": 115,
- "DE": 115,
- "GR": 125,
- "FI": 140,
- "AT": 120,
- "PT": 126,
- "ES": 112
}, - "totalInQuietHours": 128,
- "transliterationAnalysis": {
- "totalOriginalCost": 85.977,
- "totalOriginalParts": 2097,
- "totalReplacedCost": 85.977,
- "totalReplacedParts": 2097,
- "totalCostSaved": 0,
- "totalPartsSaved": 0,
- "text": {
- "original": {
- "text": "Test message {{firstName}} {{lastName}} {{field1}}",
- "length": 62,
- "parts": 1,
- "encoding": "GSM-7"
}, - "replaced": {
- "text": "Test message {{firstName}} {{lastName}} {{field1}}",
- "length": 62,
- "parts": 1,
- "encoding": "GSM-7",
- "characters": [ ]
}
}
}, - "groups": [
- {
- "id": 16,
- "name": "111111",
- "phoneNumbers": 2097
}
], - "invalid": [ ],
- "scheduled": false
}, - "data": [
- {
- "msgId": "8a12c115-d1f3-469f-a7f2-ccd2cbc1577b",
- "status": "ACCEPTED",
- "statusCode": 0,
- "inQuietHours": false,
- "createdAt": "2021-07-10 12:03:41",
- "cost": 0.041,
- "to": "+32470126746",
- "countryIso": "BE",
- "from": "InfoText",
- "text": "Test message Marko Jager 2241",
- "parts": 1,
- "textAnalysis": {
- "length": 15,
- "unicode": false,
- "parts": 1
}
}, - {
- "msgId": "d974d3c1-925d-45a2-9754-32df3ad98e95",
- "status": "ACCEPTED",
- "statusCode": 0,
- "inQuietHours": false,
- "createdAt": "2021-07-10 12:03:41",
- "cost": 0.041,
- "to": "+358412986629",
- "countryIso": "FI",
- "from": "InfoText",
- "text": "Test message Taija Eriksson 11244",
- "parts": 1,
- "textAnalysis": {
- "length": 15,
- "unicode": false,
- "parts": 1
}
}, - {
- "msgId": "69ed9b3d-1c87-40cc-a191-4a8053bd1dd9",
- "status": "ACCEPTED",
- "statusCode": 0,
- "inQuietHours": false,
- "createdAt": "2021-07-10 12:03:41",
- "cost": 0.041,
- "to": "+351912582951",
- "countryIso": "PT",
- "from": "InfoText",
- "text": "Test message Gabriela Dias 77584",
- "parts": 1,
- "textAnalysis": {
- "length": 15,
- "unicode": false,
- "parts": 1
}
}, - {
- "msgId": "f49d9934-ca75-4816-9906-6980820cc24a",
- "status": "ACCEPTED",
- "statusCode": 0,
- "inQuietHours": false,
- "createdAt": "2021-07-10 12:03:41",
- "cost": 0.041,
- "to": "+43664375723",
- "countryIso": "AT",
- "from": "InfoText",
- "text": "Test message Paul Kuefer 98530",
- "parts": 1,
- "textAnalysis": {
- "length": 15,
- "unicode": false,
- "parts": 1
}
}, - {
- "msgId": "f7a6e127-83fe-4aa3-a168-5c1159ce89b5",
- "status": "ACCEPTED",
- "statusCode": 0,
- "inQuietHours": false,
- "createdAt": "2021-07-10 12:03:41",
- "cost": 0.041,
- "to": "+31612724850",
- "countryIso": "NL",
- "from": "InfoText",
- "text": "Test message Ulrich Wielens 18693",
- "parts": 1,
- "textAnalysis": {
- "length": 15,
- "unicode": false,
- "parts": 1
}
}, - {
- "msgId": "f45ab76a-88b2-4eab-8a9d-c9eec1b3d9b1",
- "status": "ACCEPTED",
- "statusCode": 0,
- "inQuietHours": false,
- "createdAt": "2021-07-10 12:03:41",
- "cost": 0.041,
- "to": "+306912538521",
- "countryIso": "GR",
- "from": "InfoText",
- "text": "Test message Nikos Christoforou 44960",
- "parts": 1,
- "textAnalysis": {
- "length": 15,
- "unicode": false,
- "parts": 1
}
}
]
}
Delete scheduled SMS
Delete a scheduled SMS by providing a valid identifier (msgId
).
The cost of the deleted scheduled SMS will be returned to the balance of the account.
Errors for DELETE /sms/scheduled/{msgId}
HTTP code | Error code | Type | Description |
---|---|---|---|
403 | 1118 | access_denied | Only scheduled campaigns/messages can be deleted |
404 | 1100 | not_found | Message ID provided was not found or is not scheduled |
400 | 1115 | invalid_param | Message ID provided is not valid |
Authorizations:
path Parameters
msgId required | string <uuid> 36 characters ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]... Example: 3328fe13-2b99-4282-b62e-d891f5e452a8 Identifier of a scheduled message |
Responses
Request samples
- Shell + Curl
- Python + Requests
- Java + Okhttp
- Node + Native
- Javascript + Xhr
- Php + Curl
- Go + Native
- Ruby + Native
- Csharp + Restsharp
curl --request DELETE \ --url https://api.sms.cx/sms/scheduled/3328fe13-2b99-4282-b62e-d891f5e452a8 \ --header 'Authorization: Bearer REPLACE_ACCESS_TOKEN'
Response samples
- 200
- 400
- 401
- 403
- 404
- 405
- 429
- 500
{- "info": {
- "msgId": "cbaa21ab-e634-4168-b2be-1abeedee3a2d",
- "parts": 1,
- "creditReturned": 0.041,
- "channel": "sms"
}
}
Delete scheduled SMS campaign
Delete a scheduled SMS campaign by providing a valid identifier (campaignId
).
The cost of the deleted scheduled SMS campaign will be returned to the balance of the account.
If part of the SMS campaign has already started, only scheduled messages will be deleted. Messages already sent cannot be deleted.
Errors for DELETE /sms/scheduled/campaign/{campaignId}
HTTP code | Error code | Type | Description |
---|---|---|---|
403 | 1118 | access_denied | Only scheduled campaigns/messages can be deleted |
404 | 1150 | not_found | Campaign ID provided was not found or is not scheduled |
400 | 1155 | invalid_param | Campaign ID provided is not valid |
Authorizations:
path Parameters
campaignId required | string <uuid> 36 characters ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]... Example: cbb72a72-0dfa-4288-b3d0-05fab904f0b2 Identifier of a scheduled SMS campaign |
Responses
Request samples
- Shell + Curl
- Python + Requests
- Java + Okhttp
- Node + Native
- Javascript + Xhr
- Php + Curl
- Go + Native
- Ruby + Native
- Csharp + Restsharp
curl --request DELETE \ --url https://api.sms.cx/sms/scheduled/campaign/cbb72a72-0dfa-4288-b3d0-05fab904f0b2 \ --header 'Authorization: Bearer REPLACE_ACCESS_TOKEN'
Response samples
- 200
- 400
- 401
- 403
- 404
- 405
- 429
- 500
{- "info": {
- "campaignId": "d94606d5-f21c-4e61-a4a1-8e021a48957c",
- "totalPhoneNumbers": 2097,
- "totalParts": 2097,
- "phoneNumbersDeleted": 2097,
- "partsDeleted": 2097,
- "creditReturned": 85.977,
- "channel": "sms"
}
}
Receive update for OTP verification Webhook
POST
https://{{your-endpoint}}/path-for-otp-update
The SMS.CX API will make a POST
request to your webhook endpoint, which must return HTTP response 200
. If the response is not HTTP 200, SMS.CX API will retry the callback request for the next 24 hours using an exponential backoff algorithm.
Authorizations:
Request Body schema: application/json
event required | string Value: "otp_update" Event for which the callback request is made |
required | Array of objects (DataOtpUpdate) Event data, grouped in multiple objects (up to 200 in a request) |
Responses
Request samples
- Payload
{- "event": "otp_update",
- "data": [
- {
- "otpId": "8c8306b1-3b7d-453d-b8e0-60f43b208f16",
- "trackId": "22a2e764-bd7b-4114-bacc-ffbedef15db0",
- "phoneNumber": "+33612424105",
- "countryIso": "FR",
- "status": "VERIFIED",
- "cost": 0.063,
- "parts": 1,
- "maxAttempts": 5,
- "attempts": 3,
- "ttl": 300,
- "dateCreated": "2022-09-18 11:23:46",
- "dateExpires": "2022-09-28 11:28:46"
}
]
}
New OTP
Create a OTP request to verify a phone number.
Status for OTP requests
Status | Description |
---|---|
PENDING | The OTP is pending validation by user |
VERIFIED | The OTP was validated by user |
EXPIRED | The validity of OTP has expired |
CANCELLED | The OTP was cancelled by the user |
FAILED | The OTP failed because too many unsuccessful attempts |
Errors for POST /otp
HTTP code | Error code | Type | Description |
---|---|---|---|
400 | 2001 | invalid_param | The parameter 'phoneNumber' is empty or not set |
400 | 2002 | invalid_param | The parameter 'countryIso' is empty or not set |
400 | 2003 | invalid_param | Country ISO provided is invalid |
400 | 2004 | invalid_param | The parameter 'from' is empty or not set |
400 | 2005 | invalid_param | The parameter 'from' is not valid (min 3, max 15 characters) |
400 | 2006 | invalid_param | The parameter 'template' is empty or not set |
400 | 2006 | invalid_param | The parameter 'template' does not contain placeholder {{pin}} |
400 | 2007 | invalid_param | The parameter 'ttl' is not a number |
400 | 2008 | invalid_param | Min value for 'ttl' is 60 seconds |
400 | 2009 | invalid_param | Max value for 'ttl' is 1800 seconds (30 mins) |
400 | 2010 | invalid_param | The parameter 'maxAttempts' is not a number |
400 | 2011 | invalid_param | Min value for 'maxAttempts' is 1 |
400 | 2012 | invalid_param | Max value for 'maxAttempts' is 10 |
400 | 2013 | invalid_param | The parameter 'pinType' is empty or not set |
400 | 2014 | invalid_param | Invalid parameter 'pinType'. Must be one of: letters, numbers, alphanumeric |
400 | 2015 | invalid_param | The parameter 'pinLength' is not a number |
400 | 2016 | invalid_param | Min value for 'pinLength' is 4 |
400 | 2017 | invalid_param | Max value for 'pinLength' is 10 |
400 | 2018 | invalid_param | Track ID provided (parameter 'trackId') is not a valid UUID (v1-v5) |
400 | 2019 | invalid_param | The parameter 'otpCallbackUrl' is not a valid URL |
400 | 2020 | invalid_param | The phone number provided is invalid |
Authorizations:
Request Body schema: application/json
phoneNumber required | string Phone number in international E.164 format or national format. If national format is provided, for better validation you must use the parameter |
countryIso | string 2 characters Country ISO (two-letter) of the destination phone numbers (if provided in national format). Please note that if an international E.164 phone number format is provided in the |
from | string [ 3 .. 15 ] characters The originator (sender name) of the text message (min 3, max 11 characters). If the originator used in this value is not approved, it will be overwritten by a default system originator (eg. InfoText). Read more about sender names Note: This parameter is optional and can be used only if you want to overwrite the OTP settings of your SMS API application |
template | string The text message that will be delivered to the mobile number. It must contain the placeholder |
trackId | string 36 characters ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]... Client provided UUID (v1-v5) for tracking purposes |
ttl | integer <int32> [ 60 .. 1800 ] The time to live (ttl) defines the time in seconds that a pin is valid. Min 1 minute (60 seconds) and max 30 minutes (1800 seconds) |
maxAttempts | integer <int32> [ 1 .. 10 ] Number of attempts to allow the OTP to be verified before marking it as failed Note: If this parameter is set, it will overwrite the setting from Admin Dashboard > HTTP API > Oauth2 > Application settings |
pinType | string Enum: "letters" "numbers" "alphanumeric" Type of pin that will be generated for each mobile phone and will replace the placeholder {{pin} Note: If this parameter is set, it will overwrite the setting from Admin Dashboard > HTTP API > Oauth2 > Application settings |
pinLength | integer <int32> [ 4 .. 10 ] Character length of the pin |
otpCallbackUrl | string <url> A valid URL to receive status updates for the OTP verification. |
Responses
Request samples
- Payload
- Shell + Curl
- Python + Requests
- Java + Okhttp
- Node + Native
- Javascript + Xhr
- Php + Curl
- Go + Native
- Ruby + Native
- Csharp + Restsharp
{- "phoneNumber": "+33612424105"
}
Response samples
- 201
- 400
- 401
- 403
- 405
- 429
- 500
{- "otpId": "f91536c1-2aff-43b4-b6fa-15e8ade52946",
- "phoneNumber": "+33612424105",
- "countryIso": "FR",
- "status": "PENDING",
- "cost": 0.063,
- "parts": 1,
- "maxAttempts": 5,
- "attempts": 0,
- "ttl": 300,
- "dateCreated": "2022-09-18 12:02:35",
- "dateExpires": "2022-09-18 12:07:35"
}
Get OTP status
Retrieves the details of OTP status if a valid identifier was provided.
Status for OTP requests
Status | Description |
---|---|
PENDING | The OTP is pending validation by user |
VERIFIED | The OTP was validated by user |
EXPIRED | The validity of OTP has expired |
CANCELLED | The OTP was cancelled by the user |
FAILED | The OTP failed because too many unsuccessful attempts |
Errors for GET /otp/{otpId}
HTTP code | Error code | Type | Description |
---|---|---|---|
404 | 2021 | not_found | Otp ID not found |
Authorizations:
path Parameters
otpId required | string <uuid> 36 characters ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]... Example: a17fb13d-f4ac-4d93-9439-ef41ab8de390 Identifier of the OTP request |
Responses
Request samples
- Shell + Curl
- Python + Requests
- Java + Okhttp
- Node + Native
- Javascript + Xhr
- Php + Curl
- Go + Native
- Ruby + Native
- Csharp + Restsharp
curl --request GET \ --url https://api.sms.cx/otp/a17fb13d-f4ac-4d93-9439-ef41ab8de390 \ --header 'Authorization: Bearer REPLACE_ACCESS_TOKEN'
Response samples
- 200
- 401
- 403
- 404
- 405
- 429
- 500
{- "otpId": "486a78ba-0234-4d26-a26c-079823d59ea5",
- "trackId": "22a2e764-bd7b-4114-bacc-ffbedef15db0",
- "phoneNumber": "+33612424105",
- "countryIso": "FR",
- "status": "PENDING",
- "cost": 0.063,
- "parts": 1,
- "maxAttempts": 5,
- "attempts": 0,
- "ttl": 300,
- "dateCreated": "2022-09-18 09:20:42",
- "dateExpires": "2022-09-18 09:25:42"
}
Verify OTP
Verify the OTP received on the phone number.
Errors for POST /otp/{otpId}
HTTP code | Error code | Type | Description |
---|---|---|---|
404 | 2021 | not_found | Otp ID not found |
400 | 2022 | invalid_param | The parameter pin is empty or not set |
400 | 2023 | otp_verified | The OTP was already verified |
400 | 2024 | otp_cancelled | The OTP was canceled |
400 | 2025 | otp_expired | The OTP has expired |
400 | 2026 | otp_failed | The OTP has failed, maximum attempts reached |
400 | 2027 | otp_failed | Max attempts reached |
400 | 2028 | otp_expired | The PIN has expired |
400 | 2029 | invalid_pin | The PIN provided does not verify |
Authorizations:
path Parameters
otpId required | string <uuid> 36 characters ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]... Example: a17fb13d-f4ac-4d93-9439-ef41ab8de390 Identifier of the OTP request |
Request Body schema: application/json
pin required | string The PIN code received on the mobile number |
Responses
Request samples
- Payload
- Shell + Curl
- Python + Requests
- Java + Okhttp
- Node + Native
- Javascript + Xhr
- Php + Curl
- Go + Native
- Ruby + Native
- Csharp + Restsharp
{- "pin": "28822"
}
Response samples
- 200
- 400
- 401
- 403
- 404
- 405
- 429
- 500
{- "status": "VERIFIED"
}
Cancel OTP
Cancel OTP request if a valid identifier was provided.
Errors for DELETE /otp/{otpId}
HTTP code | Error code | Type | Description |
---|---|---|---|
404 | 2021 | not_found | Otp ID not found |
403 | 2030 | access_denied | Otp already cancelled |
403 | 2031 | access_denied | You cannot cancel a non-pending Otp |
Authorizations:
path Parameters
otpId required | string <uuid> 36 characters ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]... Example: a17fb13d-f4ac-4d93-9439-ef41ab8de390 Identifier of the OTP request |
Responses
Request samples
- Shell + Curl
- Python + Requests
- Java + Okhttp
- Node + Native
- Javascript + Xhr
- Php + Curl
- Go + Native
- Ruby + Native
- Csharp + Restsharp
curl --request DELETE \ --url https://api.sms.cx/otp/a17fb13d-f4ac-4d93-9439-ef41ab8de390 \ --header 'Authorization: Bearer REPLACE_ACCESS_TOKEN'
Response samples
- 200
- 400
- 401
- 403
- 404
- 405
- 429
- 500
{- "info": {
- "id": "74231ea3-041b-4cd2-9222-08f7396e5bfb"
}
}
Send Viber message
Sends Viber message to a single phone number or to a list of phone numbers.
This endpoint was designed to handle big data objects (up to 25.000 Viber messages in one request).
If you have loops or iterations we recommend building the send object in your application, and make a single request to this endpoint. The time of making the requests will decrease - by doing a single request with multiple send objects vs making requests in a loop - and you won't have to worry about making concurrent API calls.
Note: This endpoint accepts idempotent requests by providing an additional
idempotencyId
parameter in body with a unique value generated by the client of type UUID v1-v5. To confirm that the server understood the request, the response will contain the headerX-Idempotency-Id
with your unique value. By using idempotency you can retry requests in case of network error or server not responding in time, without accidentally performing the same operation twice and have a guarantee of not being billed twice.
Errors for POST /viber
HTTP code | Error code | Type | Description |
---|---|---|---|
400 | 1104 | invalid_param | The parameter to is empty or not set |
400 | 1105 | invalid_param | The parameter from is empty or not set |
400 | 1108 | invalid_param | The parameter scheduledDate is not a valid date |
400 | 1109 | invalid_param | The parameter dlrCallbackUrl is not a valid URL |
400 | 1111 | invalid_param | Idempotency Id provided is not a valid UUID (v1-v5) |
400 | 1112 | invalid_param | The shortlink/attachment ID provided for tracking is invalid or not found |
400 | 1116 | invalid_param | The scheduled date is in the past |
400 | 1103 | invalid_param | The phone numbers array is too big (max. allowed: 25000 numbers) |
400 | 1207 | invalid_param | The phone number provided is not valid |
400 | 1210 | invalid_param | The phone numbers provided are invalid |
403 | 1119 | no_coverage | No coverage or restricted destination |
400 | 1113 | insufficient_credit | Insufficient credit |
400 | 1114 | insufficient_credit | Credit limit reached. To increase the credit limit, please contact your account manager |
400 | 1126 | invalid_param | The parameter templateId is not set |
400 | 1127 | invalid_param | The parameter templateId is not valid |
400 | 1128 | invalid_param | The template ID provided is not a valid template |
403 | 1132 | access_denied | The template ID provided is not approved |
403 | 1133 | access_denied | The template ID provided is not locked |
Authorizations:
Request Body schema: application/json
to required | Array of strings A string with single phone number or an array of phone numbers in international E.164 format or national format. If national format is provided, for better validation you must use the parameter |
from required | string [ 3 .. 15 ] characters The originator (sender name) of the text message (min 3, max 15 characters). If the originator used in this value is not approved, it will be overwritten by a default system originator (eg. InfoText). Read more about sender names |
templateId required | integer <int32> Identifier of the approved Viber template |
object (CustomFields) An object with key-value pairs, where the key is the name of the custom field. An actual JSON object described by this might look like this:
The data stored in the custom fields will be inserted in the text message template by replacing the placeholder | |
countryIso | string 2 characters Country ISO (two-letter) of the destination phone numbers (if provided in national format). Please note that if an international E.164 phone number format is provided in the |
allowInvalid | boolean Default: false By default an error will be thrown if any invalid numbers are detected in the |
scheduledDate | string <date-time> If you want to schedule the Viber message at a later date. The date provided must be in format YYYY-MM-DD HH:MM:SS (Eg. 2021-06-23 14:26:10). By default, the date and time in this parameter is treated as |
isUtc | boolean Default: true If set to |
dlrCallbackUrl | string <url> A valid URL to receive the delivery report update for the sent Viber message. If this parameter is set, it will overwrite the setting from Admin Dashboard > HTTP API > Oauth2 > Application settings |
trackData | string <uuid> 36 characters ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]... Allows to track messages a client provided ID. The |
shortResponse | boolean Default: false If set to |
noTextDetails | boolean Default: false The response will not have the parameters |
showTimezone | boolean Default: false Shows the parameter |
idempotencyId | string <uuid> 36 characters ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]... A unique idempotency id generated by the client. For more information, refer to Idempotent requests. The API will return an error if the value provided is not a valid UUID (v1-v5) |
Responses
Request samples
- Payload
- Shell + Curl
- Python + Requests
- Java + Okhttp
- Node + Native
- Javascript + Xhr
- Php + Curl
- Go + Native
- Ruby + Native
- Csharp + Restsharp
{- "to": [
- "+31612469333",
- "+34612934161",
- "+3361611862",
- "+34612934161",
- "+447400790504",
- "+4915123438636",
- "+3361611862"
], - "from": "InfoText",
- "templateId": 15,
- "allowInvalid": true
}
Response samples
- 200
- 400
- 401
- 403
- 405
- 429
- 500
{- "info": {
- "campaignId": "7edd1d4a-4bdf-47b7-b8bd-46a947fa298e",
- "totalPhoneNumbers": 7,
- "totalValid": 5,
- "totalInvalid": 2,
- "totalCost": 0.13,
- "totalParts": 5,
- "phoneNumbersByCountry": {
- "NL": 1,
- "ES": 2,
- "GB": 1,
- "DE": 1
}, - "invalid": [
- "+3361611862",
- "+3361611862"
], - "scheduled": false
}, - "data": [
- {
- "msgId": "a40465c7-aadb-4b1d-89af-08a260985a68",
- "status": "ACCEPTED",
- "statusCode": 0,
- "inQuietHours": false,
- "createdAt": "2021-07-12 08:19:00",
- "cost": 0.026,
- "to": "+31612469333",
- "countryIso": "NL",
- "from": "InfoText",
- "text": "Redeem this voucher in the next 30 days to get a 30% discount off all Summer Fashion",
- "parts": 1
}, - {
- "msgId": "07f90eec-6316-4a58-9f76-2a3a21b26b38",
- "status": "ACCEPTED",
- "statusCode": 0,
- "inQuietHours": false,
- "createdAt": "2021-07-12 08:19:00",
- "cost": 0.026,
- "to": "+34612934161",
- "countryIso": "ES",
- "from": "InfoText",
- "text": "Redeem this voucher in the next 30 days to get a 30% discount off all Summer Fashion",
- "parts": 1
}, - {
- "msgId": "3df9126d-2a16-4174-8f33-cde059cecd1f",
- "status": "ACCEPTED",
- "statusCode": 0,
- "inQuietHours": false,
- "createdAt": "2021-07-12 08:19:00",
- "cost": 0.026,
- "to": "+34612934161",
- "countryIso": "ES",
- "from": "InfoText",
- "text": "Redeem this voucher in the next 30 days to get a 30% discount off all Summer Fashion",
- "parts": 1
}, - {
- "msgId": "00cf4f66-1ac8-46d4-a295-f5b7deb686eb",
- "status": "ACCEPTED",
- "statusCode": 0,
- "inQuietHours": false,
- "createdAt": "2021-07-12 08:19:00",
- "cost": 0.026,
- "to": "+447400790504",
- "countryIso": "GB",
- "from": "InfoText",
- "text": "Redeem this voucher in the next 30 days to get a 30% discount off all Summer Fashion",
- "parts": 1
}, - {
- "msgId": "b746eff2-2950-4ba2-9068-831c3038444b",
- "status": "ACCEPTED",
- "statusCode": 0,
- "inQuietHours": false,
- "createdAt": "2021-07-12 08:19:00",
- "cost": 0.026,
- "to": "+4915123438636",
- "countryIso": "DE",
- "from": "InfoText",
- "text": "Redeem this voucher in the next 30 days to get a 30% discount off all Summer Fashion",
- "parts": 1
}
]
}
Estimate Viber message
Estimate the cost of sending a Viber message.
This endpoint is identical to /viber
endpoint, but it will only simulate the Viber sending (no billing).
The request body and the response are the same as for /viber
endpoint.
Errors for POST /viber/estimate
HTTP code | Error code | Type | Description |
---|---|---|---|
400 | 1104 | invalid_param | The parameter to is empty or not set |
400 | 1105 | invalid_param | The parameter from is empty or not set |
400 | 1108 | invalid_param | The parameter scheduledDate is not a valid date |
400 | 1109 | invalid_param | The parameter dlrCallbackUrl is not a valid URL |
400 | 1112 | invalid_param | The shortlink/attachment ID provided for tracking is invalid or not found |
400 | 1116 | invalid_param | The scheduled date is in the past |
400 | 1103 | invalid_param | The phone numbers array is too big (max. allowed: 25000 numbers) |
400 | 1207 | invalid_param | The phone number provided is not valid |
400 | 1210 | invalid_param | The phone numbers provided are invalid |
403 | 1119 | no_coverage | No coverage or restricted destination |
400 | 1113 | insufficient_credit | Insufficient credit |
400 | 1114 | insufficient_credit | Credit limit reached. To increase the credit limit, please contact your account manager |
400 | 1126 | invalid_param | The parameter templateId is not set |
400 | 1127 | invalid_param | The parameter templateId is not valid |
400 | 1128 | invalid_param | The template ID provided is not a valid template |
403 | 1132 | access_denied | The template ID provided is not approved |
403 | 1133 | access_denied | The template ID provided is not locked |
Authorizations:
Request Body schema: application/json
to required | Array of strings A string with single phone number or an array of phone numbers in international E.164 format or national format. If national format is provided, for better validation you must use the parameter |
from required | string [ 3 .. 15 ] characters The originator (sender name) of the text message (min 3, max 15 characters). If the originator used in this value is not approved, it will be overwritten by a default system originator (eg. InfoText). Read more about sender names |
templateId required | integer <int32> Identifier of the approved Viber template |
object (CustomFields) An object with key-value pairs, where the key is the name of the custom field. An actual JSON object described by this might look like this:
The data stored in the custom fields will be inserted in the text message template by replacing the placeholder | |
countryIso | string 2 characters Country ISO (two-letter) of the destination phone numbers (if provided in national format). Please note that if an international E.164 phone number format is provided in the |
allowInvalid | boolean Default: false By default an error will be thrown if any invalid numbers are detected in the |
scheduledDate | string <date-time> If you want to schedule the Viber message at a later date. The date provided must be in format YYYY-MM-DD HH:MM:SS (Eg. 2021-06-23 14:26:10). By default, the date and time in this parameter is treated as |
isUtc | boolean Default: true If set to |
dlrCallbackUrl | string <url> A valid URL to receive the delivery report update for the sent Viber message. If this parameter is set, it will overwrite the setting from Admin Dashboard > HTTP API > Oauth2 > Application settings |
trackData | string <uuid> 36 characters ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]... Allows to track messages a client provided ID. The |
shortResponse | boolean Default: false If set to |
noTextDetails | boolean Default: false The response will not have the parameters |
showTimezone | boolean Default: false Shows the parameter |
Responses
Request samples
- Payload
- Shell + Curl
- Python + Requests
- Java + Okhttp
- Node + Native
- Javascript + Xhr
- Php + Curl
- Go + Native
- Ruby + Native
- Csharp + Restsharp
{- "to": [
- "+31612469333",
- "+34612934161",
- "+3361611862",
- "+34612934161",
- "+447400790504",
- "+4915123438636",
- "+3361611862"
], - "from": "InfoText",
- "templateId": 15,
- "allowInvalid": true
}
Response samples
- 200
- 400
- 401
- 403
- 405
- 429
- 500
{- "info": {
- "campaignId": "4470edd5-bd84-48a2-804b-d79cff8d7b01",
- "totalPhoneNumbers": 7,
- "totalValid": 5,
- "totalInvalid": 2,
- "totalCost": 0.13,
- "totalParts": 5,
- "phoneNumbersByCountry": {
- "NL": 1,
- "ES": 2,
- "GB": 1,
- "DE": 1
}, - "invalid": [
- "+3361611862",
- "+3361611862"
], - "scheduled": false
}, - "data": [
- {
- "msgId": "5acea025-2916-43f7-af3c-130c3cf4382c",
- "status": "ACCEPTED",
- "statusCode": 0,
- "inQuietHours": false,
- "createdAt": "2021-07-12 11:13:07",
- "cost": 0.026,
- "to": "+31612469333",
- "countryIso": "NL",
- "from": "InfoText",
- "text": "Redeem this voucher in the next 30 days to get a 30% discount off all Summer Fashion",
- "parts": 1
}, - {
- "msgId": "4acf7c0e-9c11-4e76-9e54-873a0ac65abf",
- "status": "ACCEPTED",
- "statusCode": 0,
- "inQuietHours": false,
- "createdAt": "2021-07-12 11:13:07",
- "cost": 0.026,
- "to": "+34612934161",
- "countryIso": "ES",
- "from": "InfoText",
- "text": "Redeem this voucher in the next 30 days to get a 30% discount off all Summer Fashion",
- "parts": 1
}, - {
- "msgId": "8815c46e-0ef8-4322-b13f-ee3bf355afa6",
- "status": "ACCEPTED",
- "statusCode": 0,
- "inQuietHours": false,
- "createdAt": "2021-07-12 11:13:07",
- "cost": 0.026,
- "to": "+34612934161",
- "countryIso": "ES",
- "from": "InfoText",
- "text": "Redeem this voucher in the next 30 days to get a 30% discount off all Summer Fashion",
- "parts": 1
}, - {
- "msgId": "e88bf798-0ff8-48c2-9cd4-70d34b7ef23e",
- "status": "ACCEPTED",
- "statusCode": 0,
- "inQuietHours": false,
- "createdAt": "2021-07-12 11:13:07",
- "cost": 0.026,
- "to": "+447400790504",
- "countryIso": "GB",
- "from": "InfoText",
- "text": "Redeem this voucher in the next 30 days to get a 30% discount off all Summer Fashion",
- "parts": 1
}, - {
- "msgId": "4bad31d0-38ad-4201-8b63-63ff96eccfa5",
- "status": "ACCEPTED",
- "statusCode": 0,
- "inQuietHours": false,
- "createdAt": "2021-07-12 11:13:07",
- "cost": 0.026,
- "to": "+4915123438636",
- "countryIso": "DE",
- "from": "InfoText",
- "text": "Redeem this voucher in the next 30 days to get a 30% discount off all Summer Fashion",
- "parts": 1
}
]
}
Send Viber campaign
Sends Viber message to existing group(s) of contacts.
Note: This endpoint accepts idempotent requests by providing an additional
idempotencyId
parameter in body with a unique value generated by the client of type UUID v1-v5. To confirm that the server understood the request, the response will contain the headerX-Idempotency-Id
with your unique value. By using idempotency you can retry requests in case of network error or server not responding in time, without accidentally performing the same operation twice and have a guarantee of not being billed twice.
We recommend to always use Idempotency ID when sending Viber campaigns
Errors for POST /viber/campaigns
HTTP code | Error code | Type | Description |
---|---|---|---|
400 | 1101 | invalid_param | The parameter groups is empty or not set |
400 | 1140 | invalid_param | Group ID is not a valid group |
400 | 1102 | invalid_param | Group is empty |
400 | 1103 | invalid_param | The phone numbers array is too big (max. allowed: 25000 numbers) |
400 | 1105 | invalid_param | The parameter from is empty or not set |
400 | 1108 | invalid_param | The parameter scheduledDate is not a valid date |
400 | 1109 | invalid_param | The parameter dlrCallbackUrl is not a valid URL |
400 | 1111 | invalid_param | Idempotency Id provided is not a valid UUID (v1-v5) |
400 | 1112 | invalid_param | The shortlink/attachment ID provided for tracking is invalid or not found |
400 | 1116 | invalid_param | The scheduled date is in the past |
400 | 1207 | invalid_param | The phone number provided is not valid |
400 | 1210 | invalid_param | The phone numbers provided are invalid |
403 | 1119 | no_coverage | No coverage or restricted destination |
400 | 1113 | insufficient_credit | Insufficient credit |
400 | 1114 | insufficient_credit | Credit limit reached. To increase the credit limit, please contact your account manager |
400 | 1126 | invalid_param | The parameter templateId is not set |
400 | 1127 | invalid_param | The parameter templateId is not valid |
400 | 1128 | invalid_param | The template ID provided is not a valid template |
403 | 1132 | access_denied | The template ID provided is not approved |
403 | 1133 | access_denied | The template ID provided is not locked |
Authorizations:
Request Body schema: application/json
groups required | Array of integers <int32> An array of identifiers for groups of contacts |
from required | string [ 3 .. 15 ] characters The originator (sender name) of the text message (min 3, max 15 characters). If the originator used in this value is not approved, it will be overwritten by a default system originator (eg. InfoText). Read more about sender names |
templateId required | integer <int32> Identifier of the approved Viber template |
object (CustomFields) An object with key-value pairs, where the key is the name of the custom field. An actual JSON object described by this might look like this:
The data stored in the custom fields will be inserted in the text message template by replacing the placeholder | |
scheduledDate | string <date-time> If you want to schedule the Viber message at a later date. The date provided must be in format YYYY-MM-DD HH:MM:SS (Eg. 2021-06-23 14:26:10). By default, the date and time in this parameter is treated as |
isUtc | boolean Default: true If set to |
dlrCallbackUrl | string <url> A valid URL to receive the delivery report update for the sent Viber. If this parameter is set, it will overwrite the setting from Admin Dashboard > HTTP API > Oauth2 > Application settings |
shortResponse | boolean Default: false If set to |
noTextDetails | boolean Default: false The response will not have the parameters |
showTimezone | boolean Default: false Shows the parameter |
idempotencyId | string <uuid> 36 characters ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]... A unique idempotency id generated by the client. For more information, refer to Idempotent requests. The API will return an error if the value provided is not a valid UUID (v1-v5) |
Responses
Request samples
- Payload
- Shell + Curl
- Python + Requests
- Java + Okhttp
- Node + Native
- Javascript + Xhr
- Php + Curl
- Go + Native
- Ruby + Native
- Csharp + Restsharp
{- "groups": [
- 18,
- 17
], - "from": "InfoText",
- "templateId": 17,
- "idempotencyId": "79661419-b349-4b60-8f70-7581a1b0e333"
}
Response samples
- 200
- 400
- 401
- 403
- 405
- 429
- 500
{- "info": {
- "campaignId": "14b3611d-86f8-4e97-89be-8bc704bb1ea5",
- "totalPhoneNumbers": 23,
- "totalValid": 22,
- "totalInvalid": 1,
- "duplicatesRemoved": 1,
- "totalCost": 0.462,
- "totalParts": 22,
- "phoneNumbersByCountry": {
- "FR": 2,
- "AT": 1,
- "CH": 2,
- "PT": 3,
- "DE": 2,
- "HU": 1,
- "ES": 2,
- "BG": 1,
- "NL": 1,
- "GB": 1,
- "NO": 2,
- "GR": 2,
- "FI": 1,
- "CZ": 1
}, - "groups": [
- {
- "id": 18,
- "name": "My new group",
- "phoneNumbers": 6
}, - {
- "id": 17,
- "name": "My group 3",
- "phoneNumbers": 17
}
], - "invalid": [ ],
- "scheduled": false
}, - "data": [
- {
- "msgId": "5a57a8ac-d312-4388-93e4-d2e2a4eddfdb",
- "status": "ACCEPTED",
- "statusCode": 0,
- "inQuietHours": false,
- "createdAt": "2021-07-25 16:14:03",
- "cost": 0.021,
- "to": "+33612970283",
- "countryIso": "FR",
- "from": "InfoText",
- "text": "Hi Aubert. Redeem this voucher in the next 30 days to get a 30% discount off all Summer Fashion https://en.ax/l9rG/U92G",
- "parts": 1
}, - {
- "msgId": "8be816a4-b437-43a4-9b9e-70319177bef8",
- "status": "ACCEPTED",
- "statusCode": 0,
- "inQuietHours": false,
- "createdAt": "2021-07-25 16:14:03",
- "cost": 0.021,
- "to": "+43664187834",
- "countryIso": "AT",
- "from": "InfoText",
- "text": "Hi Uwe. Redeem this voucher in the next 30 days to get a 30% discount off all Summer Fashion https://en.ax/l9rG/XBb3",
- "parts": 1
}, - {
- "msgId": "f9f6f820-9882-469f-b210-9bb28702c303",
- "status": "ACCEPTED",
- "statusCode": 0,
- "inQuietHours": false,
- "createdAt": "2021-07-25 16:14:03",
- "cost": 0.021,
- "to": "+41781218472",
- "countryIso": "CH",
- "from": "InfoText",
- "text": "Hi Martin. Redeem this voucher in the next 30 days to get a 30% discount off all Summer Fashion https://en.ax/l9rG/YQeE",
- "parts": 1
}, - {
- "msgId": "726c8522-0033-44aa-9751-00ecfff67986",
- "status": "ACCEPTED",
- "statusCode": 0,
- "inQuietHours": false,
- "createdAt": "2021-07-25 16:14:03",
- "cost": 0.021,
- "to": "+351912110421",
- "countryIso": "PT",
- "from": "InfoText",
- "text": "Hi Guilherme. Redeem this voucher in the next 30 days to get a 30% discount off all Summer Fashion https://en.ax/l9rG/ZzXt",
- "parts": 1
}, - {
- "msgId": "62444bb1-663f-4297-a580-b02c7345e77d",
- "status": "ACCEPTED",
- "statusCode": 0,
- "inQuietHours": false,
- "createdAt": "2021-07-25 16:14:03",
- "cost": 0.021,
- "to": "+4915123473140",
- "countryIso": "DE",
- "from": "InfoText",
- "text": "Hi Tom. Redeem this voucher in the next 30 days to get a 30% discount off all Summer Fashion https://en.ax/l9rG/94oB",
- "parts": 1
}, - {
- "msgId": "a50eba94-7061-445e-9b03-a8bacef1f527",
- "status": "ACCEPTED",
- "statusCode": 0,
- "inQuietHours": false,
- "createdAt": "2021-07-25 16:14:03",
- "cost": 0.021,
- "to": "+4915123966046",
- "countryIso": "DE",
- "from": "InfoText",
- "text": "Hi Christina. Redeem this voucher in the next 30 days to get a 30% discount off all Summer Fashion https://en.ax/l9rG/ix5E",
- "parts": 1
}, - {
- "msgId": "f60ca658-144d-43f2-a522-101f3a2d5117",
- "status": "ACCEPTED",
- "statusCode": 0,
- "inQuietHours": false,
- "createdAt": "2021-07-25 16:14:03",
- "cost": 0.021,
- "to": "+36201910674",
- "countryIso": "HU",
- "from": "InfoText",
- "text": "Hi Boris. Redeem this voucher in the next 30 days to get a 30% discount off all Summer Fashion https://en.ax/l9rG/06Ij",
- "parts": 1
}, - {
- "msgId": "6a1bd85a-c7d8-4a73-85e8-c5b7b48aa844",
- "status": "ACCEPTED",
- "statusCode": 0,
- "inQuietHours": false,
- "createdAt": "2021-07-25 16:14:03",
- "cost": 0.021,
- "to": "+41781121629",
- "countryIso": "CH",
- "from": "InfoText",
- "text": "Hi Annett. Redeem this voucher in the next 30 days to get a 30% discount off all Summer Fashion https://en.ax/l9rG/ALnp",
- "parts": 1
}, - {
- "msgId": "185ad30c-691c-47a2-a16a-21c15929fdda",
- "status": "ACCEPTED",
- "statusCode": 0,
- "inQuietHours": false,
- "createdAt": "2021-07-25 16:14:03",
- "cost": 0.021,
- "to": "+34612406674",
- "countryIso": "ES",
- "from": "InfoText",
- "text": "Hi Guinerve. Redeem this voucher in the next 30 days to get a 30% discount off all Summer Fashion https://en.ax/l9rG/wH7I",
- "parts": 1
}, - {
- "msgId": "b114c0de-8090-4dea-890c-077fa0296364",
- "status": "ACCEPTED",
- "statusCode": 0,
- "inQuietHours": false,
- "createdAt": "2021-07-25 16:14:03",
- "cost": 0.021,
- "to": "+33612935399",
- "countryIso": "FR",
- "from": "InfoText",
- "text": "Hi Anton. Redeem this voucher in the next 30 days to get a 30% discount off all Summer Fashion https://en.ax/l9rG/5EsM",
- "parts": 1
}, - {
- "msgId": "9610c227-6e3e-46d2-b8d8-fd26b21a6483",
- "status": "ACCEPTED",
- "statusCode": 0,
- "inQuietHours": false,
- "createdAt": "2021-07-25 16:14:03",
- "cost": 0.021,
- "to": "+34612160806",
- "countryIso": "ES",
- "from": "InfoText",
- "text": "Hi Almanza. Redeem this voucher in the next 30 days to get a 30% discount off all Summer Fashion https://en.ax/l9rG/OEij",
- "parts": 1
}, - {
- "msgId": "ef8694e2-bf8b-47eb-b2a6-064165ecda56",
- "status": "ACCEPTED",
- "statusCode": 0,
- "inQuietHours": false,
- "createdAt": "2021-07-25 16:14:03",
- "cost": 0.021,
- "to": "+35948964458",
- "countryIso": "BG",
- "from": "InfoText",
- "text": "Hi Fejes. Redeem this voucher in the next 30 days to get a 30% discount off all Summer Fashion https://en.ax/l9rG/8Jsp",
- "parts": 1
}, - {
- "msgId": "5a6fd77b-26a9-42db-a09c-e726b9ebd770",
- "status": "ACCEPTED",
- "statusCode": 0,
- "inQuietHours": false,
- "createdAt": "2021-07-25 16:14:03",
- "cost": 0.021,
- "to": "+31612576088",
- "countryIso": "NL",
- "from": "InfoText",
- "text": "Hi Joppe. Redeem this voucher in the next 30 days to get a 30% discount off all Summer Fashion https://en.ax/l9rG/gDWC",
- "parts": 1
}, - {
- "msgId": "502b09b1-16c8-4d8a-8d0d-e3783e33a79e",
- "status": "ACCEPTED",
- "statusCode": 0,
- "inQuietHours": false,
- "createdAt": "2021-07-25 16:14:03",
- "cost": 0.021,
- "to": "+351912938895",
- "countryIso": "PT",
- "from": "InfoText",
- "text": "Hi Rodrigues. Redeem this voucher in the next 30 days to get a 30% discount off all Summer Fashion https://en.ax/l9rG/JWO0",
- "parts": 1
}, - {
- "msgId": "7cd0d552-8e89-4cd0-8215-f23fee5fd274",
- "status": "ACCEPTED",
- "statusCode": 0,
- "inQuietHours": false,
- "createdAt": "2021-07-25 16:14:03",
- "cost": 0.021,
- "to": "+447400547989",
- "countryIso": "GB",
- "from": "InfoText",
- "text": "Hi Hayden. Redeem this voucher in the next 30 days to get a 30% discount off all Summer Fashion https://en.ax/l9rG/87vH",
- "parts": 1
}, - {
- "msgId": "bc09eb34-ca74-4280-aa32-ec497283cc14",
- "status": "ACCEPTED",
- "statusCode": 0,
- "inQuietHours": false,
- "createdAt": "2021-07-25 16:14:03",
- "cost": 0.021,
- "to": "+4740278715",
- "countryIso": "NO",
- "from": "InfoText",
- "text": "Hi Even. Redeem this voucher in the next 30 days to get a 30% discount off all Summer Fashion https://en.ax/l9rG/DGFZ",
- "parts": 1
}, - {
- "msgId": "e1f48fb7-2899-477d-90ea-4a8bbc4a3853",
- "status": "ACCEPTED",
- "statusCode": 0,
- "inQuietHours": false,
- "createdAt": "2021-07-25 16:14:03",
- "cost": 0.021,
- "to": "+306912534172",
- "countryIso": "GR",
- "from": "InfoText",
- "text": "Hi Ariana. Redeem this voucher in the next 30 days to get a 30% discount off all Summer Fashion https://en.ax/l9rG/K9EA",
- "parts": 1
}, - {
- "msgId": "12830e9a-8a55-4562-ae8e-771cb912b93a",
- "status": "ACCEPTED",
- "statusCode": 0,
- "inQuietHours": false,
- "createdAt": "2021-07-25 16:14:03",
- "cost": 0.021,
- "to": "+306912592181",
- "countryIso": "GR",
- "from": "InfoText",
- "text": "Hi Areta. Redeem this voucher in the next 30 days to get a 30% discount off all Summer Fashion https://en.ax/l9rG/XB7s",
- "parts": 1
}, - {
- "msgId": "b6d78adb-3ace-449e-8879-a9246965e1c4",
- "status": "ACCEPTED",
- "statusCode": 0,
- "inQuietHours": false,
- "createdAt": "2021-07-25 16:14:03",
- "cost": 0.021,
- "to": "+351912432772",
- "countryIso": "PT",
- "from": "InfoText",
- "text": "Hi Castro. Redeem this voucher in the next 30 days to get a 30% discount off all Summer Fashion https://en.ax/l9rG/47R3",
- "parts": 1
}, - {
- "msgId": "53081329-66a7-4e5b-abb1-e73bfa43fe02",
- "status": "ACCEPTED",
- "statusCode": 0,
- "inQuietHours": false,
- "createdAt": "2021-07-25 16:14:03",
- "cost": 0.021,
- "to": "+358412810699",
- "countryIso": "FI",
- "from": "InfoText",
- "text": "Hi Jouko. Redeem this voucher in the next 30 days to get a 30% discount off all Summer Fashion https://en.ax/l9rG/4Wpl",
- "parts": 1
}, - {
- "msgId": "f78ca028-4d5a-42a6-a723-93ce53f0350d",
- "status": "ACCEPTED",
- "statusCode": 0,
- "inQuietHours": false,
- "createdAt": "2021-07-25 16:14:03",
- "cost": 0.021,
- "to": "+4740885535",
- "countryIso": "NO",
- "from": "InfoText",
- "text": "Hi Sofia. Redeem this voucher in the next 30 days to get a 30% discount off all Summer Fashion https://en.ax/l9rG/ylWC",
- "parts": 1
}, - {
- "msgId": "66ee744d-a4df-4c66-8d9a-f7d0e81f4ab2",
- "status": "ACCEPTED",
- "statusCode": 0,
- "inQuietHours": false,
- "createdAt": "2021-07-25 16:14:03",
- "cost": 0.021,
- "to": "+420601351061",
- "countryIso": "CZ",
- "from": "InfoText",
- "text": "Hi Františka. Redeem this voucher in the next 30 days to get a 30% discount off all Summer Fashion https://en.ax/l9rG/a9Cl",
- "parts": 1
}
]
}
Estimate Viber campaign
Estimate the cost of sending a Viber message to groups of phone numbers.
This endpoint is identical to /viber/campaign
endpoint, but it will only simulate the Viber sending (no billing).
The request body and the response are the same as for /viber/campaign
endpoint.
Errors for POST /viber/campaigns/estimate
HTTP code | Error code | Type | Description |
---|---|---|---|
400 | 1101 | invalid_param | The parameter groups is empty or not set |
400 | 1140 | invalid_param | Group ID is not a valid group |
400 | 1102 | invalid_param | Group is empty |
400 | 1103 | invalid_param | The phone numbers array is too big (max. allowed: 25000 numbers) |
400 | 1105 | invalid_param | The parameter from is empty or not set |
400 | 1108 | invalid_param | The parameter scheduledDate is not a valid date |
400 | 1109 | invalid_param | The parameter dlrCallbackUrl is not a valid URL |
400 | 1112 | invalid_param | The shortlink/attachment ID provided for tracking is invalid or not found |
400 | 1116 | invalid_param | The scheduled date is in the past |
400 | 1207 | invalid_param | The phone number provided is not valid |
400 | 1210 | invalid_param | The phone numbers provided are invalid |
403 | 1119 | no_coverage | No coverage or restricted destination |
400 | 1113 | insufficient_credit | Insufficient credit |
400 | 1114 | insufficient_credit | Credit limit reached. To increase the credit limit, please contact your account manager |
400 | 1126 | invalid_param | The parameter templateId is not set |
400 | 1127 | invalid_param | The parameter templateId is not valid |
400 | 1128 | invalid_param | The template ID provided is not a valid template |
403 | 1132 | access_denied | The template ID provided is not approved |
403 | 1133 | access_denied | The template ID provided is not locked |
Authorizations:
Request Body schema: application/json
groups required | Array of integers <int32> An array of identifiers for groups of contacts |
from required | string [ 3 .. 15 ] characters The originator (sender name) of the text message (min 3, max 15 characters). If the originator used in this value is not approved, it will be overwritten by a default system originator (eg. InfoText). Read more about sender names |
templateId required | integer <int32> Identifier of the approved Viber template |
object (CustomFields) An object with key-value pairs, where the key is the name of the custom field. An actual JSON object described by this might look like this:
The data stored in the custom fields will be inserted in the text message template by replacing the placeholder | |
scheduledDate | string <date-time> If you want to schedule the Viber message at a later date. The date provided must be in format YYYY-MM-DD HH:MM:SS (Eg. 2021-06-23 14:26:10). By default, the date and time in this parameter is treated as |
isUtc | boolean Default: true If set to |
dlrCallbackUrl | string <url> A valid URL to receive the delivery report update for the sent Viber. If this parameter is set, it will overwrite the setting from Admin Dashboard > HTTP API > Oauth2 > Application settings |
shortResponse | boolean Default: false If set to |
noTextDetails | boolean Default: false The response will not have the parameters |
showTimezone | boolean Default: false Shows the parameter |
Responses
Request samples
- Payload
- Shell + Curl
- Python + Requests
- Java + Okhttp
- Node + Native
- Javascript + Xhr
- Php + Curl
- Go + Native
- Ruby + Native
- Csharp + Restsharp
{- "groups": [
- 18,
- 20
], - "from": "InfoText",
- "templateId": 17
}
Response samples
- 200
- 400
- 401
- 403
- 405
- 429
- 500
{- "info": {
- "campaignId": "e8c66a4a-8199-4e1c-9d6b-006264e748a4",
- "totalPhoneNumbers": 16,
- "totalValid": 15,
- "totalInvalid": 1,
- "duplicatesRemoved": 1,
- "totalCost": 0.315,
- "totalParts": 15,
- "phoneNumbersByCountry": {
- "FR": 1,
- "AT": 1,
- "CH": 8,
- "PT": 1,
- "DE": 2,
- "CZ": 2
}, - "groups": [
- {
- "id": 18,
- "name": "My new group",
- "phoneNumbers": 6
}, - {
- "id": 20,
- "name": "Contacts 2021",
- "phoneNumbers": 10
}
], - "invalid": [ ],
- "scheduled": false
}, - "data": [
- {
- "msgId": "0d6e306f-f0c4-4842-87dc-f9656e822699",
- "status": "ACCEPTED",
- "statusCode": 0,
- "inQuietHours": false,
- "createdAt": "2021-07-25 16:17:51",
- "cost": 0.021,
- "to": "+33612970283",
- "countryIso": "FR",
- "from": "InfoText",
- "text": "Hi Aubert. Redeem this voucher in the next 30 days to get a 30% discount off all Summer Fashion https://en.ax/l9rG/2XHZ",
- "parts": 1
}, - {
- "msgId": "03308c5b-5cb2-446b-844c-a76eb4c8e0ba",
- "status": "ACCEPTED",
- "statusCode": 0,
- "inQuietHours": false,
- "createdAt": "2021-07-25 16:17:51",
- "cost": 0.021,
- "to": "+43664187834",
- "countryIso": "AT",
- "from": "InfoText",
- "text": "Hi Uwe. Redeem this voucher in the next 30 days to get a 30% discount off all Summer Fashion https://en.ax/l9rG/0JyO",
- "parts": 1
}, - {
- "msgId": "c1f6b519-f62f-4cff-bdb5-696184989804",
- "status": "ACCEPTED",
- "statusCode": 0,
- "inQuietHours": false,
- "createdAt": "2021-07-25 16:17:51",
- "cost": 0.021,
- "to": "+41781218472",
- "countryIso": "CH",
- "from": "InfoText",
- "text": "Hi Martin. Redeem this voucher in the next 30 days to get a 30% discount off all Summer Fashion https://en.ax/l9rG/tC4l",
- "parts": 1
}, - {
- "msgId": "5bc9f294-ad7d-4129-b9d7-fe8b40290d87",
- "status": "ACCEPTED",
- "statusCode": 0,
- "inQuietHours": false,
- "createdAt": "2021-07-25 16:17:51",
- "cost": 0.021,
- "to": "+351912110421",
- "countryIso": "PT",
- "from": "InfoText",
- "text": "Hi Guilherme. Redeem this voucher in the next 30 days to get a 30% discount off all Summer Fashion https://en.ax/l9rG/n8RT",
- "parts": 1
}, - {
- "msgId": "23398863-08aa-4b56-92fc-7648687f2e37",
- "status": "ACCEPTED",
- "statusCode": 0,
- "inQuietHours": false,
- "createdAt": "2021-07-25 16:17:51",
- "cost": 0.021,
- "to": "+4915123473140",
- "countryIso": "DE",
- "from": "InfoText",
- "text": "Hi Tom. Redeem this voucher in the next 30 days to get a 30% discount off all Summer Fashion https://en.ax/l9rG/qBR0",
- "parts": 1
}, - {
- "msgId": "15263c4f-04a4-46d4-9dc5-7367a376cfcc",
- "status": "ACCEPTED",
- "statusCode": 0,
- "inQuietHours": false,
- "createdAt": "2021-07-25 16:17:51",
- "cost": 0.021,
- "to": "+4915123966046",
- "countryIso": "DE",
- "from": "InfoText",
- "text": "Hi Christina. Redeem this voucher in the next 30 days to get a 30% discount off all Summer Fashion https://en.ax/l9rG/sZyS",
- "parts": 1
}, - {
- "msgId": "de651429-b384-49b9-9b9b-0b897683cf1d",
- "status": "ACCEPTED",
- "statusCode": 0,
- "inQuietHours": false,
- "createdAt": "2021-07-25 16:17:51",
- "cost": 0.021,
- "to": "+41781981881",
- "countryIso": "CH",
- "from": "InfoText",
- "text": "Hi . Redeem this voucher in the next 30 days to get a 30% discount off all Summer Fashion https://en.ax/l9rG/YoIT",
- "parts": 1
}, - {
- "msgId": "8617c40e-df66-4fc1-907d-76269ed1019a",
- "status": "ACCEPTED",
- "statusCode": 0,
- "inQuietHours": false,
- "createdAt": "2021-07-25 16:17:51",
- "cost": 0.021,
- "to": "+41781171055",
- "countryIso": "CH",
- "from": "InfoText",
- "text": "Hi . Redeem this voucher in the next 30 days to get a 30% discount off all Summer Fashion https://en.ax/l9rG/OZQ9",
- "parts": 1
}, - {
- "msgId": "a76d0a7d-2ba2-4015-95ad-b86b1cbb2cba",
- "status": "ACCEPTED",
- "statusCode": 0,
- "inQuietHours": false,
- "createdAt": "2021-07-25 16:17:51",
- "cost": 0.021,
- "to": "+420601536594",
- "countryIso": "CZ",
- "from": "InfoText",
- "text": "Hi . Redeem this voucher in the next 30 days to get a 30% discount off all Summer Fashion https://en.ax/l9rG/8KD3",
- "parts": 1
}, - {
- "msgId": "17b2a98d-e209-42f4-b783-576481c1679d",
- "status": "ACCEPTED",
- "statusCode": 0,
- "inQuietHours": false,
- "createdAt": "2021-07-25 16:17:51",
- "cost": 0.021,
- "to": "+41781168358",
- "countryIso": "CH",
- "from": "InfoText",
- "text": "Hi . Redeem this voucher in the next 30 days to get a 30% discount off all Summer Fashion https://en.ax/l9rG/I4Wl",
- "parts": 1
}, - {
- "msgId": "70e2b4ea-a97f-47b7-b0bf-d2e6a0243260",
- "status": "ACCEPTED",
- "statusCode": 0,
- "inQuietHours": false,
- "createdAt": "2021-07-25 16:17:51",
- "cost": 0.021,
- "to": "+41781703382",
- "countryIso": "CH",
- "from": "InfoText",
- "text": "Hi . Redeem this voucher in the next 30 days to get a 30% discount off all Summer Fashion https://en.ax/l9rG/lJKu",
- "parts": 1
}, - {
- "msgId": "97c7833c-ff70-49ef-9e9f-f463ff6072d0",
- "status": "ACCEPTED",
- "statusCode": 0,
- "inQuietHours": false,
- "createdAt": "2021-07-25 16:17:51",
- "cost": 0.021,
- "to": "+41781759743",
- "countryIso": "CH",
- "from": "InfoText",
- "text": "Hi . Redeem this voucher in the next 30 days to get a 30% discount off all Summer Fashion https://en.ax/l9rG/gH2S",
- "parts": 1
}, - {
- "msgId": "88494cfd-bcd1-4f1e-b3ab-34af446f65c9",
- "status": "ACCEPTED",
- "statusCode": 0,
- "inQuietHours": false,
- "createdAt": "2021-07-25 16:17:51",
- "cost": 0.021,
- "to": "+41781281059",
- "countryIso": "CH",
- "from": "InfoText",
- "text": "Hi . Redeem this voucher in the next 30 days to get a 30% discount off all Summer Fashion https://en.ax/l9rG/nXUz",
- "parts": 1
}, - {
- "msgId": "5cc2be11-dca5-4130-826f-b6f393d1e43c",
- "status": "ACCEPTED",
- "statusCode": 0,
- "inQuietHours": false,
- "createdAt": "2021-07-25 16:17:51",
- "cost": 0.021,
- "to": "+420601137073",
- "countryIso": "CZ",
- "from": "InfoText",
- "text": "Hi . Redeem this voucher in the next 30 days to get a 30% discount off all Summer Fashion https://en.ax/l9rG/N8GQ",
- "parts": 1
}, - {
- "msgId": "56b8f795-7b03-41bf-b1e7-fb8d3f5e75cc",
- "status": "ACCEPTED",
- "statusCode": 0,
- "inQuietHours": false,
- "createdAt": "2021-07-25 16:17:51",
- "cost": 0.021,
- "to": "+41781353741",
- "countryIso": "CH",
- "from": "InfoText",
- "text": "Hi . Redeem this voucher in the next 30 days to get a 30% discount off all Summer Fashion https://en.ax/l9rG/gx65",
- "parts": 1
}
]
}
Delete scheduled Viber message
Delete a scheduled Viber message by providing a valid identifier (msgId
).
The cost of the deleted scheduled Viber message will be returned to the balance of the account.
Errors for DELETE /viber/scheduled/{msgId}
HTTP code | Error code | Type | Description |
---|---|---|---|
403 | 1118 | access_denied | Only scheduled campaigns/messages can be deleted |
404 | 1100 | not_found | Message ID provided was not found or is not scheduled |
400 | 1115 | invalid_param | Message ID provided is not valid |
Authorizations:
path Parameters
msgId required | string <uuid> 36 characters ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]... Example: 3328fe13-2b99-4282-b62e-d891f5e452a8 Identifier of a scheduled Viber message |
Responses
Request samples
- Shell + Curl
- Python + Requests
- Java + Okhttp
- Node + Native
- Javascript + Xhr
- Php + Curl
- Go + Native
- Ruby + Native
- Csharp + Restsharp
curl --request DELETE \ --url https://api.sms.cx/viber/scheduled/3328fe13-2b99-4282-b62e-d891f5e452a8 \ --header 'Authorization: Bearer REPLACE_ACCESS_TOKEN'
Response samples
- 200
- 400
- 401
- 403
- 404
- 405
- 429
- 500
{- "info": {
- "msgId": "7afc7f14-842d-41e0-9f8b-f8e38b4a8708",
- "parts": 1,
- "creditReturned": 0.026,
- "channel": "viber"
}
}
Delete scheduled Viber campaign
Delete a scheduled Viber campaign by providing a valid identifier (campaignId
).
The cost of the deleted scheduled Viber campaign will be returned to the balance of the account.
If part of the Viber campaign has already started, only scheduled messages will be deleted. Messages already sent cannot be deleted.
Errors for DELETE /viber/scheduled/campaign/{campaignId}
HTTP code | Error code | Type | Description |
---|---|---|---|
403 | 1118 | access_denied | Only scheduled campaigns/messages can be deleted |
404 | 1150 | not_found | Campaign ID provided was not found or is not scheduled |
400 | 1155 | invalid_param | Campaign ID provided is not valid |
Authorizations:
path Parameters
campaignId required | string <uuid> 36 characters ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]... Example: cbb72a72-0dfa-4288-b3d0-05fab904f0b2 Identifier of a scheduled Viber campaign |
Responses
Request samples
- Shell + Curl
- Python + Requests
- Java + Okhttp
- Node + Native
- Javascript + Xhr
- Php + Curl
- Go + Native
- Ruby + Native
- Csharp + Restsharp
curl --request DELETE \ --url https://api.sms.cx/viber/scheduled/campaign/cbb72a72-0dfa-4288-b3d0-05fab904f0b2 \ --header 'Authorization: Bearer REPLACE_ACCESS_TOKEN'
Response samples
- 200
- 400
- 401
- 403
- 404
- 405
- 429
- 500
{- "info": {
- "campaignId": "850c530d-49c7-4846-b366-8eb077f3e98a",
- "totalPhoneNumbers": 3515,
- "totalParts": 3515,
- "phoneNumbersDeleted": 3515,
- "partsDeleted": 3515,
- "creditReturned": 73.815,
- "channel": "viber"
}
}
Send Whatsapp message
Sends Whatsapp message to a single phone number or to a list of phone numbers.
Note: This endpoint accepts idempotent requests by providing an additional
idempotencyId
parameter in body with a unique value generated by the client of type UUID v1-v5. To confirm that the server understood the request, the response will contain the headerX-Idempotency-Id
with your unique value. By using idempotency you can retry requests in case of network error or server not responding in time, without accidentally performing the same operation twice and have a guarantee of not being billed twice.
Errors for POST /whatsapp
HTTP code | Error code | Type | Description |
---|---|---|---|
400 | 1104 | invalid_param | The parameter to is empty or not set |
400 | 1105 | invalid_param | The parameter from is empty or not set |
400 | 1108 | invalid_param | The parameter scheduledDate is not a valid date |
400 | 1109 | invalid_param | The parameter dlrCallbackUrl is not a valid URL |
400 | 1111 | invalid_param | Idempotency Id provided is not a valid UUID (v1-v5) |
400 | 1112 | invalid_param | The shortlink/attachment ID provided for tracking is invalid or not found |
400 | 1116 | invalid_param | The scheduled date is in the past |
400 | 1103 | invalid_param | The phone numbers array is too big (max. allowed: 25000 numbers) |
400 | 1207 | invalid_param | The phone number provided is not valid |
400 | 1210 | invalid_param | The phone numbers provided are invalid |
403 | 1119 | no_coverage | No coverage or restricted destination |
400 | 1113 | insufficient_credit | Insufficient credit |
400 | 1114 | insufficient_credit | Credit limit reached. To increase the credit limit, please contact your account manager |
400 | 1126 | invalid_param | The parameter templateId is not set |
400 | 1127 | invalid_param | The parameter templateId is not valid |
400 | 1128 | invalid_param | The template ID provided is not a valid template |
403 | 1132 | access_denied | The template ID provided is not approved |
403 | 1133 | access_denied | The template ID provided is not locked |
Authorizations:
Request Body schema: application/json
to required | Array of strings A string with single phone number or an array of phone numbers in international E.164 format or national format. If national format is provided, for better validation you must use the parameter |
from required | string [ 3 .. 15 ] characters The originator (sender name) of the text message (min 3, max 15 characters). If the originator used in this value is not approved, it will be overwritten by a default system originator (eg. InfoText). Read more about sender names |
templateId required | integer <int32> Identifier of the approved Whatsapp template |
object (CustomFields) An object with key-value pairs, where the key is the name of the custom field. An actual JSON object described by this might look like this:
The data stored in the custom fields will be inserted in the text message template by replacing the placeholder | |
countryIso | string 2 characters Country ISO (two-letter) of the destination phone numbers (if provided in national format). Please note that if an international E.164 phone number format is provided in the |
allowInvalid | boolean Default: false By default an error will be thrown if any invalid numbers are detected in the |
scheduledDate | string <date-time> If you want to schedule the Whatsapp message at a later date. The date provided must be in format YYYY-MM-DD HH:MM:SS (Eg. 2021-06-23 14:26:10). By default, the date and time in this parameter is treated as |
isUtc | boolean Default: true If set to |
dlrCallbackUrl | string <url> A valid URL to receive the delivery report update for the sent Whatsapp message. If this parameter is set, it will overwrite the setting from Admin Dashboard > HTTP API > Oauth2 > Application settings |
trackData | string <uuid> 36 characters ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]... Allows to track messages a client provided ID. The |
shortResponse | boolean Default: false If set to |
noTextDetails | boolean Default: false The response will not have the parameters |
showTimezone | boolean Default: false Shows the parameter |
idempotencyId | string <uuid> 36 characters ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]... A unique idempotency id generated by the client. For more information, refer to Idempotent requests. The API will return an error if the value provided is not a valid UUID (v1-v5) |
Responses
Request samples
- Payload
- Shell + Curl
- Python + Requests
- Java + Okhttp
- Node + Native
- Javascript + Xhr
- Php + Curl
- Go + Native
- Ruby + Native
- Csharp + Restsharp
{- "to": [
- "+31612469333"
], - "from": "InfoText",
- "templateId": 19,
- "customFields": {
- "client_name": "Mike",
- "anotherCustomField": "10059"
}
}
Response samples
- 200
- 400
- 401
- 403
- 405
- 429
- 500
{- "info": {
- "campaignId": "0fcdb3dc-4a1e-4ef4-9b28-071f0b58d275",
- "totalPhoneNumbers": 1,
- "totalValid": 1,
- "totalInvalid": 0,
- "totalCost": 0.026,
- "totalParts": 1,
- "phoneNumbersByCountry": {
- "NL": 1
}, - "invalid": [ ],
- "scheduled": false
}, - "data": [
- {
- "msgId": "413b021d-3bd6-4320-b2d2-f1693f2dc12b",
- "status": "ACCEPTED",
- "statusCode": 0,
- "inQuietHours": false,
- "createdAt": "2021-07-12 12:11:06",
- "cost": 0.026,
- "to": "+31612469333",
- "countryIso": "NL",
- "from": "InfoText",
- "text": "Hello Mike, your order 10059 has been delivered to courier company.",
- "parts": 1
}
]
}
Estimate Whatsapp message
Estimate the cost of sending a Whatsapp message.
This endpoint is identical to /whatsapp
endpoint, but it will only simulate the Whatsapp sending (no billing).
The request body and the response are the same as for /whatsapp
endpoint.
Errors for POST /whatsapp/estimate
HTTP code | Error code | Type | Description |
---|---|---|---|
400 | 1104 | invalid_param | The parameter to is empty or not set |
400 | 1105 | invalid_param | The parameter from is empty or not set |
400 | 1108 | invalid_param | The parameter scheduledDate is not a valid date |
400 | 1109 | invalid_param | The parameter dlrCallbackUrl is not a valid URL |
400 | 1112 | invalid_param | The shortlink/attachment ID provided for tracking is invalid or not found |
400 | 1116 | invalid_param | The scheduled date is in the past |
400 | 1103 | invalid_param | The phone numbers array is too big (max. allowed: 25000 numbers) |
400 | 1207 | invalid_param | The phone number provided is not valid |
400 | 1210 | invalid_param | The phone numbers provided are invalid |
403 | 1119 | no_coverage | No coverage or restricted destination |
400 | 1113 | insufficient_credit | Insufficient credit |
400 | 1114 | insufficient_credit | Credit limit reached. To increase the credit limit, please contact your account manager |
400 | 1126 | invalid_param | The parameter templateId is not set |
400 | 1127 | invalid_param | The parameter templateId is not valid |
400 | 1128 | invalid_param | The template ID provided is not a valid template |
403 | 1132 | access_denied | The template ID provided is not approved |
403 | 1133 | access_denied | The template ID provided is not locked |
Authorizations:
Request Body schema: application/json
to required | Array of strings A string with single phone number or an array of phone numbers in international E.164 format or national format. If national format is provided, for better validation you must use the parameter |
from required | string [ 3 .. 15 ] characters The originator (sender name) of the text message (min 3, max 15 characters). If the originator used in this value is not approved, it will be overwritten by a default system originator (eg. InfoText). Read more about sender names |
templateId required | integer <int32> Identifier of the approved Viber template |
object (CustomFields) An object with key-value pairs, where the key is the name of the custom field. An actual JSON object described by this might look like this:
The data stored in the custom fields will be inserted in the text message template by replacing the placeholder | |
countryIso | string 2 characters Country ISO (two-letter) of the destination phone numbers (if provided in national format). Please note that if an international E.164 phone number format is provided in the |
allowInvalid | boolean Default: false By default an error will be thrown if any invalid numbers are detected in the |
scheduledDate | string <date-time> If you want to schedule the Whatsapp message at a later date. The date provided must be in format YYYY-MM-DD HH:MM:SS (Eg. 2021-06-23 14:26:10). By default, the date and time in this parameter is treated as |
isUtc | boolean Default: true If set to |
dlrCallbackUrl | string <url> A valid URL to receive the delivery report update for the sent Whatsapp message. If this parameter is set, it will overwrite the setting from Admin Dashboard > HTTP API > Oauth2 > Application settings |
trackData | string <uuid> 36 characters ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]... Allows to track messages a client provided ID. The |
shortResponse | boolean Default: false If set to |
noTextDetails | boolean Default: false The response will not have the parameters |
showTimezone | boolean Default: false Shows the parameter |
Responses
Request samples
- Payload
- Shell + Curl
- Python + Requests
- Java + Okhttp
- Node + Native
- Javascript + Xhr
- Php + Curl
- Go + Native
- Ruby + Native
- Csharp + Restsharp
{- "to": [
- "+31612469333",
- "+34612934161",
- "+3361611862",
- "+34612934161",
- "+447400790504",
- "+4915123438636",
- "+3361611862"
], - "from": "InfoText",
- "templateId": 19,
- "allowInvalid": true
}
Response samples
- 200
- 400
- 401
- 403
- 405
- 429
- 500
{- "info": {
- "campaignId": "fe23130c-03c3-4180-9792-0c48c853d669",
- "totalPhoneNumbers": 7,
- "totalValid": 5,
- "totalInvalid": 2,
- "totalCost": 0.13,
- "totalParts": 5,
- "phoneNumbersByCountry": {
- "NL": 1,
- "ES": 2,
- "GB": 1,
- "DE": 1
}, - "invalid": [
- "+3361611862",
- "+3361611862"
], - "scheduled": false
}, - "data": [
- {
- "msgId": "4673e26d-5df6-4d15-98c3-958cf2b31a61",
- "status": "ACCEPTED",
- "statusCode": 0,
- "inQuietHours": false,
- "createdAt": "2021-07-25 16:28:28",
- "cost": 0.026,
- "to": "+31612469333",
- "countryIso": "NL",
- "from": "InfoText",
- "text": "Redeem this voucher in the next 30 days to get a 30% discount off all Summer Fashion",
- "parts": 1
}, - {
- "msgId": "9d55475d-81ab-4348-a9ef-0553f7b290f7",
- "status": "ACCEPTED",
- "statusCode": 0,
- "inQuietHours": false,
- "createdAt": "2021-07-25 16:28:28",
- "cost": 0.026,
- "to": "+34612934161",
- "countryIso": "ES",
- "from": "InfoText",
- "text": "Redeem this voucher in the next 30 days to get a 30% discount off all Summer Fashion",
- "parts": 1
}, - {
- "msgId": "811d7096-e3d3-4704-b8b5-12f6b0dd85d2",
- "status": "ACCEPTED",
- "statusCode": 0,
- "inQuietHours": false,
- "createdAt": "2021-07-25 16:28:28",
- "cost": 0.026,
- "to": "+34612934161",
- "countryIso": "ES",
- "from": "InfoText",
- "text": "Redeem this voucher in the next 30 days to get a 30% discount off all Summer Fashion",
- "parts": 1
}, - {
- "msgId": "cf284925-8aae-4366-aacb-2a45003eb491",
- "status": "ACCEPTED",
- "statusCode": 0,
- "inQuietHours": false,
- "createdAt": "2021-07-25 16:28:28",
- "cost": 0.026,
- "to": "+447400790504",
- "countryIso": "GB",
- "from": "InfoText",
- "text": "Redeem this voucher in the next 30 days to get a 30% discount off all Summer Fashion",
- "parts": 1
}, - {
- "msgId": "227742bf-1aaf-444a-8443-1f9cc18bef12",
- "status": "ACCEPTED",
- "statusCode": 0,
- "inQuietHours": false,
- "createdAt": "2021-07-25 16:28:28",
- "cost": 0.026,
- "to": "+4915123438636",
- "countryIso": "DE",
- "from": "InfoText",
- "text": "Redeem this voucher in the next 30 days to get a 30% discount off all Summer Fashion",
- "parts": 1
}
]
}
Delete scheduled Whatsapp message
Delete a scheduled Whatsapp message by providing a valid identifier (msgId
).
The cost of the deleted scheduled Whatsapp message will be returned to the balance of the account.
Errors for DELETE /whatsapp/scheduled/{msgId}
HTTP code | Error code | Type | Description |
---|---|---|---|
403 | 1118 | access_denied | Only scheduled campaigns/messages can be deleted |
404 | 1100 | not_found | Message ID provided was not found or is not scheduled |
400 | 1115 | invalid_param | Message ID provided is not valid |
Authorizations:
path Parameters
msgId required | string <uuid> 36 characters ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]... Example: 3328fe13-2b99-4282-b62e-d891f5e452a8 Identifier of a scheduled Whatsapp message |
Responses
Request samples
- Shell + Curl
- Python + Requests
- Java + Okhttp
- Node + Native
- Javascript + Xhr
- Php + Curl
- Go + Native
- Ruby + Native
- Csharp + Restsharp
curl --request DELETE \ --url https://api.sms.cx/whatsapp/scheduled/3328fe13-2b99-4282-b62e-d891f5e452a8 \ --header 'Authorization: Bearer REPLACE_ACCESS_TOKEN'
Response samples
- 200
- 400
- 401
- 403
- 404
- 405
- 429
- 500
{- "info": {
- "msgId": "e7b457c1-517a-4c4d-b1ec-c4ce6038792f",
- "parts": 1,
- "creditReturned": 0.026,
- "channel": "whatsapp"
}
}
Send Multichannel message
Sends Multichannel message to a single phone number or to a list of phone numbers.
This endpoint was designed to handle big data objects (up to 25.000 Multichannel messages in one request).
If you have loops or iterations we recommend building the send object in your application, and make a single request to this endpoint. The time of making the requests will decrease - by doing a single request with multiple send objects vs making requests in a loop - and you won't have to worry about making concurrent API calls.
Note: This endpoint accepts idempotent requests by providing an additional
idempotencyId
parameter in body with a unique value generated by the client of type UUID v1-v5. To confirm that the server understood the request, the response will contain the headerX-Idempotency-Id
with your unique value. By using idempotency you can retry requests in case of network error or server not responding in time, without accidentally performing the same operation twice and have a guarantee of not being billed twice.
Errors for POST /multichannel
HTTP code | Error code | Type | Description |
---|---|---|---|
400 | 1104 | invalid_param | The parameter to is empty or not set |
400 | 1105 | invalid_param | The parameter from is empty or not set |
400 | 1106 | invalid_param | The parameter from is not valid (min 3, max 11 characters) |
400 | 1107 | invalid_param | The parameter text is empty or not set |
400 | 1108 | invalid_param | The parameter scheduledDate is not a valid date |
400 | 1109 | invalid_param | The parameter dlrCallbackUrl is not a valid URL |
400 | 1111 | invalid_param | Idempotency Id provided is not a valid UUID (v1-v5) |
400 | 1112 | invalid_param | The shortlink/attachment ID provided for tracking is invalid or not found |
400 | 1116 | invalid_param | The scheduled date is in the past |
400 | 1103 | invalid_param | The phone numbers array is too big (max. allowed: 25000 numbers) |
400 | 1207 | invalid_param | The phone number provided is not valid |
400 | 1210 | invalid_param | The phone numbers provided are invalid |
403 | 1119 | no_coverage | No coverage or restricted destination |
400 | 1113 | insufficient_credit | Insufficient credit |
400 | 1114 | insufficient_credit | Credit limit reached. To increase the credit limit, please contact your account manager |
400 | 1130 | insufficient_credit | Insufficient credit for failover sending |
400 | 1124 | invalid_param | The parameter ttl is not a number |
400 | 1125 | invalid_param | Min value for ttl is 300 seconds |
400 | 1134 | invalid_param | Max value for ttl is 1209600 seconds (14 days) |
400 | 1120 | invalid_param | The parameter strategy is empty or not set |
400 | 1121 | invalid_param | The parameter strategy must have at least two channels |
400 | 1122 | invalid_param | The parameter strategy must have channel sms as last element |
400 | 1129 | invalid_param | The parameter strategy contains duplicate channels |
400 | 1123 | invalid_param | The parameter channel is not valid. Allowed values: |
403 | 1131 | access_denied | The strategy contains channels that are not active: |
400 | 1126 | invalid_param | The parameter templateId is not set |
400 | 1127 | invalid_param | The parameter templateId is not valid |
400 | 1128 | invalid_param | The template ID provided is not a valid template |
403 | 1132 | access_denied | The template ID provided is not approved |
403 | 1133 | access_denied | The template ID provided is not locked |
Authorizations:
Request Body schema: application/json
to required | Array of strings A string with single phone number or an array of phone numbers in international E.164 format or national format. If national format is provided, for better validation you must use the parameter |
from required | string [ 3 .. 15 ] characters The originator (sender name) of the text message (min 3, max 11 characters). If the originator used in this value is not approved, it will be overwritten by a default system originator (eg. InfoText). Read more about sender names |
required | Array of objects (Strategy) An array of objects, in the order of sending. The API will try sending the message with the first channel in the strategy. If the delivery failed (Eg. Viber not installed, |
ttl | integer <int32> Default: 300 The time to live (ttl) defines the time in seconds that a channel has to deliver the message to the destination. After the time to live has expired and no |
countryIso | string 2 characters Country ISO (two-letter) of the destination phone numbers (if provided in national format). Please note that if an international E.164 phone number format is provided in the |
allowInvalid | boolean Default: false By default an error will be thrown if any invalid numbers are detected in the |
scheduledDate | string <date-time> If you want to schedule the Multichannel message at a later date. The date provided must be in format YYYY-MM-DD HH:MM:SS (Eg. 2021-06-23 14:26:10). By default, the date and time in this parameter is treated as |
isUtc | boolean Default: true If set to |
dlrCallbackUrl | string <url> A valid URL to receive the delivery report update for the sent Multichannel message. If this parameter is set, it will overwrite the setting from Admin Dashboard > HTTP API > Oauth2 > Application settings |
trackData | string <uuid> 36 characters ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]... Allows to track messages a client provided ID. The |
shortResponse | boolean Default: false If set to |
noTextDetails | boolean Default: false The response will not have the parameters |
showTimezone | boolean Default: false Shows the parameter |
idempotencyId | string <uuid> 36 characters ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]... A unique idempotency id generated by the client. For more information, refer to Idempotent requests. The API will return an error if the value provided is not a valid UUID (v1-v5) |
Responses
Request samples
- Payload
- Shell + Curl
- Python + Requests
- Java + Okhttp
- Node + Native
- Javascript + Xhr
- Php + Curl
- Go + Native
- Ruby + Native
- Csharp + Restsharp
{- "to": [
- "+31612469333",
- "+34612934161",
- "+3361611862",
- "+34612934161",
- "+447400790504",
- "+4915123438636",
- "+3361611862"
], - "from": "InfoText",
- "strategy": [
- {
- "channel": "viber",
- "templateId": 15
}, - {
- "channel": "sms",
- "text": "This is the last failover text message"
}
], - "ttl": 300,
- "allowInvalid": true,
}
Response samples
- 200
- 400
- 401
- 403
- 405
- 429
- 500
{- "info": {
- "campaignId": "69ed776b-d089-4aed-b7b6-db95b4e6c239",
- "totalPhoneNumbers": 7,
- "totalValid": 5,
- "totalInvalid": 2,
- "totalCost": 0.13,
- "totalParts": 5,
- "phoneNumbersByCountry": {
- "NL": 1,
- "ES": 2,
- "GB": 1,
- "DE": 1
}, - "invalid": [
- "+3361611862",
- "+3361611862"
], - "scheduled": false
}, - "data": [
- {
- "msgId": "60de8fd2-0bb9-4d50-ab58-0e25396b7d80",
- "status": "ACCEPTED",
- "statusCode": 0,
- "inQuietHours": false,
- "createdAt": "2021-07-12 14:40:35",
- "cost": 0.026,
- "to": "+31612469333",
- "countryIso": "NL",
- "from": "InfoText",
- "text": "Your order has been haned over to courier company.",
- "parts": 1,
- "channel": "viber"
}, - {
- "msgId": "7f457e47-fffc-49b0-b05e-d60bce20a1b2",
- "status": "ACCEPTED",
- "statusCode": 0,
- "inQuietHours": false,
- "createdAt": "2021-07-12 14:40:35",
- "cost": 0.026,
- "to": "+34612934161",
- "countryIso": "ES",
- "from": "InfoText",
- "text": "Your order has been haned over to courier company.",
- "parts": 1,
- "channel": "viber"
}, - {
- "msgId": "a2a84bdd-7319-453d-bd07-f4ba01fc883b",
- "status": "ACCEPTED",
- "statusCode": 0,
- "inQuietHours": false,
- "createdAt": "2021-07-12 14:40:35",
- "cost": 0.026,
- "to": "+34612934161",
- "countryIso": "ES",
- "from": "InfoText",
- "text": "Your order has been haned over to courier company.",
- "parts": 1,
- "channel": "viber"
}, - {
- "msgId": "35f79ea3-73cd-4084-9441-1d44851d0a5c",
- "status": "ACCEPTED",
- "statusCode": 0,
- "inQuietHours": false,
- "createdAt": "2021-07-12 14:40:35",
- "cost": 0.026,
- "to": "+447400790504",
- "countryIso": "GB",
- "from": "InfoText",
- "text": "Your order has been haned over to courier company.",
- "parts": 1,
- "channel": "viber"
}, - {
- "msgId": "98b0ff8c-dad2-4515-918b-d5c982c29475",
- "status": "ACCEPTED",
- "statusCode": 0,
- "inQuietHours": false,
- "createdAt": "2021-07-12 14:40:35",
- "cost": 0.026,
- "to": "+4915123438636",
- "countryIso": "DE",
- "from": "InfoText",
- "text": "Your order has been haned over to courier company.",
- "parts": 1,
- "channel": "viber"
}
]
}
Estimate Multichannel message
Estimate the cost of sending a Multichannel message.
This endpoint is identical to /multichannel
endpoint, but it will only simulate the Multichannel sending (no billing).
The request body and the response are the same as for /multichannel
endpoint.
Errors for POST /multichannel/estimate
HTTP code | Error code | Type | Description |
---|---|---|---|
400 | 1104 | invalid_param | The parameter to is empty or not set |
400 | 1105 | invalid_param | The parameter from is empty or not set |
400 | 1106 | invalid_param | The parameter from is not valid (min 3, max 11 characters) |
400 | 1107 | invalid_param | The parameter text is empty or not set |
400 | 1108 | invalid_param | The parameter scheduledDate is not a valid date |
400 | 1109 | invalid_param | The parameter dlrCallbackUrl is not a valid URL |
400 | 1112 | invalid_param | The shortlink/attachment ID provided for tracking is invalid or not found |
400 | 1116 | invalid_param | The scheduled date is in the past |
400 | 1103 | invalid_param | The phone numbers array is too big (max. allowed: 25000 numbers) |
400 | 1207 | invalid_param | The phone number provided is not valid |
400 | 1210 | invalid_param | The phone numbers provided are invalid |
403 | 1119 | no_coverage | No coverage or restricted destination |
400 | 1113 | insufficient_credit | Insufficient credit |
400 | 1114 | insufficient_credit | Credit limit reached. To increase the credit limit, please contact your account manager |
400 | 1130 | insufficient_credit | Insufficient credit for failover sending |
400 | 1124 | invalid_param | The parameter ttl is not a number |
400 | 1125 | invalid_param | Min value for ttl is 300 seconds |
400 | 1134 | invalid_param | Max value for ttl is 1209600 seconds (14 days) |
400 | 1120 | invalid_param | The parameter strategy is empty or not set |
400 | 1121 | invalid_param | The parameter strategy must have at least two channels |
400 | 1122 | invalid_param | The parameter strategy must have channel sms as last element |
400 | 1129 | invalid_param | The parameter strategy contains duplicate channels |
400 | 1123 | invalid_param | The parameter channel is not valid. Allowed values: |
403 | 1131 | access_denied | The strategy contains channels that are not active: |
400 | 1126 | invalid_param | The parameter templateId is not set |
400 | 1127 | invalid_param | The parameter templateId is not valid |
400 | 1128 | invalid_param | The template ID provided is not a valid template |
403 | 1132 | access_denied | The template ID provided is not approved |
403 | 1133 | access_denied | The template ID provided is not locked |
Authorizations:
Request Body schema: application/json
to required | Array of strings A string with single phone number or an array of phone numbers in international E.164 format or national format. If national format is provided, for better validation you must use the parameter |
from required | string [ 3 .. 15 ] characters The originator (sender name) of the text message (min 3, max 11 characters). If the originator used in this value is not approved, it will be overwritten by a default system originator (eg. InfoText). Read more about sender names |
required | Array of objects (Strategy) An array of objects, in the order of sending. The API will try sending the message with the first channel in the strategy. If the delivery failed (Eg. Viber not installed, |
ttl | integer <int32> Default: 300 The time to live (ttl) defines the time in seconds that a channel has to deliver the message to the destination. After the time to live has expired and no |
countryIso | string 2 characters Country ISO (two-letter) of the destination phone numbers (if provided in national format). Please note that if an international E.164 phone number format is provided in the |
allowInvalid | boolean Default: false By default an error will be thrown if any invalid numbers are detected in the |
scheduledDate | string <date-time> If you want to schedule the Multichannel message at a later date. The date provided must be in format YYYY-MM-DD HH:MM:SS (Eg. 2021-06-23 14:26:10). By default, the date and time in this parameter is treated as |
isUtc | boolean Default: true If set to |
dlrCallbackUrl | string <url> A valid URL to receive the delivery report update for the sent Multichannel message. If this parameter is set, it will overwrite the setting from Admin Dashboard > HTTP API > Oauth2 > Application settings |
trackData | string <uuid> 36 characters ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]... Allows to track messages a client provided ID. The |
shortResponse | boolean Default: false If set to |
noTextDetails | boolean Default: false The response will not have the parameters |
showTimezone | boolean Default: false Shows the parameter |
Responses
Request samples
- Payload
- Shell + Curl
- Python + Requests
- Java + Okhttp
- Node + Native
- Javascript + Xhr
- Php + Curl
- Go + Native
- Ruby + Native
- Csharp + Restsharp
{- "to": [
- "+31612469333",
- "+34612934161",
- "+3361611862",
- "+34612934161",
- "+447400790504",
- "+4915123438636",
- "+3361611862"
], - "from": "InfoText",
- "strategy": [
- {
- "channel": "viber",
- "templateId": 15
}, - {
- "channel": "whatsapp",
- "templateId": 19
}, - {
- "channel": "sms",
- "text": "This is the last failover text message"
}
], - "ttl": 300,
- "allowInvalid": true,
}
Response samples
- 200
- 400
- 401
- 403
- 405
- 429
- 500
{- "info": {
- "campaignId": "7e3f6d10-b296-45da-aedd-124cf499f2ad",
- "totalPhoneNumbers": 7,
- "totalValid": 5,
- "totalInvalid": 2,
- "totalCost": 0.13,
- "totalParts": 5,
- "phoneNumbersByCountry": {
- "NL": 1,
- "ES": 2,
- "GB": 1,
- "DE": 1
}, - "invalid": [
- "+3361611862",
- "+3361611862"
], - "scheduled": false
}, - "data": [
- {
- "msgId": "baa13090-043e-420b-92f9-756c8fefe9e8",
- "status": "ACCEPTED",
- "statusCode": 0,
- "inQuietHours": false,
- "createdAt": "2021-07-12 14:46:16",
- "cost": 0.026,
- "to": "+31612469333",
- "countryIso": "NL",
- "from": "InfoText",
- "text": "Your order has been haned over to courier company.",
- "parts": 1,
- "channel": "viber"
}, - {
- "msgId": "c3e89d8c-83c6-4017-a28f-d518cccae6da",
- "status": "ACCEPTED",
- "statusCode": 0,
- "inQuietHours": false,
- "createdAt": "2021-07-12 14:46:16",
- "cost": 0.026,
- "to": "+34612934161",
- "countryIso": "ES",
- "from": "InfoText",
- "text": "Your order has been haned over to courier company.",
- "parts": 1,
- "channel": "viber"
}, - {
- "msgId": "e86aea8b-b937-4059-8d00-036d61c045c4",
- "status": "ACCEPTED",
- "statusCode": 0,
- "inQuietHours": false,
- "createdAt": "2021-07-12 14:46:16",
- "cost": 0.026,
- "to": "+34612934161",
- "countryIso": "ES",
- "from": "InfoText",
- "text": "Your order has been haned over to courier company.",
- "parts": 1,
- "channel": "viber"
}, - {
- "msgId": "4448f825-7aa2-4187-bc78-c1c950620e65",
- "status": "ACCEPTED",
- "statusCode": 0,
- "inQuietHours": false,
- "createdAt": "2021-07-12 14:46:16",
- "cost": 0.026,
- "to": "+447400790504",
- "countryIso": "GB",
- "from": "InfoText",
- "text": "Your order has been haned over to courier company.",
- "parts": 1,
- "channel": "viber"
}, - {
- "msgId": "187edb12-93b1-4a2e-8a75-d2480b47acbc",
- "status": "ACCEPTED",
- "statusCode": 0,
- "inQuietHours": false,
- "createdAt": "2021-07-12 14:46:16",
- "cost": 0.026,
- "to": "+4915123438636",
- "countryIso": "DE",
- "from": "InfoText",
- "text": "Your order has been haned over to courier company.",
- "parts": 1,
- "channel": "viber"
}
]
}
Send Multichannel campaign
Sends Multichannel message to existing group(s) of contacts.
Note: This endpoint accepts idempotent requests by providing an additional
idempotencyId
parameter in body with a unique value generated by the client of type UUID v1-v5. To confirm that the server understood the request, the response will contain the headerX-Idempotency-Id
with your unique value. By using idempotency you can retry requests in case of network error or server not responding in time, without accidentally performing the same operation twice and have a guarantee of not being billed twice.
We recommend to always use Idempotency ID when sending Multichannel campaigns
Errors for POST /multichannel/campaigns
HTTP code | Error code | Type | Description |
---|---|---|---|
400 | 1101 | invalid_param | The parameter groups is empty or not set |
400 | 1140 | invalid_param | Group ID is not a valid group |
400 | 1102 | invalid_param | Group is empty |
400 | 1103 | invalid_param | The phone numbers array is too big (max. allowed: 25000 numbers) |
400 | 1105 | invalid_param | The parameter from is empty or not set |
400 | 1106 | invalid_param | The parameter from is not valid (min 3, max 11 characters) |
400 | 1107 | invalid_param | The parameter text is empty or not set |
400 | 1108 | invalid_param | The parameter scheduledDate is not a valid date |
400 | 1109 | invalid_param | The parameter dlrCallbackUrl is not a valid URL |
400 | 1111 | invalid_param | Idempotency Id provided is not a valid UUID (v1-v5) |
400 | 1112 | invalid_param | The shortlink/attachment ID provided for tracking is invalid or not found |
400 | 1116 | invalid_param | The scheduled date is in the past |
400 | 1103 | invalid_param | The phone numbers array is too big (max. allowed: 25000 numbers) |
403 | 1119 | no_coverage | No coverage or restricted destination |
400 | 1113 | insufficient_credit | Insufficient credit |
400 | 1114 | insufficient_credit | Credit limit reached. To increase the credit limit, please contact your account manager |
400 | 1124 | invalid_param | The parameter ttl is not a number |
400 | 1125 | invalid_param | Min value for ttl is 300 seconds |
400 | 1134 | invalid_param | Max value for ttl is 1209600 seconds (14 days) |
400 | 1120 | invalid_param | The parameter strategy is empty or not set |
400 | 1121 | invalid_param | The parameter strategy must have at least two channels |
400 | 1122 | invalid_param | The parameter strategy must have channel sms as last element |
400 | 1129 | invalid_param | The parameter strategy contains duplicate channels |
400 | 1123 | invalid_param | The parameter channel is not valid. Allowed values: |
403 | 1131 | access_denied | The strategy contains channels that are not active: |
400 | 1126 | invalid_param | The parameter templateId is not set |
400 | 1127 | invalid_param | The parameter templateId is not valid |
400 | 1128 | invalid_param | The template ID provided is not a valid template |
403 | 1132 | access_denied | The template ID provided is not approved |
403 | 1133 | access_denied | The template ID provided is not locked |
400 | 1130 | insufficient_credit | Insufficient credit for failover sending |
Authorizations:
Request Body schema: application/json
groups required | Array of integers <int32> An array of identifiers for groups of contacts |
from required | string [ 3 .. 15 ] characters The originator (sender name) of the text message (min 3, max 11 characters). If the originator used in this value is not approved, it will be overwritten by a default system originator (eg. InfoText). Read more about sender names |
required | Array of objects (Strategy) An array of objects, in the order of sending. The API will try sending the message with the first channel in the strategy. If the delivery failed (Eg. Viber not installed, |
ttl | integer <int32> Default: 300 The time to live (ttl) defines the time in seconds that a channel has to deliver the message to the destination. After the time to live has expired and no |
scheduledDate | string <date-time> If you want to schedule the Multichannel message at a later date. The date provided must be in format YYYY-MM-DD HH:MM:SS (Eg. 2021-06-23 14:26:10). By default, the date and time in this parameter is treated as |
isUtc | boolean Default: true If set to |
dlrCallbackUrl | string <url> A valid URL to receive the delivery report update for the sent Multichannel message. If this parameter is set, it will overwrite the setting from Admin Dashboard > HTTP API > Oauth2 > Application settings |
shortResponse | boolean Default: false If set to |
noTextDetails | boolean Default: false The response will not have the parameters |
showTimezone | boolean Default: false Shows the parameter |
idempotencyId | string <uuid> 36 characters ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]... A unique idempotency id generated by the client. For more information, refer to Idempotent requests. The API will return an error if the value provided is not a valid UUID (v1-v5) |
Responses
Request samples
- Payload
- Shell + Curl
- Python + Requests
- Java + Okhttp
- Node + Native
- Javascript + Xhr
- Php + Curl
- Go + Native
- Ruby + Native
- Csharp + Restsharp
{- "groups": [
- 18,
- 20
], - "from": "InfoText",
- "strategy": [
- {
- "channel": "viber",
- "templateId": 15
}, - {
- "channel": "whatsapp",
- "templateId": 19
}, - {
- "channel": "sms",
- "text": "This is the last failover text message"
}
], - "ttl": 300,
}
Response samples
- 200
- 400
- 401
- 403
- 405
- 429
- 500
{- "info": {
- "campaignId": "1de30d3d-c40b-4938-b70b-acb692687101",
- "totalPhoneNumbers": 16,
- "totalValid": 15,
- "totalInvalid": 1,
- "duplicatesRemoved": 1,
- "totalCost": 0.39,
- "totalParts": 15,
- "phoneNumbersByCountry": {
- "FR": 1,
- "AT": 1,
- "CH": 8,
- "PT": 1,
- "DE": 2,
- "CZ": 2
}, - "groups": [
- {
- "id": 18,
- "name": "My new group",
- "phoneNumbers": 6
}, - {
- "id": 20,
- "name": "Contacts 2021",
- "phoneNumbers": 10
}
], - "invalid": [ ],
- "scheduled": false
}, - "data": [
- {
- "msgId": "e6d8f886-0111-4fe2-ab44-028c2460005d",
- "status": "ACCEPTED",
- "statusCode": 0,
- "inQuietHours": false,
- "createdAt": "2021-07-25 16:34:49",
- "cost": 0.026,
- "to": "+33612970283",
- "countryIso": "FR",
- "from": "InfoText",
- "text": "Redeem this voucher in the next 30 days to get a 30% discount off all Summer Fashion\",\r\n \"parts\": 1\r\n },\r\n {\r\n \"msgId\": \"07f90eec-6316-4a58-9f76-2a3a21b26b38\",\r\n \"status\": \"ACCEPTED\",\r\n \"createdAt\": \"2021-07-12 08:19:00\",\r\n \"cost\": 0.026,\r\n \"to\": \"+34612934161\",\r\n \"countryIso\": \"ES\",\r\n \"from\": \"InfoText\",\r\n \"text\": \"Redeem this voucher in the next 30 days to get a 30% discount off all Summer Fashion",
- "parts": 1,
- "channel": "viber"
}, - {
- "msgId": "d937209a-ed40-482d-a5a9-7ccc6b4370b5",
- "status": "ACCEPTED",
- "statusCode": 0,
- "inQuietHours": false,
- "createdAt": "2021-07-25 16:34:49",
- "cost": 0.026,
- "to": "+43664187834",
- "countryIso": "AT",
- "from": "InfoText",
- "text": "Redeem this voucher in the next 30 days to get a 30% discount off all Summer Fashion\",\r\n \"parts\": 1\r\n },\r\n {\r\n \"msgId\": \"07f90eec-6316-4a58-9f76-2a3a21b26b38\",\r\n \"status\": \"ACCEPTED\",\r\n \"createdAt\": \"2021-07-12 08:19:00\",\r\n \"cost\": 0.026,\r\n \"to\": \"+34612934161\",\r\n \"countryIso\": \"ES\",\r\n \"from\": \"InfoText\",\r\n \"text\": \"Redeem this voucher in the next 30 days to get a 30% discount off all Summer Fashion",
- "parts": 1,
- "channel": "viber"
}, - {
- "msgId": "493ca03e-d95c-4522-8b84-5073f10276d4",
- "status": "ACCEPTED",
- "statusCode": 0,
- "inQuietHours": false,
- "createdAt": "2021-07-25 16:34:49",
- "cost": 0.026,
- "to": "+41781218472",
- "countryIso": "CH",
- "from": "InfoText",
- "text": "Redeem this voucher in the next 30 days to get a 30% discount off all Summer Fashion\",\r\n \"parts\": 1\r\n },\r\n {\r\n \"msgId\": \"07f90eec-6316-4a58-9f76-2a3a21b26b38\",\r\n \"status\": \"ACCEPTED\",\r\n \"createdAt\": \"2021-07-12 08:19:00\",\r\n \"cost\": 0.026,\r\n \"to\": \"+34612934161\",\r\n \"countryIso\": \"ES\",\r\n \"from\": \"InfoText\",\r\n \"text\": \"Redeem this voucher in the next 30 days to get a 30% discount off all Summer Fashion",
- "parts": 1,
- "channel": "viber"
}, - {
- "msgId": "49e90d04-f7e0-485a-9292-38428c1f67cc",
- "status": "ACCEPTED",
- "statusCode": 0,
- "inQuietHours": false,
- "createdAt": "2021-07-25 16:34:49",
- "cost": 0.026,
- "to": "+351912110421",
- "countryIso": "PT",
- "from": "InfoText",
- "text": "Redeem this voucher in the next 30 days to get a 30% discount off all Summer Fashion\",\r\n \"parts\": 1\r\n },\r\n {\r\n \"msgId\": \"07f90eec-6316-4a58-9f76-2a3a21b26b38\",\r\n \"status\": \"ACCEPTED\",\r\n \"createdAt\": \"2021-07-12 08:19:00\",\r\n \"cost\": 0.026,\r\n \"to\": \"+34612934161\",\r\n \"countryIso\": \"ES\",\r\n \"from\": \"InfoText\",\r\n \"text\": \"Redeem this voucher in the next 30 days to get a 30% discount off all Summer Fashion",
- "parts": 1,
- "channel": "viber"
}, - {
- "msgId": "92156a05-dbbd-4013-9470-bf9cce119766",
- "status": "ACCEPTED",
- "statusCode": 0,
- "inQuietHours": false,
- "createdAt": "2021-07-25 16:34:49",
- "cost": 0.026,
- "to": "+4915123473140",
- "countryIso": "DE",
- "from": "InfoText",
- "text": "Redeem this voucher in the next 30 days to get a 30% discount off all Summer Fashion\",\r\n \"parts\": 1\r\n },\r\n {\r\n \"msgId\": \"07f90eec-6316-4a58-9f76-2a3a21b26b38\",\r\n \"status\": \"ACCEPTED\",\r\n \"createdAt\": \"2021-07-12 08:19:00\",\r\n \"cost\": 0.026,\r\n \"to\": \"+34612934161\",\r\n \"countryIso\": \"ES\",\r\n \"from\": \"InfoText\",\r\n \"text\": \"Redeem this voucher in the next 30 days to get a 30% discount off all Summer Fashion",
- "parts": 1,
- "channel": "viber"
}, - {
- "msgId": "ee262875-0908-4c4d-ace6-ba2771bfdbeb",
- "status": "ACCEPTED",
- "statusCode": 0,
- "inQuietHours": false,
- "createdAt": "2021-07-25 16:34:49",
- "cost": 0.026,
- "to": "+4915123966046",
- "countryIso": "DE",
- "from": "InfoText",
- "text": "Redeem this voucher in the next 30 days to get a 30% discount off all Summer Fashion\",\r\n \"parts\": 1\r\n },\r\n {\r\n \"msgId\": \"07f90eec-6316-4a58-9f76-2a3a21b26b38\",\r\n \"status\": \"ACCEPTED\",\r\n \"createdAt\": \"2021-07-12 08:19:00\",\r\n \"cost\": 0.026,\r\n \"to\": \"+34612934161\",\r\n \"countryIso\": \"ES\",\r\n \"from\": \"InfoText\",\r\n \"text\": \"Redeem this voucher in the next 30 days to get a 30% discount off all Summer Fashion",
- "parts": 1,
- "channel": "viber"
}, - {
- "msgId": "9c9a0fbd-ca4d-43e1-b937-9f2adef29c2c",
- "status": "ACCEPTED",
- "statusCode": 0,
- "inQuietHours": false,
- "createdAt": "2021-07-25 16:34:49",
- "cost": 0.026,
- "to": "+41781981881",
- "countryIso": "CH",
- "from": "InfoText",
- "text": "Redeem this voucher in the next 30 days to get a 30% discount off all Summer Fashion\",\r\n \"parts\": 1\r\n },\r\n {\r\n \"msgId\": \"07f90eec-6316-4a58-9f76-2a3a21b26b38\",\r\n \"status\": \"ACCEPTED\",\r\n \"createdAt\": \"2021-07-12 08:19:00\",\r\n \"cost\": 0.026,\r\n \"to\": \"+34612934161\",\r\n \"countryIso\": \"ES\",\r\n \"from\": \"InfoText\",\r\n \"text\": \"Redeem this voucher in the next 30 days to get a 30% discount off all Summer Fashion",
- "parts": 1,
- "channel": "viber"
}, - {
- "msgId": "90700963-99ee-4400-abd7-06d45253b649",
- "status": "ACCEPTED",
- "statusCode": 0,
- "inQuietHours": false,
- "createdAt": "2021-07-25 16:34:49",
- "cost": 0.026,
- "to": "+41781171055",
- "countryIso": "CH",
- "from": "InfoText",
- "text": "Redeem this voucher in the next 30 days to get a 30% discount off all Summer Fashion\",\r\n \"parts\": 1\r\n },\r\n {\r\n \"msgId\": \"07f90eec-6316-4a58-9f76-2a3a21b26b38\",\r\n \"status\": \"ACCEPTED\",\r\n \"createdAt\": \"2021-07-12 08:19:00\",\r\n \"cost\": 0.026,\r\n \"to\": \"+34612934161\",\r\n \"countryIso\": \"ES\",\r\n \"from\": \"InfoText\",\r\n \"text\": \"Redeem this voucher in the next 30 days to get a 30% discount off all Summer Fashion",
- "parts": 1,
- "channel": "viber"
}, - {
- "msgId": "260f1651-5a95-443c-b074-4c519143faa8",
- "status": "ACCEPTED",
- "statusCode": 0,
- "inQuietHours": false,
- "createdAt": "2021-07-25 16:34:49",
- "cost": 0.026,
- "to": "+420601536594",
- "countryIso": "CZ",
- "from": "InfoText",
- "text": "Redeem this voucher in the next 30 days to get a 30% discount off all Summer Fashion\",\r\n \"parts\": 1\r\n },\r\n {\r\n \"msgId\": \"07f90eec-6316-4a58-9f76-2a3a21b26b38\",\r\n \"status\": \"ACCEPTED\",\r\n \"createdAt\": \"2021-07-12 08:19:00\",\r\n \"cost\": 0.026,\r\n \"to\": \"+34612934161\",\r\n \"countryIso\": \"ES\",\r\n \"from\": \"InfoText\",\r\n \"text\": \"Redeem this voucher in the next 30 days to get a 30% discount off all Summer Fashion",
- "parts": 1,
- "channel": "viber"
}, - {
- "msgId": "f8fc4701-2d35-4bb4-bcb5-a600f84e1a24",
- "status": "ACCEPTED",
- "statusCode": 0,
- "inQuietHours": false,
- "createdAt": "2021-07-25 16:34:49",
- "cost": 0.026,
- "to": "+41781168358",
- "countryIso": "CH",
- "from": "InfoText",
- "text": "Redeem this voucher in the next 30 days to get a 30% discount off all Summer Fashion\",\r\n \"parts\": 1\r\n },\r\n {\r\n \"msgId\": \"07f90eec-6316-4a58-9f76-2a3a21b26b38\",\r\n \"status\": \"ACCEPTED\",\r\n \"createdAt\": \"2021-07-12 08:19:00\",\r\n \"cost\": 0.026,\r\n \"to\": \"+34612934161\",\r\n \"countryIso\": \"ES\",\r\n \"from\": \"InfoText\",\r\n \"text\": \"Redeem this voucher in the next 30 days to get a 30% discount off all Summer Fashion",
- "parts": 1,
- "channel": "viber"
}, - {
- "msgId": "b1685860-5bda-4369-92c6-674a8826be8e",
- "status": "ACCEPTED",
- "statusCode": 0,
- "inQuietHours": false,
- "createdAt": "2021-07-25 16:34:49",
- "cost": 0.026,
- "to": "+41781703382",
- "countryIso": "CH",
- "from": "InfoText",
- "text": "Redeem this voucher in the next 30 days to get a 30% discount off all Summer Fashion\",\r\n \"parts\": 1\r\n },\r\n {\r\n \"msgId\": \"07f90eec-6316-4a58-9f76-2a3a21b26b38\",\r\n \"status\": \"ACCEPTED\",\r\n \"createdAt\": \"2021-07-12 08:19:00\",\r\n \"cost\": 0.026,\r\n \"to\": \"+34612934161\",\r\n \"countryIso\": \"ES\",\r\n \"from\": \"InfoText\",\r\n \"text\": \"Redeem this voucher in the next 30 days to get a 30% discount off all Summer Fashion",
- "parts": 1,
- "channel": "viber"
}, - {
- "msgId": "7a7bc598-6e60-4b50-80cc-3e8af938bd30",
- "status": "ACCEPTED",
- "statusCode": 0,
- "inQuietHours": false,
- "createdAt": "2021-07-25 16:34:49",
- "cost": 0.026,
- "to": "+41781759743",
- "countryIso": "CH",
- "from": "InfoText",
- "text": "Redeem this voucher in the next 30 days to get a 30% discount off all Summer Fashion\",\r\n \"parts\": 1\r\n },\r\n {\r\n \"msgId\": \"07f90eec-6316-4a58-9f76-2a3a21b26b38\",\r\n \"status\": \"ACCEPTED\",\r\n \"createdAt\": \"2021-07-12 08:19:00\",\r\n \"cost\": 0.026,\r\n \"to\": \"+34612934161\",\r\n \"countryIso\": \"ES\",\r\n \"from\": \"InfoText\",\r\n \"text\": \"Redeem this voucher in the next 30 days to get a 30% discount off all Summer Fashion",
- "parts": 1,
- "channel": "viber"
}, - {
- "msgId": "d47687a1-5b68-4a1b-b2a6-a75a8b508b2b",
- "status": "ACCEPTED",
- "statusCode": 0,
- "inQuietHours": false,
- "createdAt": "2021-07-25 16:34:49",
- "cost": 0.026,
- "to": "+41781281059",
- "countryIso": "CH",
- "from": "InfoText",
- "text": "Redeem this voucher in the next 30 days to get a 30% discount off all Summer Fashion\",\r\n \"parts\": 1\r\n },\r\n {\r\n \"msgId\": \"07f90eec-6316-4a58-9f76-2a3a21b26b38\",\r\n \"status\": \"ACCEPTED\",\r\n \"createdAt\": \"2021-07-12 08:19:00\",\r\n \"cost\": 0.026,\r\n \"to\": \"+34612934161\",\r\n \"countryIso\": \"ES\",\r\n \"from\": \"InfoText\",\r\n \"text\": \"Redeem this voucher in the next 30 days to get a 30% discount off all Summer Fashion",
- "parts": 1,
- "channel": "viber"
}, - {
- "msgId": "8822b47c-34c5-44d2-8838-f73e3b119878",
- "status": "ACCEPTED",
- "statusCode": 0,
- "inQuietHours": false,
- "createdAt": "2021-07-25 16:34:49",
- "cost": 0.026,
- "to": "+420601137073",
- "countryIso": "CZ",
- "from": "InfoText",
- "text": "Redeem this voucher in the next 30 days to get a 30% discount off all Summer Fashion\",\r\n \"parts\": 1\r\n },\r\n {\r\n \"msgId\": \"07f90eec-6316-4a58-9f76-2a3a21b26b38\",\r\n \"status\": \"ACCEPTED\",\r\n \"createdAt\": \"2021-07-12 08:19:00\",\r\n \"cost\": 0.026,\r\n \"to\": \"+34612934161\",\r\n \"countryIso\": \"ES\",\r\n \"from\": \"InfoText\",\r\n \"text\": \"Redeem this voucher in the next 30 days to get a 30% discount off all Summer Fashion",
- "parts": 1,
- "channel": "viber"
}, - {
- "msgId": "05e718be-891f-46b3-8114-41c0c654d9f7",
- "status": "ACCEPTED",
- "statusCode": 0,
- "inQuietHours": false,
- "createdAt": "2021-07-25 16:34:49",
- "cost": 0.026,
- "to": "+41781353741",
- "countryIso": "CH",
- "from": "InfoText",
- "text": "Redeem this voucher in the next 30 days to get a 30% discount off all Summer Fashion\",\r\n \"parts\": 1\r\n },\r\n {\r\n \"msgId\": \"07f90eec-6316-4a58-9f76-2a3a21b26b38\",\r\n \"status\": \"ACCEPTED\",\r\n \"createdAt\": \"2021-07-12 08:19:00\",\r\n \"cost\": 0.026,\r\n \"to\": \"+34612934161\",\r\n \"countryIso\": \"ES\",\r\n \"from\": \"InfoText\",\r\n \"text\": \"Redeem this voucher in the next 30 days to get a 30% discount off all Summer Fashion",
- "parts": 1,
- "channel": "viber"
}
]
}
Estimate Multichannel campaign
Estimate the cost of sending a Multichannel message to groups of phone numbers.
This endpoint is identical to /multichannel/campaign
endpoint, but it will only simulate the Multichannel sending (no billing).
The request body and the response are the same as for /multichannel/campaign
endpoint.
Errors for POST /multichannel/campaigns/estimate
HTTP code | Error code | Type | Description |
---|---|---|---|
400 | 1101 | invalid_param | The parameter groups is empty or not set |
400 | 1140 | invalid_param | Group ID is not a valid group |
400 | 1102 | invalid_param | Group is empty |
400 | 1103 | invalid_param | The phone numbers array is too big (max. allowed: 25000 numbers) |
400 | 1105 | invalid_param | The parameter from is empty or not set |
400 | 1106 | invalid_param | The parameter from is not valid (min 3, max 11 characters) |
400 | 1107 | invalid_param | The parameter text is empty or not set |
400 | 1108 | invalid_param | The parameter scheduledDate is not a valid date |
400 | 1109 | invalid_param | The parameter dlrCallbackUrl is not a valid URL |
400 | 1112 | invalid_param | The shortlink/attachment ID provided for tracking is invalid or not found |
400 | 1116 | invalid_param | The scheduled date is in the past |
400 | 1103 | invalid_param | The phone numbers array is too big (max. allowed: 25000 numbers) |
403 | 1119 | no_coverage | No coverage or restricted destination |
400 | 1113 | insufficient_credit | Insufficient credit |
400 | 1114 | insufficient_credit | Credit limit reached. To increase the credit limit, please contact your account manager |
400 | 1124 | invalid_param | The parameter ttl is not a number |
400 | 1125 | invalid_param | Min value for ttl is 300 seconds |
400 | 1134 | invalid_param | Max value for ttl is 1209600 seconds (14 days) |
400 | 1120 | invalid_param | The parameter strategy is empty or not set |
400 | 1121 | invalid_param | The parameter strategy must have at least two channels |
400 | 1122 | invalid_param | The parameter strategy must have channel sms as last element |
400 | 1129 | invalid_param | The parameter strategy contains duplicate channels |
400 | 1123 | invalid_param | The parameter channel is not valid. Allowed values: |
403 | 1131 | access_denied | The strategy contains channels that are not active: |
400 | 1126 | invalid_param | The parameter templateId is not set |
400 | 1127 | invalid_param | The parameter templateId is not valid |
400 | 1128 | invalid_param | The template ID provided is not a valid template |
403 | 1132 | access_denied | The template ID provided is not approved |
403 | 1133 | access_denied | The template ID provided is not locked |
400 | 1130 | insufficient_credit | Insufficient credit for failover sending |
Authorizations:
Request Body schema: application/json
groups required | Array of integers <int32> An array of identifiers for groups of contacts |
from required | string [ 3 .. 15 ] characters The originator (sender name) of the text message (min 3, max 11 characters). If the originator used in this value is not approved, it will be overwritten by a default system originator (eg. InfoText). Read more about sender names |
required | Array of objects (Strategy) An array of objects, in the order of sending. The API will try sending the message with the first channel in the strategy. If the delivery failed (Eg. Viber not installed, |
ttl | integer <int32> Default: 300 The time to live (ttl) defines the time in seconds that a channel has to deliver the message to the destination. After the time to live has expired and no |
scheduledDate | string <date-time> If you want to schedule the Multichannel message at a later date. The date provided must be in format YYYY-MM-DD HH:MM:SS (Eg. 2021-06-23 14:26:10). By default, the date and time in this parameter is treated as |
isUtc | boolean Default: true If set to |
dlrCallbackUrl | string <url> A valid URL to receive the delivery report update for the sent Multichannel message. If this parameter is set, it will overwrite the setting from Admin Dashboard > HTTP API > Oauth2 > Application settings |
shortResponse | boolean Default: false If set to |
noTextDetails | boolean Default: false The response will not have the parameters |
showTimezone | boolean Default: false Shows the parameter |
Responses
Request samples
- Payload
- Shell + Curl
- Python + Requests
- Java + Okhttp
- Node + Native
- Javascript + Xhr
- Php + Curl
- Go + Native
- Ruby + Native
- Csharp + Restsharp
{- "groups": [
- 18,
- 20,
- 14
], - "from": "InfoText",
- "strategy": [
- {
- "channel": "viber",
- "templateId": 15
}, - {
- "channel": "whatsapp",
- "templateId": 19
}, - {
- "channel": "sms",
- "text": "This is the last failover text message"
}
], - "ttl": 300,
- "shortResponse": true
}
Response samples
- 200
- 400
- 401
- 403
- 405
- 429
- 500
{- "info": {
- "campaignId": "d383cf51-b639-4710-a784-5957958264f3",
- "totalPhoneNumbers": 3677,
- "totalValid": 3676,
- "totalInvalid": 1,
- "duplicatesRemoved": 1,
- "totalCost": 95.576,
- "totalParts": 3676,
- "phoneNumbersByCountry": {
- "FR": 200,
- "AT": 191,
- "CH": 239,
- "PT": 225,
- "DE": 190,
- "CZ": 214,
- "BE": 236,
- "FI": 225,
- "ES": 227,
- "BG": 208,
- "GB": 202,
- "IT": 251,
- "NL": 213,
- "NO": 204,
- "RU": 213,
- "HU": 230,
- "GR": 208
}, - "groups": [
- {
- "id": 18,
- "name": "My new group",
- "phoneNumbers": 6
}, - {
- "id": 20,
- "name": "Contacts 2021",
- "phoneNumbers": 10
}, - {
- "id": 14,
- "name": "My first group",
- "phoneNumbers": 3661
}
], - "invalid": [ ],
- "scheduled": false
}, - "data": [ ]
}
Delete scheduled Multichannel message
Delete a scheduled Multichannel message by providing a valid identifier (msgId
).
The cost of the deleted scheduled Multichannel message will be returned to the balance of the account.
Errors for DELETE /multichannel/scheduled/{msgId}
HTTP code | Error code | Type | Description |
---|---|---|---|
403 | 1118 | access_denied | Only scheduled campaigns/messages can be deleted |
404 | 1100 | not_found | Message ID provided was not found or is not scheduled |
400 | 1115 | invalid_param | Message ID provided is not valid |
Authorizations:
path Parameters
msgId required | string <uuid> 36 characters ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]... Example: 396d2afa-1440-4f36-a365-b99a5ceaea23 Identifier of a scheduled Multichannel message |
Responses
Request samples
- Shell + Curl
- Python + Requests
- Java + Okhttp
- Node + Native
- Javascript + Xhr
- Php + Curl
- Go + Native
- Ruby + Native
- Csharp + Restsharp
curl --request DELETE \ --url https://api.sms.cx/multichannel/scheduled/396d2afa-1440-4f36-a365-b99a5ceaea23 \ --header 'Authorization: Bearer REPLACE_ACCESS_TOKEN'
Response samples
- 200
- 400
- 401
- 403
- 404
- 405
- 429
- 500
{- "info": {
- "msgId": "e7b457c1-517a-4c4d-b1ec-c4ce6038792f",
- "parts": 1,
- "creditReturned": 0.026,
- "channel": "multichannel"
}
}
Delete scheduled Multichannel campaign
Delete a scheduled Multichannel campaign by providing a valid identifier (campaignId
).
The cost of the deleted scheduled Multichannel campaign will be returned to the balance of the account.
If part of the Multichannel campaign has already started, only scheduled messages will be deleted. Messages already sent cannot be deleted.
Errors for DELETE /multichannel/scheduled/campaign/{campaignId}
HTTP code | Error code | Type | Description |
---|---|---|---|
403 | 1118 | access_denied | Only scheduled campaigns/messages can be deleted |
404 | 1150 | not_found | Campaign ID provided was not found or is not scheduled |
400 | 1155 | invalid_param | Campaign ID provided is not valid |
Authorizations:
path Parameters
campaignId required | string <uuid> 36 characters ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]... Example: 9f90f919-9b19-43db-921f-c8e05ae7054c Identifier of a scheduled Multichannel campaign |
Responses
Request samples
- Shell + Curl
- Python + Requests
- Java + Okhttp
- Node + Native
- Javascript + Xhr
- Php + Curl
- Go + Native
- Ruby + Native
- Csharp + Restsharp
curl --request DELETE \ --url https://api.sms.cx/multichannel/scheduled/campaign/9f90f919-9b19-43db-921f-c8e05ae7054c \ --header 'Authorization: Bearer REPLACE_ACCESS_TOKEN'
Response samples
- 200
- 400
- 401
- 403
- 404
- 405
- 429
- 500
{- "info": {
- "campaignId": "81710913-af8c-4b01-854a-897c990e812a",
- "totalPhoneNumbers": 2871,
- "totalParts": 2871,
- "phoneNumbersDeleted": 2871,
- "partsDeleted": 2871,
- "creditReturned": 74.646,
- "channel": "multichannel"
}
}
Get list of groups
Retrieves the list of existing groups of contacts. The groups are returned sorted by creation date, with the most recent group appearing first.
This endpoint should not return an error. If no groups are available, an empty data object is returned.
Authorizations:
Responses
Request samples
- Shell + Curl
- Python + Requests
- Java + Okhttp
- Node + Native
- Javascript + Xhr
- Php + Curl
- Go + Native
- Ruby + Native
- Csharp + Restsharp
curl --request GET \ --url https://api.sms.cx/groups \ --header 'Authorization: Bearer REPLACE_ACCESS_TOKEN'
Response samples
- 200
- 401
- 403
- 405
- 429
- 500
{- "data": [
- {
- "id": 14,
- "name": "My first group",
- "totalPhoneNumbers": 2423,
- "totalCost": 125.552,
- "totalOptouts": 0,
- "createdAt": "2021-06-21 20:13:35"
}, - {
- "id": 24,
- "name": "My second group",
- "totalPhoneNumbers": 905,
- "totalCost": 37.105,
- "totalOptouts": 0,
- "createdAt": "2021-07-05 14:56:55"
}, - {
- "id": 33,
- "name": "Summer sale",
- "totalPhoneNumbers": 2097,
- "totalCost": 85.977,
- "totalOptouts": 0,
- "createdAt": "2021-07-05 14:58:21"
}
]
}
Create new group
Creates a new group.
Errors for POST /groups
HTTP code | Error code | Type | Description |
---|---|---|---|
400 | 1204 | invalid_param | The name is empty or parameter name not set |
400 | 1206 | invalid_param | The name provided is invalid (min 3, max 60 characters) |
400 | 1211 | duplicate_value | You already have a group with this name |
Authorizations:
Request Body schema: application/json
name required | string [ 3 .. 60 ] characters Name of the group |
Responses
Request samples
- Payload
- Shell + Curl
- Python + Requests
- Java + Okhttp
- Node + Native
- Javascript + Xhr
- Php + Curl
- Go + Native
- Ruby + Native
- Csharp + Restsharp
{- "name": "My new group"
}
Response samples
- 201
- 400
- 401
- 403
- 405
- 429
- 500
{- "info": {
- "id": 18,
- "name": "My new group"
}
}
Get group details
Retrieves the details of a group if a valid identifier was provided.
Errors for GET /groups/{groupId}
HTTP code | Error code | Type | Description |
---|---|---|---|
404 | 1200 | not_found | Group ID not found |
Authorizations:
path Parameters
groupId required | integer <int32> Example: 2245 Identifier of a group of contacts |
query Parameters
short_response | boolean Default: false If set to true, it will return the full |
limit | integer <int32> Default: 500 Example: limit=100 A limit on the number of objects to be returned |
next | string Example: next=NTM2NTA The next token used to retrieve additional data |
previous | string Example: previous=NTQxNTA The previous token used to retrieve additional data |
Responses
Request samples
- Shell + Curl
- Python + Requests
- Java + Okhttp
- Node + Native
- Javascript + Xhr
- Php + Curl
- Go + Native
- Ruby + Native
- Csharp + Restsharp
curl --request GET \ --url 'https://api.sms.cx/groups/2245?short_response=SOME_BOOLEAN_VALUE' \ --header 'Authorization: Bearer REPLACE_ACCESS_TOKEN'
Response samples
- 200
- 401
- 403
- 404
- 405
- 429
- 500
{- "info": {
- "id": 17,
- "name": "My group 3",
- "totalPhoneNumbers": 17,
- "totalCost": 0.697,
- "totalOptouts": 16,
- "createdAt": "2021-07-10 13:03:08"
}, - "data": [
- {
- "id": "06012e24-dc75-45a8-9dab-bfc489737d13",
- "phoneNumber": "+36201910674",
- "countryIso": "HU",
- "groupId": 17,
- "optout": false,
- "dateAdded": "2021-07-10 13:03:09"
}, - {
- "id": "8a7d7227-bcf2-47bd-9f75-a64243e77f3d",
- "phoneNumber": "+41781121629",
- "countryIso": "CH",
- "firstName": "Annett",
- "lastName": "Goldschmidt",
- "email": "annett.goldschmidt221@gmail.com",
- "groupId": 17,
- "optout": false,
- "dateAdded": "2021-07-10 13:03:09"
}, - {
- "id": "f8a9aaac-29aa-4028-8dbb-b60c30e05edd",
- "phoneNumber": "+34612406674",
- "countryIso": "ES",
- "firstName": "Guinerve",
- "lastName": "Tovar",
- "groupId": 17,
- "optout": false,
- "dateAdded": "2021-07-10 13:03:09"
}, - {
- "id": "48a107f0-8d98-4081-b52f-2f7e5e24252d",
- "phoneNumber": "+33612935399",
- "countryIso": "FR",
- "firstName": "Anton",
- "lastName": "Maheu",
- "groupId": 17,
- "optout": false,
- "dateAdded": "2021-07-10 13:03:09"
}, - {
- "id": "ede7ebb7-62a4-4635-9b33-26ae1afd3019",
- "phoneNumber": "+34612160806",
- "countryIso": "ES",
- "firstName": "Almanza",
- "lastName": "Quintero",
- "groupId": 17,
- "optout": false,
- "dateAdded": "2021-07-10 13:03:09"
}, - {
- "id": "b3b0f258-a0c4-4774-ad64-2c1eacbe5c8c",
- "phoneNumber": "+33612970283",
- "countryIso": "FR",
- "firstName": "René",
- "lastName": "Royer",
- "dateAdded": "2021-07-10 13:03:09"
}, - {
- "id": "45558648-bff3-40bb-8cb7-f7ea3b9aee89",
- "phoneNumber": "+35948964458",
- "countryIso": "BG",
- "firstName": "Fejes",
- "lastName": "Gyuszi",
- "groupId": 17,
- "optout": false,
- "dateAdded": "2021-07-10 13:03:09"
}, - {
- "id": "adccb27a-3bbb-4d7a-858e-565252328365",
- "phoneNumber": "+31612576088",
- "countryIso": "NL",
- "firstName": "Joppe",
- "lastName": "Knijn",
- "groupId": 17,
- "optout": false,
- "dateAdded": "2021-07-10 13:03:09"
}, - {
- "id": "6b82e39d-5e31-4643-afda-1f44f15aebef",
- "phoneNumber": "+351912938895",
- "countryIso": "PT",
- "firstName": "Rodrigues",
- "lastName": "Carvalho",
- "groupId": 17,
- "optout": false,
- "dateAdded": "2021-07-10 13:03:09"
}, - {
- "id": "8f5bc3e6-479d-4e3a-8862-e10e196054b4",
- "phoneNumber": "+447400547989",
- "countryIso": "GB",
- "firstName": "Hayden",
- "lastName": "Francis",
- "groupId": 17,
- "optout": false,
- "dateAdded": "2021-07-10 13:03:09"
}, - {
- "id": "9bf5886f-eb89-40bd-92d3-a5700320b865",
- "phoneNumber": "+4740278715",
- "countryIso": "NO",
- "firstName": "Even",
- "lastName": "Sørdal",
- "groupId": 17,
- "optout": false,
- "dateAdded": "2021-07-10 13:03:09"
}, - {
- "id": "467232da-0746-4230-9dcf-a29b4e6492a4",
- "phoneNumber": "+306912534172",
- "countryIso": "GR",
- "groupId": 17,
- "optout": false,
- "dateAdded": "2021-07-10 13:03:09"
}, - {
- "id": "1bcf39aa-2d27-4b8a-a46c-429a6601b674",
- "phoneNumber": "+306912592181",
- "countryIso": "GR",
- "groupId": 17,
- "optout": false,
- "dateAdded": "2021-07-10 13:03:09"
}, - {
- "id": "4743a365-1aba-4699-9646-acbac8fbb277",
- "phoneNumber": "+351912432772",
- "countryIso": "PT",
- "firstName": "Castro",
- "lastName": "Souza",
- "groupId": 17,
- "optout": false,
- "dateAdded": "2021-07-10 13:03:09"
}, - {
- "id": "f13aec28-13ae-4ff8-8f1e-0b96709f53c1",
- "phoneNumber": "+358412810699",
- "countryIso": "FI",
- "firstName": "Jouko",
- "lastName": "Sirviö",
- "groupId": 17,
- "optout": false,
- "dateAdded": "2021-07-10 13:03:09"
}, - {
- "id": "9810948f-68f7-4aba-98b7-35651bc9071d",
- "phoneNumber": "+4740885535",
- "countryIso": "NO",
- "firstName": "Sofia",
- "lastName": "Nordengen",
- "groupId": 17,
- "optout": false,
- "dateAdded": "2021-07-10 13:03:09"
}, - {
- "id": "7d73e474-b618-45de-9bf5-424948e8dd73",
- "phoneNumber": "+420601351061",
- "countryIso": "CZ",
- "firstName": "Františka",
- "lastName": "Valešová",
- "groupId": 17,
- "optout": false,
- "dateAdded": "2021-07-10 13:03:09"
}
]
}
Add contacts to group
Add contacts to a group if a valid identifier was provided.
Errors for POST /groups/{groupId}
HTTP code | Error code | Type | Description |
---|---|---|---|
400 | 1203 | invalid_param | The parameter phoneNumbers is empty or not set |
400 | 1208 | invalid_param | The parameter phoneNumbers must be an array of phone numbers |
400 | 1207 | invalid_param | The phone number provided is not valid |
400 | 1210 | invalid_param | The phone numbers provided are invalid |
404 | 1200 | not_found | Group ID not found |
Authorizations:
path Parameters
groupId required | integer <int32> Example: 2245 Identifier of a group of contacts |
Request Body schema: application/json
phoneNumbers required | Array of strings Array of phone numbers in international E.164 format or national format. If national format is provided, for better validation you must use the parameter |
allowInvalid | boolean Default: false Set value |
countryIso | string 2 characters Two-letter country ISO of the phone number you want to validate. If an international E.164 phone number format is provided the countryIso will be ignored |
Responses
Request samples
- Payload
- Shell + Curl
- Python + Requests
- Java + Okhttp
- Node + Native
- Javascript + Xhr
- Php + Curl
- Go + Native
- Ruby + Native
- Csharp + Restsharp
{- "phoneNumbers": [
- "+336129353",
- "+33612970283",
- "+3361211",
- "+43664187834",
- "+41781218472",
- "+351912110421",
- "+4915123473140",
- "+4915123595",
- "+4915123966046"
], - "allowInvalid": true
}
Response samples
- 200
- 400
- 401
- 403
- 404
- 405
- 429
- 500
{- "info": {
- "totalCost": 0.246,
- "totalValid": 6,
- "totalInvalid": 3,
- "totalDuplicates": 0,
- "totalPhoneNumbers": 9,
- "phoneNumbersByCountry": {
- "FR": 1,
- "AT": 1,
- "CH": 1,
- "PT": 1,
- "DE": 2
}, - "invalid": [
- "+336129353",
- "+3361211",
- "+4915123595"
]
}
}
Delete group
Deletes a group and all the contacts in the group
Errors for DELETE /groups/{groupId}
HTTP code | Error code | Type | Description |
---|---|---|---|
404 | 1200 | not_found | Group ID not found |
Authorizations:
path Parameters
groupId required | integer <int32> Example: 2245 Identifier of a group of contacts |
Responses
Request samples
- Shell + Curl
- Python + Requests
- Java + Okhttp
- Node + Native
- Javascript + Xhr
- Php + Curl
- Go + Native
- Ruby + Native
- Csharp + Restsharp
curl --request DELETE \ --url https://api.sms.cx/groups/2245 \ --header 'Authorization: Bearer REPLACE_ACCESS_TOKEN'
Response samples
- 200
- 401
- 403
- 404
- 405
- 429
- 500
{- "info": {
- "id": 19,
- "name": "Contacts 2021",
- "totalPhoneNumbers": 217
}
}
Empty group
Deletes all the contacts in a group.
Returns HTTP 204 No content
if group is already empty.
Errors for GET /groups/{groupId}/empty
HTTP code | Error code | Type | Description |
---|---|---|---|
404 | 1200 | not_found | Group ID not found |
Authorizations:
path Parameters
groupId required | integer <int32> Example: 2245 Identifier of a group of contacts |
Responses
Request samples
- Shell + Curl
- Python + Requests
- Java + Okhttp
- Node + Native
- Javascript + Xhr
- Php + Curl
- Go + Native
- Ruby + Native
- Csharp + Restsharp
curl --request GET \ --url https://api.sms.cx/groups/2245/empty \ --header 'Authorization: Bearer REPLACE_ACCESS_TOKEN'
Response samples
- 200
- 401
- 403
- 404
- 405
- 429
- 500
{- "info": {
- "id": 16,
- "name": "My group"
}
}
Export group to CSV
Exports the contacts from a group to a CSV file.
If the group is empty, an empty CSV file is returned (with first line headers).
Errors for GET /groups/{groupId}/csv
HTTP code | Error code | Type | Description |
---|---|---|---|
404 | 1200 | not_found | Group ID not found |
Authorizations:
path Parameters
groupId required | integer <int32> Example: 2245 Identifier of a group of contacts |
Responses
Request samples
- Shell + Curl
- Python + Requests
- Java + Okhttp
- Node + Native
- Javascript + Xhr
- Php + Curl
- Go + Native
- Ruby + Native
- Csharp + Restsharp
curl --request GET \ --url https://api.sms.cx/groups/2245/csv \ --header 'Authorization: Bearer REPLACE_ACCESS_TOKEN'
Response samples
- 200
- 401
- 403
- 404
- 405
- 429
- 500
Export group to XLSX
Exports the contacts from a group to a XLSX file (Excel).
If the group is empty, an empty XLSX file is returned (with first line headers).
Errors for GET /groups/{groupId}/xlsx
HTTP code | Error code | Type | Description |
---|---|---|---|
404 | 1200 | not_found | Group ID not found |
Authorizations:
path Parameters
groupId required | integer <int32> Example: 2245 Identifier of a group of contacts |
Responses
Request samples
- Shell + Curl
- Python + Requests
- Java + Okhttp
- Node + Native
- Javascript + Xhr
- Php + Curl
- Go + Native
- Ruby + Native
- Csharp + Restsharp
curl --request GET \ --url https://api.sms.cx/groups/2245/xlsx \ --header 'Authorization: Bearer REPLACE_ACCESS_TOKEN'
Response samples
- 200
- 401
- 403
- 404
- 405
- 429
- 500
Delete contact from group
Deletes a contact from a group if a valid group identifier was provided.
Errors for DELETE /groups/{groupId}/{phoneNumberId}
HTTP code | Error code | Type | Description |
---|---|---|---|
404 | 1200 | not_found | Group ID not found |
404 | 1202 | not_found | Phone number ID not found |
Authorizations:
path Parameters
groupId required | integer <int32> Example: 2245 Identifier of a group of contacts |
phoneNumberId required | string <uuid> 36 characters ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]... Example: 68aa4d9f-ee25-4a32-95d0-7272efe3b238 Identifier of the phone number |
Responses
Request samples
- Shell + Curl
- Python + Requests
- Java + Okhttp
- Node + Native
- Javascript + Xhr
- Php + Curl
- Go + Native
- Ruby + Native
- Csharp + Restsharp
curl --request DELETE \ --url https://api.sms.cx/groups/2245/68aa4d9f-ee25-4a32-95d0-7272efe3b238 \ --header 'Authorization: Bearer REPLACE_ACCESS_TOKEN'
Response samples
- 200
- 401
- 403
- 404
- 405
- 429
- 500
{- "info": {
- "id": "68aa4d9f-ee25-4a32-95d0-7272efe3b238",
- "phoneNumber": "+351912342743",
- "countryIso": "PT"
}
}
Update contact from group
Updates the specified contact by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
Returns HTTP 204 No content
if the parameters provided did not update the contact because the data was already the same.
Errors for PATCH /groups/{groupId}/{phoneNumberId}
HTTP code | Error code | Type | Description |
---|---|---|---|
404 | 1202 | not_found | Phone number ID not found |
400 | 1213 | invalid_param | At least one parameter required (phoneNumber, firstName, lastName, email, field1, field2, field3, field4, field5, customFields) |
400 | 1215 | duplicate_value | The phone number already exists |
Authorizations:
path Parameters
groupId required | integer <int32> Example: 2245 Identifier of a group of contacts |
phoneNumberId required | string <uuid> 36 characters ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]... Example: 68aa4d9f-ee25-4a32-95d0-7272efe3b238 Identifier of the phone number |
Request Body schema: application/json
phoneNumber | string Phone number in international E.164 format to replace the current phone number. |
firstName | string Data field for first name of the contact. Use placeholder {{firstName}} in text message for data replacement |
lastName | string Data field for last name of the contact. Use placeholder {{lastName}} in text message for data replacement |
string Data field for email of the contact. Use placeholder {{email}} in text message for data replacement | |
field1 | string Data field for extra information of the contact. Use placeholder {{field1}} in text message for data replacement |
field2 | string Data field for extra information of the contact. Use placeholder {{field2}} in text message for data replacement |
field3 | string Data field for extra information of the contact. Use placeholder {{field3}} in text message for data replacement |
field4 | string Data field for extra information of the contact. Use placeholder {{field4}} in text message for data replacement |
field5 | string Data field for extra information of the contact. Use placeholder {{field5}} in text message for data replacement |
object (CustomFieldsObj) An object with key-value pairs, where the key is the name of the custom field. An actual JSON object described by this might look like this:
Maximum 20 custom fields allowed. The data stored in the custom fields can be used in the text message by using the placeholder |
Responses
Request samples
- Payload
- Shell + Curl
- Python + Requests
- Java + Okhttp
- Node + Native
- Javascript + Xhr
- Php + Curl
- Go + Native
- Ruby + Native
- Csharp + Restsharp
{- "phoneNumber": "+447400772233"
}
Response samples
- 200
- 400
- 401
- 403
- 404
- 405
- 429
- 500
{- "info": {
- "id": "b94a5c40-f636-4990-9654-87a694eff084",
- "groupId": "20"
}
}
Get conversations list
Retrieves the list of existing conversations. The list is sorted by last reply date, with the most recent reply appearing first.
This endpoint should not return an error. If no conversations are available, an empty data object is returned.
Authorizations:
Responses
Request samples
- Shell + Curl
- Python + Requests
- Java + Okhttp
- Node + Native
- Javascript + Xhr
- Php + Curl
- Go + Native
- Ruby + Native
- Csharp + Restsharp
curl --request GET \ --url https://api.sms.cx/conversations \ --header 'Authorization: Bearer REPLACE_ACCESS_TOKEN'
Response samples
- 200
- 401
- 403
- 405
- 429
- 500
{- "data": [
- {
- "conversationId": "b72fefbc-0483-4def-9eb3-1df3c94ff99b",
- "phoneNumber": "+4915123163332",
- "countryIso": "DE",
- "firstName": "Hans",
- "lastName": "Schreiber",
- "unreadMessages": 3,
- "lastReply": "I confirm the apointment",
- "lastUpdate": "2021-06-18 17:00:00"
}, - {
- "conversationId": "228808a6-9b7b-4761-bb86-afd4b88823ae",
- "phoneNumber": "+447400761323",
- "countryIso": "GB",
- "firstName": "Alexandra",
- "lastName": "Adams",
- "unreadMessages": 1,
- "lastReply": "Hello. Can you provide more information about the travel packages?",
- "lastUpdate": "2021-06-18 14:00:00"
}
]
}
Get conversation
Retrieves the details of a conversation if a valid identifier was provided.
Errors for GET /conversations/{conversationId}
HTTP code | Error code | Type | Description |
---|---|---|---|
404 | 1180 | not_found | Conversation ID not found |
Authorizations:
path Parameters
conversationId required | string <uuid> 36 characters ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]... Example: c38fa60d-ce8f-4918-8b9d-d991bc44cb73 Identifier of the conversation |
Responses
Request samples
- Shell + Curl
- Python + Requests
- Java + Okhttp
- Node + Native
- Javascript + Xhr
- Php + Curl
- Go + Native
- Ruby + Native
- Csharp + Restsharp
curl --request GET \ --url https://api.sms.cx/conversations/c38fa60d-ce8f-4918-8b9d-d991bc44cb73 \ --header 'Authorization: Bearer REPLACE_ACCESS_TOKEN'
Response samples
- 200
- 401
- 403
- 404
- 405
- 429
- 500
{- "info": {
- "conversationId": "228808a6-9b7b-4761-bb86-afd4b88823ae",
- "phoneNumber": "+4915123163332",
- "countryIso": "DE",
- "firstName": "Katrin",
- "lastName": "Koenig"
}, - "data": [
- {
- "msgId": "189073f2-e8d2-4477-9f9b-22a88e25da79",
- "type": "SENT",
- "text": "Dear Katrin, to confirm your appointment at Dr. Engel at 11AM on 26 July please reply YES. To Cancel, reply NO, or call us +44133252488",
- "richMedia": { },
- "status": "DELIVERED",
- "cost": 0.041,
- "channel": "sms",
- "datetime": "2021-07-04 06:53:20"
}, - {
- "msgId": "f59fad77-974d-4622-b143-af091134c9be",
- "type": "RECEIVED",
- "text": "Yes",
- "richMedia": { },
- "status": "DELIVERED",
- "cost": 0,
- "channel": "sms",
- "datetime": "2021-07-04 06:56:18"
}, - {
- "msgId": "41af06a0-2f66-4079-937c-07a0e6c7cc2f",
- "type": "SENT",
- "text": "We received your confirmation. Don't forget to bring your insurance card. THank you",
- "richMedia": { },
- "status": "DELIVERED",
- "cost": 0.041,
- "channel": "sms",
- "datetime": "2021-07-04 06:57:12"
}
]
}
Mark conversation as read
Marks a conversation as read
Errors for GET /conversations/{conversationId}/read
HTTP code | Error code | Type | Description |
---|---|---|---|
404 | 1180 | not_found | Conversation ID not found |
Authorizations:
path Parameters
conversationId required | string <uuid> 36 characters ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]... Example: c38fa60d-ce8f-4918-8b9d-d991bc44cb73 Identifier of the conversation |
Responses
Request samples
- Shell + Curl
- Python + Requests
- Java + Okhttp
- Node + Native
- Javascript + Xhr
- Php + Curl
- Go + Native
- Ruby + Native
- Csharp + Restsharp
curl --request GET \ --url https://api.sms.cx/conversations/c38fa60d-ce8f-4918-8b9d-d991bc44cb73/read \ --header 'Authorization: Bearer REPLACE_ACCESS_TOKEN'
Response samples
- 200
- 401
- 403
- 404
- 405
- 429
- 500
{- "info": {
- "id": "228808a6-9b7b-4761-bb86-afd4b88823ae"
}
}
Send conversation reply via SMS
Sends a reply to a conversation using sms channel.
Errors for POST /conversations/{conversationId}/sms
HTTP code | Error code | Type | Description |
---|---|---|---|
404 | 1180 | not_found | Conversation ID not found |
400 | 1801 | invalid_param | The text message is empty or parameter text not set |
400 | 1802 | invalid_param | The parameter text is invalid |
400 | 1111 | invalid_param | Idempotency Id provided is not a valid UUID (v1-v5) |
Authorizations:
path Parameters
conversationId required | string <uuid> 36 characters ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]... Example: c38fa60d-ce8f-4918-8b9d-d991bc44cb73 Identifier of the conversation |
Request Body schema: application/json
text required | string The reply text message |
Responses
Request samples
- Payload
- Shell + Curl
- Python + Requests
- Java + Okhttp
- Node + Native
- Javascript + Xhr
- Php + Curl
- Go + Native
- Ruby + Native
- Csharp + Restsharp
{- "text": "Text message with reply"
}
Response samples
- 200
- 400
- 401
- 403
- 404
- 405
- 429
- 500
{- "info": {
- "campaignId": "61fc78dd-5540-412a-8c6f-82a49a8b393f",
- "totalPhoneNumbers": 1,
- "totalValid": 1,
- "totalInvalid": 0,
- "totalCost": 0.041,
- "totalParts": 1,
- "phoneNumbersByCountry": {
- "DE": 1
}, - "scheduled": false
}, - "data": {
- "msgId": "61fc78dd-5540-412a-8c6f-82a49a8b393f",
- "status": "ACCEPTED",
- "createdAt": "2021-07-10 20:36:54",
- "cost": 0.041,
- "to": "+4915123163332",
- "countryIso": "DE",
- "from": "InfoText",
- "text": "Thank you for your confirmation",
- "parts": 1,
- "textAnalysis": {
- "length": 19,
- "unicode": false,
- "parts": 1
}
}
}
Send conversation reply via Viber
Sends a reply to a conversation using viber channel.
Errors for POST /conversations/{conversationId}/viber
HTTP code | Error code | Type | Description |
---|---|---|---|
404 | 1180 | not_found | Conversation ID not found |
403 | 1181 | access_denied | Cannot reply with channel Viber. More than 24 hours since user reply |
400 | 1801 | invalid_param | The text message is empty or parameter text not set |
400 | 1802 | invalid_param | The parameter text is invalid |
400 | 1811 | invalid_param | Text message too long (max 1000 characters) |
400 | 1111 | invalid_param | Idempotency Id provided is not a valid UUID (v1-v5) |
Authorizations:
path Parameters
conversationId required | string <uuid> 36 characters ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]... Example: c38fa60d-ce8f-4918-8b9d-d991bc44cb73 Identifier of the conversation |
Request Body schema: application/json
text required | string <= 1000 characters The reply text message |
richMedia required | object |
Responses
Request samples
- Payload
- Shell + Curl
- Python + Requests
- Java + Okhttp
- Node + Native
- Javascript + Xhr
- Php + Curl
- Go + Native
- Ruby + Native
- Csharp + Restsharp
{- "text": "Please give us more details",
- "richMedia": { }
}
Response samples
- 200
- 400
- 401
- 403
- 404
- 405
- 429
- 500
{- "info": {
- "campaignId": "a65388f1-558f-4034-8bc6-825c41d86637",
- "totalPhoneNumbers": 1,
- "totalValid": 1,
- "totalInvalid": 0,
- "totalCost": 0.021,
- "totalParts": 1,
- "phoneNumbersByCountry": {
- "DE": 1
}, - "scheduled": false
}, - "data": {
- "msgId": "a65388f1-558f-4034-8bc6-825c41d86637",
- "status": "ACCEPTED",
- "createdAt": "2021-07-11 05:16:17",
- "cost": 0.021,
- "to": "+4915123163332",
- "countryIso": "DE",
- "from": "InfoText",
- "text": "Please give us more details",
- "parts": 1
}
}
Send conversation reply via Whatsapp
Sends a reply to a conversation using whatsapp channel.
Errors for POST /conversations/{conversationId}/whatsapp
HTTP code | Error code | Type | Description |
---|---|---|---|
404 | 1180 | not_found | Conversation ID not found |
403 | 1182 | access_denied | Cannot reply with channel Whatsapp. More than 24 hours since user reply |
400 | 1801 | invalid_param | The text message is empty or parameter text not set |
400 | 1802 | invalid_param | The parameter text is invalid |
400 | 1811 | invalid_param | Text message too long (max 1000 characters) |
400 | 1111 | invalid_param | Idempotency Id provided is not a valid UUID (v1-v5) |
Authorizations:
path Parameters
conversationId required | string <uuid> 36 characters ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]... Example: c38fa60d-ce8f-4918-8b9d-d991bc44cb73 Identifier of the conversation |
Request Body schema: application/json
text required | string <= 1000 characters The reply text message |
richMedia required | object |
Responses
Request samples
- Payload
- Shell + Curl
- Python + Requests
- Java + Okhttp
- Node + Native
- Javascript + Xhr
- Php + Curl
- Go + Native
- Ruby + Native
- Csharp + Restsharp
{- "text": "Please give us more details",
- "richMedia": { }
}
Response samples
- 200
- 400
- 401
- 403
- 404
- 405
- 429
- 500
{- "info": {
- "campaignId": "69bd66d4-7b83-426f-af42-3b9a359d4d33",
- "totalPhoneNumbers": 1,
- "totalValid": 1,
- "totalInvalid": 0,
- "totalCost": 0.026,
- "totalParts": 1,
- "phoneNumbersByCountry": {
- "DE": 1
}, - "scheduled": false
}, - "data": {
- "msgId": "69bd66d4-7b83-426f-af42-3b9a359d4d33",
- "status": "ACCEPTED",
- "createdAt": "2021-07-11 05:21:48",
- "cost": 0.021,
- "to": "+4915123163332",
- "countryIso": "DE",
- "from": "InfoText",
- "text": "Please give us more details",
- "parts": 1
}
}
Get advanced report
Retrieves the report for the specified filters.
The only required parameters are the dates filters: period
parameter or start_date
and end_date
.
If no data is available for the report, an empty data object is returned.
Errors for GET /reports
HTTP code | Error code | Type | Description |
---|---|---|---|
400 | 1820 | invalid_param | The parameter period is not a valid date (format Y-m or Y) |
400 | 1821 | invalid_param | The parameter start_date is not a valid date |
400 | 1822 | invalid_param | The parameter end_date is not a valid date |
400 | 1823 | invalid_param | The end date is before the start date |
400 | 1824 | invalid_param | No period parameter or interval (start_date , end_date ) |
400 | 1825 | invalid_param | The parameter source is not valid |
400 | 1826 | invalid_param | The parameter delivery_report is not valid (delivered, failed or sent) |
400 | 1827 | invalid_param | The parameter country_iso is not for a valid country |
Authorizations:
query Parameters
period required | string Example: period=2021-07 Period for the requested report in format Y-M or Y |
start_date required | string Example: start_date=2021-03-01 The start date of the report in format Y-M-D |
end_date required | string Example: end_date=2021-04-30 The end date of the report in format Y-M-D |
channel | string Enum: "sms" "viber" "whatsapp" "multichannel" Example: channel=sms Channel of the sent messages |
source | string Enum: "api" "excel" "webapp" "smpp" "plugin" "alerts" Example: source=api Source of the sent messages |
delivery_report | string Enum: "delivered" "failed" "sent" "accepted" "rejected" "scheduled" Example: delivery_report=delivered |
country_iso | string Example: country_iso=fr Two-letter country code defined in ISO-3166 alpha 2 standard (case insensitive) |
short_response | boolean Default: false If set to true, it will return the full |
limit | integer <int32> Default: 500 Example: limit=100 A limit on the number of objects to be returned |
next | string Example: next=NTM2NTA The next token used to retrieve additional data |
previous | string Example: previous=NTQxNTA The previous token used to retrieve additional data |
Responses
Request samples
- Shell + Curl
- Python + Requests
- Java + Okhttp
- Node + Native
- Javascript + Xhr
- Php + Curl
- Go + Native
- Ruby + Native
- Csharp + Restsharp
curl --request GET \ --url https://api.sms.cx/reports \ --header 'Authorization: Bearer REPLACE_ACCESS_TOKEN'
Response samples
- 200
- 400
- 401
- 403
- 405
- 429
- 500
{- "info": {
- "totalPhoneNumbers": 10,
- "totalCost": 0.41,
- "totalParts": 10
}, - "data": [
- {
- "msgId": "6b32da60-71dc-42d1-a93c-99687c34e10f",
- "status": "DELIVERED",
- "statusCode": 1,
- "inQuietHours": false,
- "createdAt": "2021-05-10 06:31:30",
- "updatedAt": "2021-05-10 06:31:33",
- "cost": 0.041,
- "to": "+4915123520469",
- "countryIso": "DE",
- "from": "InfoText",
- "source": "api",
- "channel": "sms",
- "text": "This is my text message",
- "textAnalysis": {
- "length": 4,
- "unicode": false,
- "parts": 1
}
}, - {
- "msgId": "f8a8ff94-8a12-4350-a166-52ef1294a1d7",
- "status": "DELIVERED",
- "statusCode": 1,
- "inQuietHours": false,
- "createdAt": "2021-05-10 06:31:34",
- "updatedAt": "2021-05-10 06:31:42",
- "cost": 0.041,
- "to": "+4915123937293",
- "countryIso": "DE",
- "from": "InfoText",
- "source": "api",
- "channel": "sms",
- "text": "This is my text message",
- "textAnalysis": {
- "length": 4,
- "unicode": false,
- "parts": 1
}
}, - {
- "msgId": "72924f22-2c80-44f4-b31d-8775f7b01e8e",
- "status": "DELIVERED",
- "statusCode": 1,
- "inQuietHours": false,
- "createdAt": "2021-05-10 06:31:34",
- "updatedAt": "2021-05-10 06:31:39",
- "cost": 0.041,
- "to": "+4915123391603",
- "countryIso": "DE",
- "from": "InfoText",
- "source": "api",
- "channel": "sms",
- "text": "This is my text message",
- "textAnalysis": {
- "length": 4,
- "unicode": false,
- "parts": 1
}
}, - {
- "msgId": "fad1ce1f-7dad-406b-b9fd-6c2d079cb893",
- "status": "DELIVERED",
- "statusCode": 1,
- "inQuietHours": false,
- "createdAt": "2021-05-10 06:31:34",
- "updatedAt": "2021-05-10 06:31:39",
- "cost": 0.041,
- "to": "+4915123243106",
- "countryIso": "DE",
- "from": "InfoText",
- "source": "api",
- "channel": "sms",
- "text": "This is my text message",
- "textAnalysis": {
- "length": 4,
- "unicode": false,
- "parts": 1
}
}, - {
- "msgId": "46a1c084-55e3-444d-99f8-7f87c9f150f7",
- "status": "DELIVERED",
- "statusCode": 1,
- "inQuietHours": false,
- "createdAt": "2021-05-10 06:31:34",
- "updatedAt": "2021-05-10 06:31:42",
- "cost": 0.041,
- "to": "+4915123772462",
- "countryIso": "DE",
- "from": "InfoText",
- "source": "api",
- "channel": "sms",
- "text": "This is my text message",
- "textAnalysis": {
- "length": 4,
- "unicode": false,
- "parts": 1
}
}, - {
- "msgId": "36a71c84-f9e9-40fb-987e-a28ff1f97b40",
- "status": "DELIVERED",
- "statusCode": 1,
- "inQuietHours": false,
- "createdAt": "2021-05-10 06:31:34",
- "updatedAt": "2021-05-10 06:31:41",
- "cost": 0.041,
- "to": "+4915123534665",
- "countryIso": "DE",
- "from": "InfoText",
- "source": "api",
- "channel": "sms",
- "text": "This is my text message",
- "textAnalysis": {
- "length": 4,
- "unicode": false,
- "parts": 1
}
}, - {
- "msgId": "4907cd1b-9feb-42d5-b76e-bd07c7cdfcff",
- "status": "DELIVERED",
- "statusCode": 1,
- "inQuietHours": false,
- "createdAt": "2021-05-10 06:31:34",
- "updatedAt": "2021-05-10 06:31:41",
- "cost": 0.041,
- "to": "+4915123200148",
- "countryIso": "DE",
- "from": "InfoText",
- "source": "api",
- "channel": "sms",
- "text": "This is my text message",
- "textAnalysis": {
- "length": 4,
- "unicode": false,
- "parts": 1
}
}, - {
- "msgId": "7ebf1e12-b6be-4cd4-b6f7-d0d4bd8b240c",
- "status": "FAILED",
- "statusCode": 2,
- "errorCode": 60,
- "inQuietHours": false,
- "createdAt": "2021-05-10 06:31:35",
- "updatedAt": "2021-05-10 06:31:39",
- "cost": 0.041,
- "to": "+4915123344744",
- "countryIso": "DE",
- "from": "InfoText",
- "source": "api",
- "channel": "sms",
- "text": "This is my text message",
- "textAnalysis": {
- "length": 4,
- "unicode": false,
- "parts": 1
}
}, - {
- "msgId": "0b849d80-5c54-4cb8-bef4-196ce132712d",
- "status": "DELIVERED",
- "statusCode": 1,
- "inQuietHours": false,
- "createdAt": "2021-05-10 06:31:35",
- "updatedAt": "2021-05-10 06:31:39",
- "cost": 0.041,
- "to": "+4915123261210",
- "countryIso": "DE",
- "from": "InfoText",
- "source": "api",
- "channel": "sms",
- "text": "This is my text message",
- "textAnalysis": {
- "length": 4,
- "unicode": false,
- "parts": 1
}
}, - {
- "msgId": "ab21c94b-0bcb-4835-8b94-77b52f3d6222",
- "status": "DELIVERED",
- "statusCode": 1,
- "inQuietHours": false,
- "createdAt": "2021-05-10 06:31:35",
- "updatedAt": "2021-05-10 06:31:39",
- "cost": 0.041,
- "to": "+4915123926188",
- "countryIso": "DE",
- "from": "InfoText",
- "source": "api",
- "channel": "sms",
- "text": "This is my text message",
- "textAnalysis": {
- "length": 4,
- "unicode": false,
- "parts": 1
}
}
]
}
Export advanced report to CSV
Exports the report for for the specified filters to a CSV file.
The only required parameters are the dates filters: period
parameter or start_date
and end_date
.
If no data is available for the report, an empty CSV file is returned (with first line headers).
Errors for GET /reports/csv
HTTP code | Error code | Type | Description |
---|---|---|---|
400 | 1820 | invalid_param | The parameter period is not a valid date (format Y-m or Y) |
400 | 1821 | invalid_param | The parameter start_date is not a valid date |
400 | 1822 | invalid_param | The parameter end_date is not a valid date |
400 | 1823 | invalid_param | The end date is before the start date |
400 | 1824 | invalid_param | No period parameter or interval (start_date , end_date ) |
400 | 1825 | invalid_param | The parameter source is not valid |
400 | 1826 | invalid_param | The parameter delivery_report is not valid (delivered, failed or sent) |
400 | 1827 | invalid_param | The parameter country_iso is not for a valid country |
400 | 1828 | invalid_param | The parameter channel is not valid (sms, viber, whatsapp, multichannel) |
Authorizations:
query Parameters
period required | string Example: period=2021-07 Period for the requested report in format Y-M or Y |
start_date required | string Example: start_date=2021-03-01 The start date of the report in format Y-M-D |
end_date required | string Example: end_date=2021-04-30 The end date of the report in format Y-M-D |
channel | string Enum: "sms" "viber" "whatsapp" "multichannel" Example: channel=sms Channel of the sent messages |
source | string Enum: "api" "excel" "webapp" "smpp" "plugin" "alerts" Example: source=api Source of the sent messages |
delivery_report | string Enum: "delivered" "failed" "sent" "accepted" "rejected" "scheduled" Example: delivery_report=delivered |
country_iso | string Example: country_iso=fr Two-letter country code defined in ISO-3166 alpha 2 standard (case insensitive) |
limit | integer <int32> Default: 500 Example: limit=100 A limit on the number of objects to be returned |
Responses
Request samples
- Shell + Curl
- Python + Requests
- Java + Okhttp
- Node + Native
- Javascript + Xhr
- Php + Curl
- Go + Native
- Ruby + Native
- Csharp + Restsharp
curl --request GET \ --url 'https://api.sms.cx/reports/csv?period=2021-07&start_date=2021-03-01&end_date=2021-04-30&channel=sms&source=api&delivery_report=delivered&country_iso=fr&limit=10' \ --header 'Authorization: Bearer REPLACE_ACCESS_TOKEN'
Response samples
- 200
- 400
- 401
- 403
- 405
- 429
- 500
Export advanced report to XLSX
Exports the report for for the specified filters to a XLSX file (Excel).
The only required parameters are the dates filters: period
parameter or start_date
and end_date
.
If no data is available for the report, an empty XLSX file is returned (with first line headers).
Errors for GET /reports/xlsx
HTTP code | Error code | Type | Description |
---|---|---|---|
400 | 1820 | invalid_param | The parameter period is not a valid date (format Y-m or Y) |
400 | 1821 | invalid_param | The parameter start_date is not a valid date |
400 | 1822 | invalid_param | The parameter end_date is not a valid date |
400 | 1823 | invalid_param | The end date is before the start date |
400 | 1824 | invalid_param | No period parameter or interval (start_date , end_date ) |
400 | 1825 | invalid_param | The parameter source is not valid |
400 | 1826 | invalid_param | The parameter delivery_report is not valid (delivered, failed or sent) |
400 | 1827 | invalid_param | The parameter country_iso is not for a valid country |
400 | 1828 | invalid_param | The parameter channel is not valid (sms, viber, whatsapp, multichannel) |
Authorizations:
query Parameters
period required | string Example: period=2021-07 Period for the requested report in format Y-M or Y |
start_date required | string Example: start_date=2021-03-01 The start date of the report in format Y-M-D |
end_date required | string Example: end_date=2021-04-30 The end date of the report in format Y-M-D |
channel | string Enum: "sms" "viber" "whatsapp" "multichannel" Example: channel=sms Channel of the sent messages |
source | string Enum: "api" "excel" "webapp" "smpp" "plugin" "alerts" Example: source=api Source of the sent messages |
delivery_report | string Enum: "delivered" "failed" "sent" "accepted" "rejected" "scheduled" Example: delivery_report=delivered |
country_iso | string Example: country_iso=fr Two-letter country code defined in ISO-3166 alpha 2 standard (case insensitive) |
limit | integer <int32> Default: 500 Example: limit=100 A limit on the number of objects to be returned |
Responses
Request samples
- Shell + Curl
- Python + Requests
- Java + Okhttp
- Node + Native
- Javascript + Xhr
- Php + Curl
- Go + Native
- Ruby + Native
- Csharp + Restsharp
curl --request GET \ --url 'https://api.sms.cx/reports/xlsx?period=2021-07&start_date=2021-03-01&end_date=2021-04-30&channel=sms&source=api&delivery_report=delivered&country_iso=fr&limit=10' \ --header 'Authorization: Bearer REPLACE_ACCESS_TOKEN'
Response samples
- 200
- 400
- 401
- 403
- 405
- 429
- 500
Get report for single SMS or Viber or Whatsapp or Multichannel
Returns the details of a single message if a valid identifier was provided.
Errors for GET /reports/single/{msgId}
HTTP code | Error code | Type | Description |
---|---|---|---|
404 | 1160 | not_found | Campaign ID or msg ID provided was not found |
400 | 1165 | invalid_param | Campaign ID or msg ID provided is not valid |
Authorizations:
path Parameters
msgId required | string <uuid> 36 characters ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]... Example: 9eeed792-9c8c-463c-a8e2-43ebf4494c02 Identifier of a sent message |
Responses
Request samples
- Shell + Curl
- Python + Requests
- Java + Okhttp
- Node + Native
- Javascript + Xhr
- Php + Curl
- Go + Native
- Ruby + Native
- Csharp + Restsharp
curl --request GET \ --url https://api.sms.cx/reports/single/9eeed792-9c8c-463c-a8e2-43ebf4494c02 \ --header 'Authorization: Bearer REPLACE_ACCESS_TOKEN'
Response samples
- 200
- 400
- 401
- 403
- 404
- 405
- 429
- 500
{- "data": {
- "msgId": "267e459f-0a16-4b21-86c0-cbdc77163d13",
- "status": "DELIVERED",
- "statusCode": 1,
- "inQuietHours": false,
- "createdAt": "2021-07-11 06:13:49",
- "cost": 0.041,
- "to": "+4915123138440",
- "countryIso": "DE",
- "from": "InfoText",
- "text": "Hello ,\r\nRedeem this voucher in the next 30 days and you will get 30% discount off all Summer Fashion https://en.ax/03y4",
- "source": "campaigns",
- "channel": "sms",
- "textAnalysis": {
- "length": 121,
- "unicode": false,
- "parts": 1
}
}
}
Get list of sent campaigns
Returns a list of sent Campaigns, with the most recent appearing first.
If no data is available, an empty data object is returned.
Authorizations:
query Parameters
delivery_reports | boolean Example: delivery_reports=true The response will contain an object data.status with delivery report summary for each campaign |
source | string Enum: "api" "excel" "webapp" "smpp" "plugin" "alerts" Example: source=api Source of the sent messages |
limit | integer <int32> Default: 500 Example: limit=100 A limit on the number of objects to be returned |
next | string Example: next=NTM2NTA The next token used to retrieve additional data |
previous | string Example: previous=NTQxNTA The previous token used to retrieve additional data |
Responses
Request samples
- Shell + Curl
- Python + Requests
- Java + Okhttp
- Node + Native
- Javascript + Xhr
- Php + Curl
- Go + Native
- Ruby + Native
- Csharp + Restsharp
curl --request GET \ --url https://api.sms.cx/reports/campaigns \ --header 'Authorization: Bearer REPLACE_ACCESS_TOKEN'
Response samples
- 200
- 401
- 403
- 405
- 429
- 500
{- "info": {
- "totalCampaigns": 3
}, - "data": [
- {
- "id": "83478678-126c-4172-b760-1964f6774f47",
- "name": "Campaign #54",
- "from": "InfoText",
- "groups": [
- {
- "id": 15,
- "name": "My group 1",
- "phoneNumbers": 905
}
], - "totalPhoneNumers": 905,
- "parts": 905,
- "cost": 37.105,
- "text": "Hello {{firstName}}. This is text message {{optoutLink}}",
- "source": "campaigns",
- "channel": "sms",
- "datetimeAdded": "2021-07-05 14:58:07",
- "status": {
- "accepted": 5,
- "delivered": 890,
- "failed": 10,
- "scheduled": 0,
- "noCoverage": 0
}
}, - {
- "id": "b7c954ea-f0e9-4acf-96c9-1f87fe898901",
- "name": "Campaign #67",
- "from": "InfoText",
- "groups": [
- {
- "id": 18,
- "name": "My group 3",
- "phoneNumbers": 1254
}
], - "totalPhoneNumers": 1254,
- "parts": 1254,
- "cost": 51.414,
- "text": "This is my message",
- "source": "campaigns",
- "channel": "sms",
- "datetimeAdded": "2021-07-05 14:57:59",
- "status": {
- "accepted": 67,
- "delivered": 1150,
- "failed": 37,
- "scheduled": 0,
- "noCoverage": 0
}
}, - {
- "id": "07e27405-b866-48ee-8f19-7e905822eab1",
- "name": "Campaign #104",
- "from": "InfoText",
- "groups": [
- {
- "id": 12,
- "name": "Group 4",
- "phoneNumbers": 277
}
], - "totalPhoneNumers": 277,
- "parts": 277,
- "cost": 11.357,
- "text": "Text message",
- "source": "campaigns",
- "channel": "sms",
- "datetimeAdded": "2021-06-21 20:13:11",
- "status": {
- "accepted": 3,
- "delivered": 270,
- "failed": 4,
- "scheduled": 0,
- "noCoverage": 0
}
}
]
}
Get campaign report
Returns the details of a sent campaign if a valid identifier was provided.
Errors for GET /reports/campaigns/{campaignId}
HTTP code | Error code | Type | Description |
---|---|---|---|
404 | 1150 | not_found | Campaign ID provided was not found |
400 | 1155 | invalid_param | Campaign ID provided is not valid |
Authorizations:
path Parameters
campaignId required | string <uuid> 36 characters ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]... Example: 4baf0298-0c21-4df1-a60a-6e3476e95e0b Identifier of a sent campaign |
query Parameters
short_response | boolean Default: false If set to true, it will return the full |
limit | integer <int32> Default: 500 Example: limit=100 A limit on the number of objects to be returned |
next | string Example: next=NTM2NTA The next token used to retrieve additional data |
previous | string Example: previous=NTQxNTA The previous token used to retrieve additional data |
Responses
Request samples
- Shell + Curl
- Python + Requests
- Java + Okhttp
- Node + Native
- Javascript + Xhr
- Php + Curl
- Go + Native
- Ruby + Native
- Csharp + Restsharp
curl --request GET \ --url https://api.sms.cx/reports/campaigns/4baf0298-0c21-4df1-a60a-6e3476e95e0b \ --header 'Authorization: Bearer REPLACE_ACCESS_TOKEN'
Response samples
- 200
- 400
- 401
- 403
- 404
- 405
- 429
- 500
{- "info": {
- "campaignId": "4baf0298-0c21-4df1-a60a-6e3476e95e0b",
- "campaignName": "Campaign #70",
- "totalPhoneNumbers": 35,
- "totalCost": 1.434,
- "totalParts": 35,
- "channel": "sms"
}, - "data": [
- {
- "msgId": "9eeed792-9c8c-463c-a8e2-43ebf4494c02",
- "status": "DELIVERED",
- "statusCode": 1,
- "inQuietHours": false,
- "createdAt": "2021-07-11 06:13:49",
- "cost": 0.041,
- "to": "+34612306860",
- "countryIso": "ES",
- "from": "InfoText",
- "text": "Hello ,\nRedeem this voucher in the next 30 days and you will get 30% discount off all Summer Fashion. Optout - https://en.ax/03y4",
- "source": "campaigns",
- "channel": "sms",
- "textAnalysis": {
- "length": 121,
- "unicode": false,
- "parts": 1
}
}, - {
- "msgId": "9995cd50-6cbf-4a5d-ace1-96cc6f1e8e10",
- "status": "DELIVERED",
- "statusCode": 1,
- "inQuietHours": false,
- "createdAt": "2021-07-11 06:13:49",
- "cost": 0.041,
- "to": "+358412123296",
- "countryIso": "FI",
- "from": "InfoText",
- "text": "Hello ,\nRedeem this voucher in the next 30 days and you will get 30% discount off all Summer Fashion. Optout - https://en.ax/03y4",
- "source": "campaigns",
- "channel": "sms",
- "textAnalysis": {
- "length": 121,
- "unicode": false,
- "parts": 1
}
}, - {
- "msgId": "4e366a59-e93a-41e1-bf49-c361e7faf5bb",
- "status": "DELIVERED",
- "statusCode": 1,
- "inQuietHours": false,
- "createdAt": "2021-07-11 06:13:49",
- "cost": 0.041,
- "to": "+35948820315",
- "countryIso": "BG",
- "from": "InfoText",
- "text": "Hello ,\nRedeem this voucher in the next 30 days and you will get 30% discount off all Summer Fashion. Optout - https://en.ax/03y4",
- "source": "campaigns",
- "channel": "sms",
- "textAnalysis": {
- "length": 121,
- "unicode": false,
- "parts": 1
}
}, - {
- "msgId": "9b1c47f8-55a2-4d19-a743-dab57df7202d",
- "status": "DELIVERED",
- "statusCode": 1,
- "inQuietHours": false,
- "createdAt": "2021-07-11 06:13:49",
- "cost": 0.041,
- "to": "+420601772630",
- "countryIso": "CZ",
- "from": "InfoText",
- "text": "Hello ,\nRedeem this voucher in the next 30 days and you will get 30% discount off all Summer Fashion. Optout - https://en.ax/03y4",
- "source": "campaigns",
- "channel": "sms",
- "textAnalysis": {
- "length": 121,
- "unicode": false,
- "parts": 1
}
}, - {
- "msgId": "e53ae828-b7f8-43f0-9251-2c55b479740b",
- "status": "DELIVERED",
- "statusCode": 1,
- "inQuietHours": false,
- "createdAt": "2021-07-11 06:13:49",
- "cost": 0.041,
- "to": "+34612186564",
- "countryIso": "ES",
- "from": "InfoText",
- "text": "Hello ,\nRedeem this voucher in the next 30 days and you will get 30% discount off all Summer Fashion. Optout - https://en.ax/03y4",
- "source": "campaigns",
- "channel": "sms",
- "textAnalysis": {
- "length": 121,
- "unicode": false,
- "parts": 1
}
}, - {
- "msgId": "bfa93ca6-d771-4dd9-bb5f-29c7c32a86ec",
- "status": "DELIVERED",
- "statusCode": 1,
- "inQuietHours": false,
- "createdAt": "2021-07-11 06:13:49",
- "cost": 0.041,
- "to": "+420601942223",
- "countryIso": "CZ",
- "from": "InfoText",
- "text": "Hello ,\nRedeem this voucher in the next 30 days and you will get 30% discount off all Summer Fashion. Optout - https://en.ax/03y4",
- "source": "campaigns",
- "channel": "sms",
- "textAnalysis": {
- "length": 121,
- "unicode": false,
- "parts": 1
}
}, - {
- "msgId": "ac9244ae-da29-423b-ae51-dbe6d7d6c182",
- "status": "DELIVERED",
- "statusCode": 1,
- "inQuietHours": false,
- "createdAt": "2021-07-11 06:13:49",
- "cost": 0.041,
- "to": "+43664578306",
- "countryIso": "AT",
- "from": "InfoText",
- "text": "Hello ,\nRedeem this voucher in the next 30 days and you will get 30% discount off all Summer Fashion. Optout - https://en.ax/03y4",
- "source": "campaigns",
- "channel": "sms",
- "textAnalysis": {
- "length": 121,
- "unicode": false,
- "parts": 1
}
}, - {
- "msgId": "42fa3c04-dcf1-4ae6-8966-37ff56156ba3",
- "status": "DELIVERED",
- "statusCode": 1,
- "inQuietHours": false,
- "createdAt": "2021-07-11 06:13:49",
- "cost": 0.041,
- "to": "+41781479547",
- "countryIso": "CH",
- "from": "InfoText",
- "text": "Hello ,\nRedeem this voucher in the next 30 days and you will get 30% discount off all Summer Fashion. Optout - https://en.ax/03y4",
- "source": "campaigns",
- "channel": "sms",
- "textAnalysis": {
- "length": 121,
- "unicode": false,
- "parts": 1
}
}, - {
- "msgId": "adda74fc-de43-4bc3-aa18-0ce2c03523e2",
- "status": "DELIVERED",
- "statusCode": 1,
- "inQuietHours": false,
- "createdAt": "2021-07-11 06:13:49",
- "cost": 0.041,
- "to": "+34612234464",
- "countryIso": "ES",
- "from": "InfoText",
- "text": "Hello ,\nRedeem this voucher in the next 30 days and you will get 30% discount off all Summer Fashion. Optout - https://en.ax/03y4",
- "source": "campaigns",
- "channel": "sms",
- "textAnalysis": {
- "length": 121,
- "unicode": false,
- "parts": 1
}
}, - {
- "msgId": "a7a8caec-d40c-465c-b27b-fc55dc940815",
- "status": "DELIVERED",
- "statusCode": 1,
- "inQuietHours": false,
- "createdAt": "2021-07-11 06:13:49",
- "cost": 0.041,
- "to": "+420601814049",
- "countryIso": "CZ",
- "from": "InfoText",
- "text": "Hello ,\nRedeem this voucher in the next 30 days and you will get 30% discount off all Summer Fashion. Optout - https://en.ax/03y4",
- "source": "campaigns",
- "channel": "sms",
- "textAnalysis": {
- "length": 121,
- "unicode": false,
- "parts": 1
}
}, - {
- "msgId": "b977d684-1e0f-43ba-a18e-4c8bb0a54fe2",
- "status": "DELIVERED",
- "statusCode": 1,
- "inQuietHours": false,
- "createdAt": "2021-07-11 06:13:49",
- "cost": 0.041,
- "to": "+4915123163332",
- "countryIso": "DE",
- "from": "InfoText",
- "text": "Hello ,\nRedeem this voucher in the next 30 days and you will get 30% discount off all Summer Fashion. Optout - https://en.ax/03y4",
- "source": "campaigns",
- "channel": "sms",
- "textAnalysis": {
- "length": 121,
- "unicode": false,
- "parts": 1
}
}, - {
- "msgId": "e7708291-84cb-4ccd-87ed-20837f0e6de5",
- "status": "DELIVERED",
- "statusCode": 1,
- "inQuietHours": false,
- "createdAt": "2021-07-11 06:13:49",
- "cost": 0.041,
- "to": "+41781142377",
- "countryIso": "CH",
- "from": "InfoText",
- "text": "Hello ,\nRedeem this voucher in the next 30 days and you will get 30% discount off all Summer Fashion. Optout - https://en.ax/03y4",
- "source": "campaigns",
- "channel": "sms",
- "textAnalysis": {
- "length": 121,
- "unicode": false,
- "parts": 1
}
}, - {
- "msgId": "85017a74-351b-4fa9-aef8-41da2759fd35",
- "status": "DELIVERED",
- "statusCode": 1,
- "inQuietHours": false,
- "createdAt": "2021-07-11 06:13:49",
- "cost": 0.041,
- "to": "+358412312158",
- "countryIso": "FI",
- "from": "InfoText",
- "text": "Hello ,\nRedeem this voucher in the next 30 days and you will get 30% discount off all Summer Fashion. Optout - https://en.ax/03y4",
- "source": "campaigns",
- "channel": "sms",
- "textAnalysis": {
- "length": 121,
- "unicode": false,
- "parts": 1
}
}, - {
- "msgId": "00724b01-3d0d-4929-9235-af80fea8741c",
- "status": "DELIVERED",
- "statusCode": 1,
- "inQuietHours": false,
- "createdAt": "2021-07-11 06:13:49",
- "cost": 0.041,
- "to": "+4915123671435",
- "countryIso": "DE",
- "from": "InfoText",
- "text": "Hello ,\nRedeem this voucher in the next 30 days and you will get 30% discount off all Summer Fashion. Optout - https://en.ax/03y4",
- "source": "campaigns",
- "channel": "sms",
- "textAnalysis": {
- "length": 121,
- "unicode": false,
- "parts": 1
}
}, - {
- "msgId": "03d555c1-321b-4aa7-b3f6-52f029ade546",
- "status": "DELIVERED",
- "statusCode": 1,
- "inQuietHours": false,
- "createdAt": "2021-07-11 06:13:49",
- "cost": 0.041,
- "to": "+35948639593",
- "countryIso": "BG",
- "from": "InfoText",
- "text": "Hello ,\nRedeem this voucher in the next 30 days and you will get 30% discount off all Summer Fashion. Optout - https://en.ax/03y4",
- "source": "campaigns",
- "channel": "sms",
- "textAnalysis": {
- "length": 121,
- "unicode": false,
- "parts": 1
}
}, - {
- "msgId": "17aab67b-6189-4f8e-8a39-a49998482ee1",
- "status": "DELIVERED",
- "statusCode": 1,
- "inQuietHours": false,
- "createdAt": "2021-07-11 06:13:49",
- "cost": 0.041,
- "to": "+35948402061",
- "countryIso": "BG",
- "from": "InfoText",
- "text": "Hello ,\nRedeem this voucher in the next 30 days and you will get 30% discount off all Summer Fashion. Optout - https://en.ax/03y4",
- "source": "campaigns",
- "channel": "sms",
- "textAnalysis": {
- "length": 121,
- "unicode": false,
- "parts": 1
}
}, - {
- "msgId": "ab0fc2d2-552a-4138-8f36-3d2d44a3a331",
- "status": "DELIVERED",
- "statusCode": 1,
- "inQuietHours": false,
- "createdAt": "2021-07-11 06:13:49",
- "cost": 0.041,
- "to": "+43664737996",
- "countryIso": "AT",
- "from": "InfoText",
- "text": "Hello ,\nRedeem this voucher in the next 30 days and you will get 30% discount off all Summer Fashion. Optout - https://en.ax/03y4",
- "source": "campaigns",
- "channel": "sms",
- "textAnalysis": {
- "length": 121,
- "unicode": false,
- "parts": 1
}
}, - {
- "msgId": "f1c596ac-9071-4530-ad67-1ca174d98b3f",
- "status": "DELIVERED",
- "statusCode": 1,
- "inQuietHours": false,
- "createdAt": "2021-07-11 06:13:49",
- "cost": 0.041,
- "to": "+358412688281",
- "countryIso": "FI",
- "from": "InfoText",
- "text": "Hello ,\nRedeem this voucher in the next 30 days and you will get 30% discount off all Summer Fashion. Optout - https://en.ax/03y4",
- "source": "campaigns",
- "channel": "sms",
- "textAnalysis": {
- "length": 121,
- "unicode": false,
- "parts": 1
}
}, - {
- "msgId": "abb29be5-436d-41fb-a89c-5d6159cf949a",
- "status": "DELIVERED",
- "statusCode": 1,
- "inQuietHours": false,
- "createdAt": "2021-07-11 06:13:49",
- "cost": 0.041,
- "to": "+358412917510",
- "countryIso": "FI",
- "from": "InfoText",
- "text": "Hello ,\nRedeem this voucher in the next 30 days and you will get 30% discount off all Summer Fashion. Optout - https://en.ax/03y4",
- "source": "campaigns",
- "channel": "sms",
- "textAnalysis": {
- "length": 121,
- "unicode": false,
- "parts": 1
}
}, - {
- "msgId": "d290d90f-4348-4767-b0cc-a733df606e02",
- "status": "DELIVERED",
- "statusCode": 1,
- "inQuietHours": false,
- "createdAt": "2021-07-11 06:13:49",
- "cost": 0.041,
- "to": "+41781539412",
- "countryIso": "CH",
- "from": "InfoText",
- "text": "Hello ,\nRedeem this voucher in the next 30 days and you will get 30% discount off all Summer Fashion. Optout - https://en.ax/03y4",
- "source": "campaigns",
- "channel": "sms",
- "textAnalysis": {
- "length": 121,
- "unicode": false,
- "parts": 1
}
}, - {
- "msgId": "0f6bf6f3-b26c-4c5e-ad1f-f6be8d517ced",
- "status": "DELIVERED",
- "statusCode": 1,
- "inQuietHours": false,
- "createdAt": "2021-07-11 06:13:49",
- "cost": 0.041,
- "to": "+41781920142",
- "countryIso": "CH",
- "from": "InfoText",
- "text": "Hello ,\nRedeem this voucher in the next 30 days and you will get 30% discount off all Summer Fashion. Optout - https://en.ax/03y4",
- "source": "campaigns",
- "channel": "sms",
- "textAnalysis": {
- "length": 121,
- "unicode": false,
- "parts": 1
}
}, - {
- "msgId": "a0c3e285-467f-4f7e-baa6-b611628f33e4",
- "status": "DELIVERED",
- "statusCode": 1,
- "inQuietHours": false,
- "createdAt": "2021-07-11 06:13:49",
- "cost": 0.041,
- "to": "+41781967378",
- "countryIso": "CH",
- "from": "InfoText",
- "text": "Hello ,\nRedeem this voucher in the next 30 days and you will get 30% discount off all Summer Fashion. Optout - https://en.ax/03y4",
- "source": "campaigns",
- "channel": "sms",
- "textAnalysis": {
- "length": 121,
- "unicode": false,
- "parts": 1
}
}, - {
- "msgId": "7cff5e34-42af-4961-9f84-ab9e344aa38a",
- "status": "DELIVERED",
- "statusCode": 1,
- "inQuietHours": false,
- "createdAt": "2021-07-11 06:13:49",
- "cost": 0.041,
- "to": "+41781592744",
- "countryIso": "CH",
- "from": "InfoText",
- "text": "Hello ,\nRedeem this voucher in the next 30 days and you will get 30% discount off all Summer Fashion. Optout - https://en.ax/03y4",
- "source": "campaigns",
- "channel": "sms",
- "textAnalysis": {
- "length": 121,
- "unicode": false,
- "parts": 1
}
}, - {
- "msgId": "b74678ca-8fa6-49b0-9922-44c032b334f7",
- "status": "DELIVERED",
- "statusCode": 1,
- "inQuietHours": false,
- "createdAt": "2021-07-11 06:13:49",
- "cost": 0.041,
- "to": "+33612633487",
- "countryIso": "FR",
- "from": "InfoText",
- "text": "Hello ,\nRedeem this voucher in the next 30 days and you will get 30% discount off all Summer Fashion. Optout - https://en.ax/03y4",
- "source": "campaigns",
- "channel": "sms",
- "textAnalysis": {
- "length": 121,
- "unicode": false,
- "parts": 1
}
}, - {
- "msgId": "773b47eb-953c-43f0-9b6e-c3b78a1af151",
- "status": "DELIVERED",
- "statusCode": 1,
- "inQuietHours": false,
- "createdAt": "2021-07-11 06:13:49",
- "cost": 0.041,
- "to": "+43664505576",
- "countryIso": "AT",
- "from": "InfoText",
- "text": "Hello ,\nRedeem this voucher in the next 30 days and you will get 30% discount off all Summer Fashion. Optout - https://en.ax/03y4",
- "source": "campaigns",
- "channel": "sms",
- "textAnalysis": {
- "length": 121,
- "unicode": false,
- "parts": 1
}
}, - {
- "msgId": "269d8870-d872-4647-b29e-0d2da37127b4",
- "status": "DELIVERED",
- "statusCode": 1,
- "inQuietHours": false,
- "createdAt": "2021-07-11 06:13:49",
- "cost": 0.041,
- "to": "+420601658379",
- "countryIso": "CZ",
- "from": "InfoText",
- "text": "Hello ,\nRedeem this voucher in the next 30 days and you will get 30% discount off all Summer Fashion. Optout - https://en.ax/03y4",
- "source": "campaigns",
- "channel": "sms",
- "textAnalysis": {
- "length": 121,
- "unicode": false,
- "parts": 1
}
}, - {
- "msgId": "c241cfee-3598-40b4-a1e4-6714c9986ff3",
- "status": "DELIVERED",
- "statusCode": 1,
- "inQuietHours": false,
- "createdAt": "2021-07-11 06:13:49",
- "cost": 0.041,
- "to": "+33612526996",
- "countryIso": "FR",
- "from": "InfoText",
- "text": "Hello ,\nRedeem this voucher in the next 30 days and you will get 30% discount off all Summer Fashion. Optout - https://en.ax/03y4",
- "source": "campaigns",
- "channel": "sms",
- "textAnalysis": {
- "length": 121,
- "unicode": false,
- "parts": 1
}
}, - {
- "msgId": "cc9072ab-e601-447a-a618-cd37319fec25",
- "status": "DELIVERED",
- "statusCode": 1,
- "inQuietHours": false,
- "createdAt": "2021-07-11 06:13:49",
- "cost": 0.041,
- "to": "+420601325162",
- "countryIso": "CZ",
- "from": "InfoText",
- "text": "Hello ,\nRedeem this voucher in the next 30 days and you will get 30% discount off all Summer Fashion. Optout - https://en.ax/03y4",
- "source": "campaigns",
- "channel": "sms",
- "textAnalysis": {
- "length": 121,
- "unicode": false,
- "parts": 1
}
}, - {
- "msgId": "0c6d8cd9-8a4c-42a1-8858-eb8bde7a8580",
- "status": "DELIVERED",
- "statusCode": 1,
- "inQuietHours": false,
- "createdAt": "2021-07-11 06:13:49",
- "cost": 0.041,
- "to": "+43664266336",
- "countryIso": "AT",
- "from": "InfoText",
- "text": "Hello ,\nRedeem this voucher in the next 30 days and you will get 30% discount off all Summer Fashion. Optout - https://en.ax/03y4",
- "source": "campaigns",
- "channel": "sms",
- "textAnalysis": {
- "length": 121,
- "unicode": false,
- "parts": 1
}
}, - {
- "msgId": "6ed6e025-3a27-423d-8c44-3826896ba7b8",
- "status": "DELIVERED",
- "statusCode": 1,
- "inQuietHours": false,
- "createdAt": "2021-07-11 06:13:49",
- "cost": 0.041,
- "to": "+32470235191",
- "countryIso": "BE",
- "from": "InfoText",
- "text": "Hello ,\nRedeem this voucher in the next 30 days and you will get 30% discount off all Summer Fashion. Optout - https://en.ax/03y4",
- "source": "campaigns",
- "channel": "sms",
- "textAnalysis": {
- "length": 121,
- "unicode": false,
- "parts": 1
}
}, - {
- "msgId": "1cf65e54-168a-4df4-a0c6-3b8a8e85bd2d",
- "status": "DELIVERED",
- "statusCode": 1,
- "inQuietHours": false,
- "createdAt": "2021-07-11 06:13:49",
- "cost": 0.041,
- "to": "+447400733705",
- "countryIso": "GB",
- "from": "InfoText",
- "text": "Hello ,\nRedeem this voucher in the next 30 days and you will get 30% discount off all Summer Fashion. Optout - https://en.ax/03y4",
- "source": "campaigns",
- "channel": "sms",
- "textAnalysis": {
- "length": 121,
- "unicode": false,
- "parts": 1
}
}, - {
- "msgId": "267e459f-0a16-4b21-86c0-cbdc77163d13",
- "status": "DELIVERED",
- "statusCode": 1,
- "inQuietHours": false,
- "createdAt": "2021-07-11 06:13:49",
- "cost": 0.041,
- "to": "+4915123138440",
- "countryIso": "DE",
- "from": "InfoText",
- "text": "Hello ,\nRedeem this voucher in the next 30 days and you will get 30% discount off all Summer Fashion. Optout - https://en.ax/03y4",
- "source": "campaigns",
- "channel": "sms",
- "textAnalysis": {
- "length": 121,
- "unicode": false,
- "parts": 1
}
}, - {
- "msgId": "ec9e8e63-8011-4086-b75f-2471be5238ef",
- "status": "DELIVERED",
- "statusCode": 1,
- "inQuietHours": false,
- "createdAt": "2021-07-11 06:13:49",
- "cost": 0.041,
- "to": "+35948648450",
- "countryIso": "BG",
- "from": "InfoText",
- "text": "Hello ,\nRedeem this voucher in the next 30 days and you will get 30% discount off all Summer Fashion. Optout - https://en.ax/03y4",
- "source": "campaigns",
- "channel": "sms",
- "textAnalysis": {
- "length": 121,
- "unicode": false,
- "parts": 1
}
}, - {
- "msgId": "01f13307-d6b4-4e70-a458-ae86b500b006",
- "status": "DELIVERED",
- "statusCode": 1,
- "inQuietHours": false,
- "createdAt": "2021-07-11 06:13:49",
- "cost": 0.041,
- "to": "+420601618584",
- "countryIso": "CZ",
- "from": "InfoText",
- "text": "Hello ,\nRedeem this voucher in the next 30 days and you will get 30% discount off all Summer Fashion. Optout - https://en.ax/03y4",
- "source": "campaigns",
- "channel": "sms",
- "textAnalysis": {
- "length": 121,
- "unicode": false,
- "parts": 1
}
}, - {
- "msgId": "eb399615-a09d-42e7-9a48-532488c825ca",
- "status": "DELIVERED",
- "statusCode": 1,
- "inQuietHours": false,
- "createdAt": "2021-07-11 06:13:49",
- "cost": 0.041,
- "to": "+35948719667",
- "countryIso": "BG",
- "from": "InfoText",
- "text": "Hello ,\nRedeem this voucher in the next 30 days and you will get 30% discount off all Summer Fashion. Optout - https://en.ax/03y4",
- "source": "campaigns",
- "channel": "sms",
- "textAnalysis": {
- "length": 121,
- "unicode": false,
- "parts": 1
}
}
]
}
Export campaign report to CSV
Exports the details of a sent campaign to a CSV file.
Errors for GET /reports/campaigns/{campaignId}/csv
HTTP code | Error code | Type | Description |
---|---|---|---|
404 | 1160 | not_found | Campaign ID or msg ID provided was not found |
400 | 1165 | invalid_param | Campaign ID or msg ID provided is not valid |
Authorizations:
path Parameters
campaignId required | string <uuid> 36 characters ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]... Example: 4baf0298-0c21-4df1-a60a-6e3476e95e0b Identifier of a sent campaign |
Responses
Request samples
- Shell + Curl
- Python + Requests
- Java + Okhttp
- Node + Native
- Javascript + Xhr
- Php + Curl
- Go + Native
- Ruby + Native
- Csharp + Restsharp
curl --request GET \ --url https://api.sms.cx/reports/campaigns/4baf0298-0c21-4df1-a60a-6e3476e95e0b/csv \ --header 'Authorization: Bearer REPLACE_ACCESS_TOKEN'
Response samples
- 200
- 400
- 401
- 403
- 404
- 405
- 429
- 500
Export campaign report to XLSX
Exports the details of a sent campaign to a XLSX file (Excel).
Errors for GET /reports/campaigns/{campaignId}/xlsx
HTTP code | Error code | Type | Description |
---|---|---|---|
404 | 1160 | not_found | Campaign ID or msg ID provided was not found |
400 | 1165 | invalid_param | Campaign ID or msg ID provided is not valid |
Authorizations:
path Parameters
campaignId required | string <uuid> 36 characters ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]... Example: 4baf0298-0c21-4df1-a60a-6e3476e95e0b Identifier of a sent campaign |
Responses
Request samples
- Shell + Curl
- Python + Requests
- Java + Okhttp
- Node + Native
- Javascript + Xhr
- Php + Curl
- Go + Native
- Ruby + Native
- Csharp + Restsharp
curl --request GET \ --url https://api.sms.cx/reports/campaigns/4baf0298-0c21-4df1-a60a-6e3476e95e0b/xlsx \ --header 'Authorization: Bearer REPLACE_ACCESS_TOKEN'
Response samples
- 200
- 400
- 401
- 403
- 404
- 405
- 429
- 500
Get summary reports for a dimension
Retrieves a summary report for the specified dimensions.
The only required parameters are the dates for the report. The date filters can be: with period
parameter or with start_date
and end_date
For some dimensions (traffic and delivery) the summary report will aggregate on dates. If the summary report was requested with period parameter, the dates will be months or days. If it was requested with interval start_date - end_date, the dates will be the days between the interval.
Eg. period=2011, the property will be all months in the year period=2011-06, the property will be all days in month start_date=2021-06-15, end_date=2021-06-30, the properties will be all days between the interval
If no data is available for the summary report an empty data object is returned.
Errors for GET /reports/summary/{dimension}
HTTP code | Error code | Type | Description |
---|---|---|---|
400 | 1829 | invalid_param | Invalid dimension. Accepted dimensions: source, channel, country, traffic, delivery |
400 | 1820 | invalid_param | The parameter period is not a valid date (format Y-m or Y) |
400 | 1821 | invalid_param | The parameter start_date is not a valid date |
400 | 1822 | invalid_param | The parameter end_date is not a valid date |
400 | 1823 | invalid_param | The end date is before the start date |
400 | 1824 | invalid_param | No period parameter or interval (start_date , end_date ) |
Authorizations:
path Parameters
dimension required | string Enum: "source" "channel" "country" "traffic" "delivery" Dimension for wich the summary report is requested |
query Parameters
period required | string Example: period=2021-07 Period for the requested report in format Y-M or Y |
start_date required | string Example: start_date=2021-03-01 The start date of the report in format Y-M-D |
end_date required | string Example: end_date=2021-04-30 The end date of the report in format Y-M-D |
limit | integer <int32> Default: 500 Example: limit=100 A limit on the number of objects to be returned |
Responses
Request samples
- Shell + Curl
- Python + Requests
- Java + Okhttp
- Node + Native
- Javascript + Xhr
- Php + Curl
- Go + Native
- Ruby + Native
- Csharp + Restsharp
curl --request GET \ --url https://api.sms.cx/reports/summary/%7Bdimension%7D \ --header 'Authorization: Bearer REPLACE_ACCESS_TOKEN'
Response samples
- 200
- 400
- 401
- 403
- 405
- 429
- 500
{- "data": {
- "alerts": {
- "phoneNumbers": 28275,
- "parts": 28275,
- "costParts": 1159.275
}, - "api": {
- "phoneNumbers": 23855,
- "parts": 23855,
- "costParts": 978.055
}, - "campaigns": {
- "phoneNumbers": 148514,
- "parts": 148514,
- "costParts": 6089.074
}
}
}
Receive details for a phone number lookup Webhook
POST
https://{{your-endpoint}}/path-for-number-lookup
The SMS.CX API will make a POST
request to your webhook endpoint, which must return HTTP response 200
. If the response is not HTTP 200, SMS.CX API will retry the callback request for the next 24 hours using an exponential backoff algorithm.
Authorizations:
Request Body schema: application/json
event required | string Value: "number_lookup" Event for which the callback request is made |
required | Array of objects (DataNumberLookupWebhook) Event data, grouped in multiple objects (up to 200 in a request) |
Responses
Request samples
- Payload
{- "event": "number_lookup",
- "data": [
- {
- "phoneNumber": "+33612246450",
- "lookupBulkId": "7a40df4d-b05e-4723-a85c-3a94c54056af",
- "lookupId": "ba988529-8a8b-4a68-9233-06647474f849",
- "cost": 0.006,
- "mcc": "208",
- "mccmnc": "20801",
- "countryIso": "FR",
- "countryName": "France",
- "countryNameLocale": "France",
- "status": "ACTIVE",
- "statusDescription": "Phone number is reachable",
- "ported": true,
- "roaming": false,
- "originalNetwork": {
- "name": "SFR",
- "mnc": "10"
}, - "portedNetwork": {
- "name": "Orange",
- "mnc": "01"
}, - "roamingNetwork": { },
- "datetime": "2022-09-18 08:51:26"
}, - {
- "phoneNumber": "+447400650588",
- "lookupBulkId": "7a40df4d-b05e-4723-a85c-3a94c54056af",
- "lookupId": "5f1e6224-b27d-453e-96cf-7ea967558801",
- "cost": 0.006,
- "mcc": "234",
- "mccmnc": "23420",
- "countryIso": "GB",
- "countryName": "United Kingdom",
- "countryNameLocale": "United Kingdom",
- "status": "ACTIVE",
- "statusDescription": "Phone number is reachable",
- "ported": false,
- "roaming": false,
- "originalNetwork": {
- "name": "3 (Hutchison)",
- "mnc": "20"
}, - "portedNetwork": { },
- "roamingNetwork": { },
- "datetime": "2022-09-18 08:51:26"
}, - {
- "phoneNumber": "+4915123748358",
- "lookupBulkId": "7a40df4d-b05e-4723-a85c-3a94c54056af",
- "lookupId": "02586196-f3cb-4770-88ac-7cf7f6289417",
- "cost": 0.006,
- "mcc": "262",
- "mccmnc": "26201",
- "countryIso": "DE",
- "countryName": "Germany",
- "countryNameLocale": "Deutschland",
- "status": "ACTIVE",
- "statusDescription": "Phone number is reachable",
- "ported": false,
- "roaming": false,
- "originalNetwork": {
- "name": "Telekom (Deutsche Telekom)",
- "mnc": "01"
}, - "portedNetwork": { },
- "roamingNetwork": { },
- "datetime": "2022-09-18 08:51:26"
}, - {
- "phoneNumber": "+393423762006",
- "lookupBulkId": "7a40df4d-b05e-4723-a85c-3a94c54056af",
- "lookupId": "c8c4a466-7086-42c7-913d-48ac217637c2",
- "cost": 0.006,
- "mcc": "222",
- "mccmnc": "22210",
- "countryIso": "IT",
- "countryName": "Italy",
- "countryNameLocale": "Italia",
- "status": "ACTIVE",
- "statusDescription": "Phone number is reachable",
- "ported": false,
- "roaming": false,
- "originalNetwork": {
- "name": "Vodafone",
- "mnc": "10"
}, - "portedNetwork": { },
- "roamingNetwork": { },
- "datetime": "2022-09-18 08:51:26"
}
]
}
Validate number
Validates a single phone number, provided in international E.164 format.
The endpoint returns error if phone number is invalid.
Errors for GET /numbers/validate/{phoneNumber}
HTTP code | Error code | Type | Description |
---|---|---|---|
400 | 1207 | invalid_param | The phone number is invalid |
Authorizations:
path Parameters
phoneNumber required | string Example: +33612246450 Phone number in international E.164 format (eg. +33612424105). The leading plus sign of
the international format can be set as is, ommited or url encoded. The API will automatically
format and set the plus sign.
|
Responses
Request samples
- Shell + Curl
- Python + Requests
- Java + Okhttp
- Node + Native
- Javascript + Xhr
- Php + Curl
- Go + Native
- Ruby + Native
- Csharp + Restsharp
curl --request GET \ --url 'https://api.sms.cx/numbers/validate/+33612246450' \ --header 'Authorization: Bearer REPLACE_ACCESS_TOKEN'
Response samples
- 200
- 400
- 401
- 403
- 405
- 429
- 500
{- "data": {
- "phoneNumber": "+447400733705",
- "countryIso": "GB",
- "networkOperator": "THREE",
- "timezone": "Europe/Guernsey"
}
}
Validate numbers in bulk
Validate a list of phone numbers. You can validate in bulk up to 40.000 phone numbers.
The endpoint does not return error if phone numbers are invalid.
This method will validate the list of phone numbers and return an array of objects, preserving the order of the list provided and not excluding the invalid phone numbers.
An invalid phone number will have the parameter invalid
with value true
in the response object.
Errors for POST /numbers/validate
HTTP code | Error code | Type | Description |
---|---|---|---|
400 | 1203 | invalid_param | The parameter phoneNumbers is empty or not set |
400 | 1208 | invalid_param | The parameter phoneNumbers must be an array of phone numbers |
400 | 1205 | invalid_param | The phone numbers array is too big (max. allowed: 40000 numbers) |
Authorizations:
Request Body schema: application/json
phoneNumbers required | Array of strings Array of phone numbers in international E.164 format or national format. If national format is provided, for better validation you must use the parameter |
countryIso | string 2 characters Two-letter country ISO of the phone number you want to validate. If an international E.164 phone number format is provided the countryIso will be ignored |
Responses
Request samples
- Payload
- Shell + Curl
- Python + Requests
- Java + Okhttp
- Node + Native
- Javascript + Xhr
- Php + Curl
- Go + Native
- Ruby + Native
- Csharp + Restsharp
{- "phoneNumbers": [
- "+33612424105",
- "+33612246450",
- "+336123",
- "+33612956402",
- "+33612334525",
- "+447400650588",
- "+4915123748358",
- "+4915128620584",
- "+420601848808",
- "+420601302207",
- "+420204532112"
]
}
Response samples
- 200
- 400
- 401
- 403
- 405
- 429
- 500
{- "info": {
- "totalPhoneNumbers": 11,
- "totalValid": 9,
- "totalInvalid": 2,
- "phoneNumbersByCountry": {
- "FR": 4,
- "GB": 1,
- "DE": 2,
- "CZ": 2
}
}, - "data": [
- {
- "phoneNumber": "+33612424105",
- "countryIso": "FR",
- "networkOperator": "SFR",
- "timezone": "Europe/Paris",
- "invalid": false
}, - {
- "phoneNumber": "+33612246450",
- "countryIso": "FR",
- "networkOperator": "SFR",
- "timezone": "Europe/Paris",
- "invalid": false
}, - {
- "phoneNumber": "+336123",
- "invalid": true
}, - {
- "phoneNumber": "+33612956402",
- "countryIso": "FR",
- "networkOperator": "SFR",
- "timezone": "Europe/Paris",
- "invalid": false
}, - {
- "phoneNumber": "+33612334525",
- "countryIso": "FR",
- "networkOperator": "SFR",
- "timezone": "Europe/Paris",
- "invalid": false
}, - {
- "phoneNumber": "+447400650588",
- "countryIso": "GB",
- "networkOperator": "THREE",
- "timezone": "Europe/Guernsey",
- "invalid": false
}, - {
- "phoneNumber": "+4915123748358",
- "countryIso": "DE",
- "networkOperator": "T-MOBILE",
- "timezone": "Europe/Berlin",
- "invalid": false
}, - {
- "phoneNumber": "+4915128620584",
- "countryIso": "DE",
- "networkOperator": "T-MOBILE",
- "timezone": "Europe/Berlin",
- "invalid": false
}, - {
- "phoneNumber": "+420601848808",
- "countryIso": "CZ",
- "networkOperator": "O2",
- "timezone": "Europe/Prague",
- "invalid": false
}, - {
- "phoneNumber": "+420601302207",
- "countryIso": "CZ",
- "networkOperator": "O2",
- "timezone": "Europe/Prague",
- "invalid": false
}, - {
- "phoneNumber": "+420204532112",
- "invalid": true
}
]
}
Lookup number
Lookup a single phone number, provided in international E.164 format. Returns info about status of the number (ACTIVE, ABSENT), if the phone number is ported, roaming, original and current network operator.
The endpoint returns error if phone number is invalid.
Statuses of phone number lookup
Status | Description |
---|---|
ACTIVE | Phone number is reachable |
ABSENT | Phone number is not reachable |
BARRED | Phone number has a block from their operator |
UNKNOWN | Unknown subscriber. Phone number is not reachable |
FAILED | Lookup for this phone number failed |
Errors for GET /numbers/lookup/{phoneNumber}
HTTP code | Error code | Type | Description |
---|---|---|---|
400 | 1207 | invalid_param | The phone number is invalid |
403 | 1214 | no_coverage | No coverage or restricted destination |
400 | 1113 | insufficient_credit | Insufficient credit |
400 | 1114 | insufficient_credit | Credit limit reached. To increase the credit limit, please contact your account manager |
400 | 1212 | invalid_param | Invalid request parameters |
Authorizations:
path Parameters
phoneNumber required | string Example: +33612246450 Phone number in international E.164 format (eg. +33612424105). The leading plus sign of
the international format can be set as is, ommited or url encoded. The API will automatically
format and set the plus sign.
|
Responses
Request samples
- Shell + Curl
- Python + Requests
- Java + Okhttp
- Node + Native
- Javascript + Xhr
- Php + Curl
- Go + Native
- Ruby + Native
- Csharp + Restsharp
curl --request GET \ --url 'https://api.sms.cx/numbers/lookup/+33612246450' \ --header 'Authorization: Bearer REPLACE_ACCESS_TOKEN'
Response samples
- 200
- 400
- 401
- 403
- 405
- 429
- 500
{- "data": {
- "phoneNumber": "+33612246450",
- "lookupId": "8b0edac5-322f-4dca-a0ca-2a7c49286b00",
- "cost": 0.006,
- "mcc": "208",
- "mccmnc": "20801",
- "countryIso": "FR",
- "countryName": "France",
- "countryNameLocale": "France",
- "status": "ACTIVE",
- "statusDescription": "Phone number is reachable",
- "ported": true,
- "roaming": false,
- "originalNetwork": {
- "name": "SFR",
- "mnc": "10"
}, - "portedNetwork": {
- "name": "Orange",
- "mnc": "01"
}, - "roamingNetwork": { },
- "datetime": "2022-09-18 08:51:26"
}
}
Get list of bulk lookup campaigns
Get list of bulk lookup campaigns
Authorizations:
query Parameters
limit | integer <int32> Default: 500 Example: limit=100 A limit on the number of objects to be returned |
next | string Example: next=NTM2NTA The next token used to retrieve additional data |
previous | string Example: previous=NTQxNTA The previous token used to retrieve additional data |
Responses
Request samples
- Shell + Curl
- Python + Requests
- Java + Okhttp
- Node + Native
- Javascript + Xhr
- Php + Curl
- Go + Native
- Ruby + Native
- Csharp + Restsharp
curl --request GET \ --url https://api.sms.cx/numbers/lookup \ --header 'Authorization: Bearer REPLACE_ACCESS_TOKEN'
Response samples
- 200
- 401
- 403
- 405
- 429
- 500
{- "data": [
- {
- "id": "8b0edac5-322f-4dca-a0ca-2a7c49286b00",
- "totalPhoneNumbers": 11,
- "totalValid": 9,
- "totalCost": 0.18,
- "datetimeAdded": "2022-09-18 08:51:26"
}, - {
- "id": "ffd925b4-7d3a-4cc1-9f7e-ddc0212a74fb",
- "totalPhoneNumbers": 2966,
- "totalValid": 2715,
- "totalCost": 13.575,
- "datetimeAdded": "2022-08-21 12:17:44"
}
]
}
Lookup numbers in bulk
Lookup a list of phone numbers. The result of the bulk phone lookup: status of the number (ACTIVE, ABSENT), if the phone numbers are ported, roaming, original and current network operator. You can lookup in bulk up to 40.000 phone numbers.
The endpoint does not return error if phone numbers are invalid.
Statuses of phone number lookup
Status | Description |
---|---|
ACTIVE | Phone number is reachable |
ABSENT | Phone number is not reachable |
BARRED | Phone number has a block from their operator |
UNKNOWN | Unknown subscriber. Phone number is not reachable |
FAILED | Lookup for this phone number failed |
Errors for POST /numbers/lookup
HTTP code | Error code | Type | Description |
---|---|---|---|
400 | 1203 | invalid_param | The parameter 'phoneNumbers' is empty or not set |
400 | 1208 | invalid_param | The parameter 'phoneNumbers' must be an array of phone numbers |
400 | 1205 | invalid_param | The phone numbers array is too big (max. allowed: 40000 numbers) |
400 | 1209 | invalid_param | The parameter 'lookupCallbackUrl' is not a valid URL |
403 | 1214 | no_coverage | No coverage or restricted destination |
400 | 1216 | invalid_param | No valid numbers provided or no coverage |
400 | 1113 | insufficient_credit | Insufficient credit |
400 | 1114 | insufficient_credit | Credit limit reached. To increase the credit limit, please contact your account manager |
Authorizations:
Request Body schema: application/json
phoneNumbers required | Array of strings Array of phone numbers in international E.164 format or national format. If national format is provided, for better validation/lookup you must use the parameter |
countryIso | string 2 characters Two-letter country ISO of the phone number you want to lookup. If an international E.164 phone number format is provided the countryIso will be ignored |
lookupCallbackUrl | string <url> A valid URL to receive results for the phone number lookup. |
Responses
Request samples
- Payload
- Shell + Curl
- Python + Requests
- Java + Okhttp
- Node + Native
- Javascript + Xhr
- Php + Curl
- Go + Native
- Ruby + Native
- Csharp + Restsharp
{- "phoneNumbers": [
- "+33612424105",
- "+336123",
- "+33612956402",
- "+33612424105",
- "+42060455896",
- "+33612956402",
- "+33612334525",
- "+447400650588",
- "+4915123748358",
- "+4915128620584",
- "+420601848808",
- "+4915123214272",
- "+393423762006"
],
}
Response samples
- 200
- 400
- 401
- 403
- 405
- 429
- 500
{- "info": {
- "lookupBulkId": "02b385f1-80a3-441e-a90e-3be5931977cd",
- "totalPhoneNumbers": 13,
- "totalValid": 11,
- "totalInvalid": 2,
- "totalCost": 0.066,
- "phoneNumbersByCountry": {
- "FR": 5,
- "GB": 1,
- "DE": 3,
- "CZ": 1,
- "IT": 1
}, - "invalid": [
- "+336123",
- "+42060455896"
]
}, - "data": [
- {
- "phoneNumber": "+33612424105",
- "countryIso": "FR",
- "cost": 0.006,
- "lookupId": "14644e94-0a1b-4c5d-9c11-8828393471e5",
- "datetime": "2022-09-19 08:48:55"
}, - {
- "phoneNumber": "+33612956402",
- "countryIso": "FR",
- "cost": 0.006,
- "lookupId": "df8522b8-c800-4585-8869-a2d3df2729e7",
- "datetime": "2022-09-19 08:48:55"
}, - {
- "phoneNumber": "+33612424105",
- "countryIso": "FR",
- "cost": 0.006,
- "lookupId": "a02cac2d-c387-4fef-a969-f761554faf04",
- "datetime": "2022-09-19 08:48:55"
}, - {
- "phoneNumber": "+33612956402",
- "countryIso": "FR",
- "cost": 0.006,
- "lookupId": "1b13e86d-9e04-4455-a17f-38e5104d1557",
- "datetime": "2022-09-19 08:48:55"
}, - {
- "phoneNumber": "+33612334525",
- "countryIso": "FR",
- "cost": 0.006,
- "lookupId": "2fb25565-2dd2-4877-990f-e80859c3717d",
- "datetime": "2022-09-19 08:48:55"
}, - {
- "phoneNumber": "+447400650588",
- "countryIso": "GB",
- "cost": 0.006,
- "lookupId": "f4d53771-53cc-4b4f-a7ef-4e090f86da37",
- "datetime": "2022-09-19 08:48:55"
}, - {
- "phoneNumber": "+4915123748358",
- "countryIso": "DE",
- "cost": 0.006,
- "lookupId": "2c647fc3-bea3-4315-af22-8f279c8ba34b",
- "datetime": "2022-09-19 08:48:55"
}, - {
- "phoneNumber": "+4915128620584",
- "countryIso": "DE",
- "cost": 0.006,
- "lookupId": "b385dc2a-551a-4959-ab87-dbbf0f37ab73",
- "datetime": "2022-09-19 08:48:55"
}, - {
- "phoneNumber": "+420601848808",
- "countryIso": "CZ",
- "cost": 0.006,
- "lookupId": "74e4a651-f964-4377-b94a-7dd7f57eaa80",
- "datetime": "2022-09-19 08:48:55"
}, - {
- "phoneNumber": "+4915123214272",
- "countryIso": "DE",
- "cost": 0.006,
- "lookupId": "55a5a55b-3541-4ad1-8564-5b02ec6bc130",
- "datetime": "2022-09-19 08:48:55"
}, - {
- "phoneNumber": "+393423762006",
- "countryIso": "IT",
- "cost": 0.006,
- "lookupId": "e4bf5fb2-d87e-493b-b4db-9bd0b904dc31",
- "datetime": "2022-09-19 08:48:55"
}
]
}
Get Single Lookup result
Get details of a single number lookup.
Errors for GET /numbers/lookup/lookupId/{lookupId}
HTTP code | Error code | Type | Description |
---|---|---|---|
400 | 1217 | invalid_param | The lookupId provided is invalid |
404 | 1219 | not_found | Lookup ID not found |
Authorizations:
path Parameters
lookupId required | string <uuid> 36 characters ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]... Example: 68aa4d9f-ee25-4a32-95d0-7272efe3b238 Identifier of the number lookup |
Responses
Request samples
- Shell + Curl
- Python + Requests
- Java + Okhttp
- Node + Native
- Javascript + Xhr
- Php + Curl
- Go + Native
- Ruby + Native
- Csharp + Restsharp
curl --request GET \ --url https://api.sms.cx/numbers/lookup/lookupId/68aa4d9f-ee25-4a32-95d0-7272efe3b238 \ --header 'Authorization: Bearer REPLACE_ACCESS_TOKEN'
Response samples
- 200
- 400
- 401
- 403
- 404
- 405
- 429
- 500
{- "data": {
- "phoneNumber": "+33612246450",
- "lookupId": "8b0edac5-322f-4dca-a0ca-2a7c49286b00",
- "cost": 0.006,
- "mcc": "208",
- "mccmnc": "20801",
- "countryIso": "FR",
- "countryName": "France",
- "countryNameLocale": "France",
- "status": "ACTIVE",
- "statusDescription": "Phone number is reachable",
- "ported": true,
- "roaming": false,
- "originalNetwork": {
- "name": "SFR",
- "mnc": "10"
}, - "portedNetwork": {
- "name": "Orange",
- "mnc": "01"
}, - "roamingNetwork": { },
- "datetime": "2022-09-18 08:51:26"
}
}
Get Bulk Lookup result
Get details of a bulk phone number lookup.
Errors for GET /numbers/lookup/lookupBulkId/{lookupBulkId}
HTTP code | Error code | Type | Description |
---|---|---|---|
400 | 1218 | invalid_param | The lookupBulkId provided is invalid |
404 | 1220 | not_found | Lookup Bulk ID not found |
Authorizations:
path Parameters
lookupBulkId required | string <uuid> 36 characters ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]... Example: 68aa4d9f-ee25-4a32-95d0-7272efe3b238 Identifier of the bulk number lookup campaign |
query Parameters
limit | integer <int32> Default: 500 Example: limit=100 A limit on the number of objects to be returned |
next | string Example: next=NTM2NTA The next token used to retrieve additional data |
previous | string Example: previous=NTQxNTA The previous token used to retrieve additional data |
Responses
Request samples
- Shell + Curl
- Python + Requests
- Java + Okhttp
- Node + Native
- Javascript + Xhr
- Php + Curl
- Go + Native
- Ruby + Native
- Csharp + Restsharp
curl --request GET \ --url https://api.sms.cx/numbers/lookup/lookupBulkId/68aa4d9f-ee25-4a32-95d0-7272efe3b238 \ --header 'Authorization: Bearer REPLACE_ACCESS_TOKEN'
Response samples
- 200
- 400
- 401
- 403
- 404
- 405
- 429
- 500
{- "info": {
- "lookupBulkId": "02b385f1-80a3-441e-a90e-3be5931977cd",
- "totalPhoneNumbers": 2,
- "totalValid": 2,
- "totalCost": 0.016,
- "phoneNumbersByCountry": {
- "FR": 2
}
}, - "data": [
- {
- "phoneNumber": "+33612246450",
- "lookupId": "8b0edac5-322f-4dca-a0ca-2a7c49286b00",
- "cost": 0.006,
- "mcc": "208",
- "mccmnc": "20801",
- "countryIso": "FR",
- "countryName": "France",
- "countryNameLocale": "France",
- "status": "ACTIVE",
- "statusDescription": "Phone number is reachable",
- "ported": true,
- "roaming": false,
- "originalNetwork": {
- "name": "SFR",
- "mnc": "10"
}, - "portedNetwork": {
- "name": "Orange",
- "mnc": "01"
}, - "roamingNetwork": { },
- "datetime": "2022-09-18 08:51:26"
}, - {
- "phoneNumber": "+33617540361",
- "lookupId": "8b0edac5-322f-4dca-a0ca-2a7c49286b00",
- "cost": 0.006,
- "mcc": "208",
- "mccmnc": "20801",
- "countryIso": "FR",
- "countryName": "France",
- "countryNameLocale": "France",
- "status": "ACTIVE",
- "statusDescription": "Phone number is reachable",
- "ported": true,
- "roaming": true,
- "originalNetwork": {
- "name": "SFR",
- "mnc": "10"
}, - "portedNetwork": {
- "name": "Orange",
- "mnc": "01"
}, - "roamingNetwork": {
- "countryIso": "IT",
- "countryName": "Italy",
- "mcc": "222",
- "mnc": "88",
- "name": "Wind"
}, - "datetime": "2022-08-21 12:17:44"
}
]
}
Export number lookup campaign to CSV
Exports the details of a phone number lookup campaign to a CSV file.
Errors for GET /numbers/lookup/lookupBulkId/{lookupBulkId}/csv
HTTP code | Error code | Type | Description |
---|---|---|---|
400 | 1218 | invalid_param | The lookupBulkId provided is invalid |
404 | 1220 | not_found | Lookup Bulk ID not found |
Authorizations:
path Parameters
lookupBulkId required | string <uuid> 36 characters ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]... Example: 68aa4d9f-ee25-4a32-95d0-7272efe3b238 Identifier of the bulk number lookup campaign |
Responses
Request samples
- Shell + Curl
- Python + Requests
- Java + Okhttp
- Node + Native
- Javascript + Xhr
- Php + Curl
- Go + Native
- Ruby + Native
- Csharp + Restsharp
curl --request GET \ --url https://api.sms.cx/numbers/lookup/lookupBulkId/4baf0298-0c21-4df1-a60a-6e3476e95e0b/csv \ --header 'Authorization: Bearer REPLACE_ACCESS_TOKEN'
Response samples
- 200
- 400
- 401
- 403
- 404
- 405
- 429
- 500
Export number lookup campaign to XLSX
Exports the details of a phone number lookup campaign to a XLSX file.
Errors for GET /numbers/lookup/lookupBulkId/{lookupBulkId}/xlsx
HTTP code | Error code | Type | Description |
---|---|---|---|
400 | 1218 | invalid_param | The lookupBulkId provided is invalid |
404 | 1220 | not_found | Lookup Bulk ID not found |
Authorizations:
path Parameters
lookupBulkId required | string <uuid> 36 characters ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]... Example: 68aa4d9f-ee25-4a32-95d0-7272efe3b238 Identifier of the bulk number lookup campaign |
Responses
Request samples
- Shell + Curl
- Python + Requests
- Java + Okhttp
- Node + Native
- Javascript + Xhr
- Php + Curl
- Go + Native
- Ruby + Native
- Csharp + Restsharp
curl --request GET \ --url https://api.sms.cx/numbers/lookup/lookupBulkId/4baf0298-0c21-4df1-a60a-6e3476e95e0b/xlsx \ --header 'Authorization: Bearer REPLACE_ACCESS_TOKEN'
Response samples
- 200
- 400
- 401
- 403
- 404
- 405
- 429
- 500
Get available numbers for rent
Get the list of available phone numbers for rent
Errors for GET /numbers/rent/available/{countryIso}
HTTP code | Error code | Type | Description |
---|---|---|---|
400 | 2003 | invalid_param | Country ISO provided is invalid |
Authorizations:
path Parameters
countryIso required | string 2 characters Example: FR |
query Parameters
features | integer <int32> Enum: "1" "2" "3" Example: features=3 Filter by number features (1 - receive SMS, 2 - send SMS, 1 + 2 = 3 - send and receive SMS) |
number_type | string Enum: "mobile" "landline" Example: number_type=mobile Filter by type of phone number |
setup_time | string Enum: "instant" "delayed" Example: setup_time=instant Filter by time of setup |
registration | boolean Example: registration=true Filter by registration |
inbound_sms_sender | boolean Example: inbound_sms_sender=true Filter numbers that support inbound SMS from alphanumeric sender ID |
include | string [ 17 .. 1 ] characters Example: include=4559 Filter phone numbers that include the following digits |
exclude | string [ 17 .. 1 ] characters Example: exclude=1554 Filter phone numbers that exclude the following digits |
Responses
Request samples
- Shell + Curl
- Python + Requests
- Java + Okhttp
- Node + Native
- Javascript + Xhr
- Php + Curl
- Go + Native
- Ruby + Native
- Csharp + Restsharp
curl --request GET \ --url https://api.sms.cx/numbers/rent/available/FR \ --header 'Authorization: Bearer REPLACE_ACCESS_TOKEN'
Response samples
- 200
- 400
- 401
- 403
- 405
- 429
- 500
{- "data": [
- {
- "numberId": "d55c0dc5-b5cc-4bcd-9209-a45dd7da6da1",
- "phoneNumber": "+33632578421",
- "countryIso": "FR",
- "networkOperator": "ORANGE FRANCE",
- "features": 3,
- "numberType": "mobile",
- "inboundSmsCost": 0,
- "outboundSmsCost": 0.041,
- "setupCost": 10,
- "rentCost": [
- {
- "days": 30,
- "cost": 9.8
}
], - "minRent": 30,
- "setupTime": "instant",
- "registration": false,
- "inboundSmsSender": false,
- "datetime": "2023-02-03 21:57:08"
}, - {
- "numberId": "d1be5d20-0501-4bea-be6f-52d29ce93bea",
- "phoneNumber": "+33612465145",
- "countryIso": "FR",
- "networkOperator": "ORANGE FRANCE",
- "features": 3,
- "numberType": "mobile",
- "inboundSmsCost": 0,
- "outboundSmsCost": 0.041,
- "setupCost": 5,
- "rentCost": [
- {
- "days": 1,
- "cost": 1.8
}, - {
- "days": 7,
- "cost": 5.6
}, - {
- "days": 30,
- "cost": 9.8
}
], - "minRent": 1,
- "setupTime": "instant",
- "registration": false,
- "inboundSmsSender": false,
- "datetime": "2023-02-04 20:40:08"
}, - {
- "numberId": "e497054f-5da5-4f60-8837-4602c7895e4b",
- "phoneNumber": "+33612896093",
- "countryIso": "FR",
- "networkOperator": "SFR",
- "features": 3,
- "numberType": "mobile",
- "inboundSmsCost": 0,
- "outboundSmsCost": 0.041,
- "setupCost": 5,
- "rentCost": [
- {
- "days": 7,
- "cost": 6.1
}, - {
- "days": 30,
- "cost": 10.25
}
], - "minRent": 7,
- "setupTime": "instant",
- "registration": false,
- "inboundSmsSender": true,
- "datetime": "2023-02-01 18:14:08"
}
]
}
Get list of your rented numbers
Get the list of your rented phone numbers
Authorizations:
query Parameters
features | integer <int32> Enum: "1" "2" "3" Example: features=3 Filter by number features (1 - receive SMS, 2 - send SMS, 1 + 2 = 3 - send and receive SMS) |
country_iso | string Example: country_iso=fr Filter by country iso. Two-letter country code defined in ISO-3166 alpha 2 standard (case insensitive) |
number_type | string Enum: "mobile" "landline" Example: number_type=mobile Filter by type of phone number |
active_rent | boolean Example: active_rent=true Filter by active rent |
inbound_sms_sender | boolean Example: inbound_sms_sender=true Filter numbers that support inbound SMS from alphanumeric sender ID |
include | string [ 17 .. 1 ] characters Example: include=4559 Filter phone numbers that include the following digits |
exclude | string [ 17 .. 1 ] characters Example: exclude=1554 Filter phone numbers that exclude the following digits |
Responses
Request samples
- Shell + Curl
- Python + Requests
- Java + Okhttp
- Node + Native
- Javascript + Xhr
- Php + Curl
- Go + Native
- Ruby + Native
- Csharp + Restsharp
curl --request GET \ --url https://api.sms.cx/numbers/rent \ --header 'Authorization: Bearer REPLACE_ACCESS_TOKEN'
Response samples
- 200
- 401
- 403
- 405
- 429
- 500
{- "data": [
- {
- "rentId": "6e57cbc0-a65b-4847-b40e-c8f670b170c4",
- "numberId": "f92f4ad8-28e5-47be-8225-d0c07de37c1c",
- "phoneNumber": "+33612992410",
- "countryIso": "FR",
- "networkOperator": "ORANGE FRANCE",
- "features": 3,
- "numberType": "mobile",
- "rentCost": 3.9,
- "setupCost": 6.5,
- "rentPeriod": 7,
- "rentStart": "2022-10-02 14:23:15",
- "rentEnd": "2022-10-09 14:23:15",
- "inboundSmsCost": 0,
- "outboundSmsCost": 0.038,
- "renewCost": [
- {
- "days": 1,
- "cost": 1.7
}, - {
- "days": 7,
- "cost": 3.9
}, - {
- "days": 30,
- "cost": 11.35
}
], - "inboundSms": {
- "total": 455,
- "cost": 0
}, - "outboundSms": {
- "total": 1416,
- "cost": 53.808
}, - "minRent": 1,
- "autoRenew": true,
- "inboundSmsSender": false,
- "activeRent": false,
- "approved": true,
- "datetime": "2022-10-02 14:23:15"
}, - {
- "rentId": "d1be5d20-0501-4bea-be6f-52d29ce93bea",
- "numberId": "da35777d-3c6a-4287-9e04-71091ac706fa",
- "phoneNumber": "+33612465145",
- "countryIso": "FR",
- "networkOperator": "ORANGE FRANCE",
- "features": 3,
- "numberType": "mobile",
- "rentCost": 9.8,
- "setupCost": 10,
- "rentPeriod": 30,
- "rentStart": "2022-11-04 11:15:10",
- "rentEnd": "2022-12-30 11:15:10",
- "inboundSmsCost": 0,
- "outboundSmsCost": 0.041,
- "renewCost": [
- {
- "days": 30,
- "cost": 9.8
}
], - "inboundSms": {
- "total": 1733,
- "cost": 0
}, - "outboundSms": {
- "total": 8622,
- "cost": 353.502
}, - "minRent": 30,
- "autoRenew": true,
- "inboundSmsSender": false,
- "activeRent": true,
- "approved": true,
- "datetime": "2022-11-04 11:15:10"
}, - {
- "rentId": "e497054f-5da5-4f60-8837-4602c7895e4b",
- "numberId": "7fc32a00-29ed-4c7f-a58a-58a41e0b1329",
- "phoneNumber": "+33612896093",
- "countryIso": "FR",
- "networkOperator": "SFR",
- "features": 3,
- "numberType": "mobile",
- "rentCost": 10.3,
- "setupCost": 9,
- "rentPeriod": 30,
- "rentStart": "2022-11-04 15:03:17",
- "rentEnd": "2022-12-04 15:03:17",
- "inboundSmsCost": 0,
- "outboundSmsCost": 0.04,
- "renewCost": [
- {
- "days": 30,
- "cost": 10.3
}
], - "inboundSms": {
- "total": 1547,
- "cost": 0
}, - "outboundSms": {
- "total": 6329,
- "cost": 253.16
}, - "minRent": 30,
- "autoRenew": false,
- "inboundSmsSender": false,
- "activeRent": true,
- "approved": true,
- "datetime": "2022-11-04 15:03:17"
}
]
}
Rent phone number
Rent a phone number for a period of time (1, 7 or 30 days).
Errors for POST /numbers/rent
HTTP code | Error code | Type | Description |
---|---|---|---|
400 | 1222 | invalid_param | Invalid parameter numberId |
400 | 1224 | invalid_param | Rent period is invalid (1, 7 or 30 days) |
400 | 1225 | invalid_param | Parameter autorenew must be type boolean |
400 | 1226 | invalid_param | The parameter callbackUrl is not a valid url |
400 | 1229 | invalid_param | Rent period is lower than the minimum rent period of this number |
400 | 1113 | insufficient_credit | Insufficient credit |
400 | 1234 | invalid_param | Registration ID provided is invalid or not found |
403 | 1231 | access_denied | Cannot rent this phone number (already rented) |
404 | 1230 | not_found | Number ID not found or number is not available for rent anymore |
Authorizations:
Request Body schema: application/json
numberId required | string <uuid> 36 characters ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]... Unique identifier of the phone number from the available rental list |
rentPeriod required | integer <int32> Enum: "1" "7" "30" Rental period of the phone number (in days) |
autoRenew | boolean Default: false Auto renew the rental of the phone number at the end of the rental period |
callbackUrl | string or null <url> Callback URL (or webhook) to get the received SMS on the rented phone number |
registrationId | string <uuid> 36 characters ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]... Applicable if the phone number requires registration. Unique identifier of the registration details for this phone number |
Responses
Request samples
- Payload
- Shell + Curl
- Python + Requests
- Java + Okhttp
- Node + Native
- Javascript + Xhr
- Php + Curl
- Go + Native
- Ruby + Native
- Csharp + Restsharp
{- "numberId": "38d70eda-641c-4c1a-aae8-723ed8aef062",
- "rentPeriod": 30,
- "autoRenew": true,
}
Response samples
- 200
- 400
- 401
- 403
- 404
- 405
- 429
- 500
{- "info": {
- "rentId": "ed9e3e11-8f35-4bf7-b3bc-8197bc40baf4",
- "numberId": "38d70eda-641c-4c1a-aae8-723ed8aef062",
- "phoneNumber": "+33612992410",
- "countryIso": "FR",
- "rentStart": "2022-11-02 13:37:25",
- "rentEnd": "2022-12-02 13:37:25",
- "rentCost": 9.85,
- "setupCost": 10,
- "autoRenew": true,
- "approved": true,
- "datetime": "2022-11-02 13:37:25"
}
}
Get status of rent
Get details of an existing rental.
Errors for GET /numbers/rent/{rentId}
HTTP code | Error code | Type | Description |
---|---|---|---|
400 | 1221 | invalid_param | The rentId provided is invalid |
404 | 1223 | not_found | Rent ID not found |
Authorizations:
path Parameters
rentId required | string <uuid> 36 characters ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]... Example: 471ddea7-930c-49e8-8e99-2683834dd92e Identifier of the rental operation |
Responses
Request samples
- Shell + Curl
- Python + Requests
- Java + Okhttp
- Node + Native
- Javascript + Xhr
- Php + Curl
- Go + Native
- Ruby + Native
- Csharp + Restsharp
curl --request GET \ --url https://api.sms.cx/numbers/rent/471ddea7-930c-49e8-8e99-2683834dd92e \ --header 'Authorization: Bearer REPLACE_ACCESS_TOKEN'
Response samples
- 200
- 400
- 401
- 403
- 404
- 405
- 429
- 500
{- "info": {
- "rentId": "471ddea7-930c-49e8-8e99-2683834dd92e",
- "numberId": "fc3b78e6-d806-4423-beda-65a21d6a24d2",
- "phoneNumber": "+33612992409",
- "countryIso": "FR",
- "networkOperator": "ORANGE FRANCE",
- "features": 3,
- "numberType": "mobile",
- "rentCost": 11.35,
- "setupCost": 5.35,
- "rentPeriod": 30,
- "rentStart": "2023-02-12 11:25:27",
- "rentEnd": "2023-03-14 11:25:27",
- "inboundSmsCost": 0,
- "outboundSmsCost": 0.042,
- "renewCost": [
- {
- "days": 1,
- "cost": 1.8
}, - {
- "days": 7,
- "cost": 3.9
}, - {
- "days": 30,
- "cost": 11.35
}
], - "inboundSms": {
- "total": 455,
- "cost": 0
}, - "outboundSms": {
- "total": 1416,
- "cost": 53.808
}, - "minRent": 1,
- "autoRenew": true,
- "inboundSmsSender": false,
- "activeRent": true,
- "approved": true,
- "datetime": "2023-02-12 11:25:27"
}
}
Cancel rent for phone number
Cancel rent for a phone number. Phone numbers rentals can be canceled within the first 30 minutes of renting period. Your account will be credited for the phone number rental cost.
Errors for DELETE /numbers/rent/{rentId}
HTTP code | Error code | Type | Description |
---|---|---|---|
400 | 1221 | invalid_param | The rentId provided is invalid |
403 | 1227 | access_denied | Cannot cancel this rent. More than 30 minutes passed from start of renting period |
403 | 1232 | access_denied | Cannot cancel this rent. The number has already been used for inbound SMS |
404 | 1223 | not_found | Rent ID not found |
Authorizations:
path Parameters
rentId required | string <uuid> 36 characters ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]... Example: 471ddea7-930c-49e8-8e99-2683834dd92e Identifier of the rental operation |
Responses
Request samples
- Shell + Curl
- Python + Requests
- Java + Okhttp
- Node + Native
- Javascript + Xhr
- Php + Curl
- Go + Native
- Ruby + Native
- Csharp + Restsharp
curl --request DELETE \ --url https://api.sms.cx/numbers/rent/471ddea7-930c-49e8-8e99-2683834dd92e \ --header 'Authorization: Bearer REPLACE_ACCESS_TOKEN'
Response samples
- 200
- 400
- 401
- 403
- 404
- 405
- 429
- 500
{- "info": {
- "rentId": "19020fd7-c111-4db3-8c17-b93d74b3a4c5",
- "numberId": "032a7115-f537-41bd-af4c-2170475daeae",
- "phoneNumber": "+33612360907",
- "countryIso": "FR",
- "creditReturned": 9.8
}
}
Renew rent for phone number
Renew the rental of a phone number.
Errors for PATCH /numbers/rent/{rentId}
HTTP code | Error code | Type | Description |
---|---|---|---|
400 | 1221 | invalid_param | The rentId provided is invalid |
400 | 1224 | invalid_param | Rent period is invalid (1, 7 or 30 days) |
400 | 1225 | invalid_param | Parameter autorenew must be type boolean |
400 | 1226 | invalid_param | The parameter callbackUrl is not a valid url |
400 | 1229 | invalid_param | Rent period is lower than the minimum rent period of this number |
400 | 1113 | insufficient_credit | Insufficient credit |
403 | 1228 | access_denied | The rent cannot be renewed (rent already expired or phone number is not available for future rent) |
404 | 1223 | not_found | Rent ID not found |
Authorizations:
path Parameters
rentId required | string <uuid> 36 characters ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]... Example: 471ddea7-930c-49e8-8e99-2683834dd92e Identifier of the rental operation |
Request Body schema: application/json
rentPeriod | integer <int32> Enum: "1" "7" "30" Rental period of the phone number (in days). This parameter is optional. If not present, the phone number rent will renew with the current rent period. |
autoRenew | boolean Default: false Auto renew the rent of the phone number at the end of the rental period |
callbackUrl | string or null <url> Callback URL (or webhook) to get the SMS that is received on the rented phone number (inbound SMS) |
Responses
Request samples
- Payload
- Shell + Curl
- Python + Requests
- Java + Okhttp
- Node + Native
- Javascript + Xhr
- Php + Curl
- Go + Native
- Ruby + Native
- Csharp + Restsharp
{- "rentPeriod": 30,
- "autoRenew": false,
}
Response samples
- 200
- 400
- 401
- 403
- 404
- 405
- 429
- 500
{- "info": {
- "rentId": "ed9e3e11-8f35-4bf7-b3bc-8197bc40baf4",
- "numberId": "38d70eda-641c-4c1a-aae8-723ed8aef062",
- "phoneNumber": "+33612992410",
- "countryIso": "FR",
- "rentStart": "2022-11-02 13:37:25",
- "rentEnd": "2022-12-02 13:37:25",
- "rentCost": 9.85,
- "autoRenew": false,
- "datetime": "2022-11-02 13:37:25"
}
}
Get inbound SMS from rented number
Get a list of SMS received on the rented phone number.
Errors for GET /numbers/rent/{rentId}/inbound
HTTP code | Error code | Type | Description |
---|---|---|---|
400 | 1221 | invalid_param | The rentId provided is invalid |
404 | 1223 | not_found | Rent ID not found |
Authorizations:
path Parameters
rentId required | string <uuid> 36 characters ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]... Example: 471ddea7-930c-49e8-8e99-2683834dd92e Identifier of the rental operation |
query Parameters
limit | integer <int32> Default: 500 Example: limit=100 A limit on the number of objects to be returned |
next | string Example: next=NTM2NTA The next token used to retrieve additional data |
previous | string Example: previous=NTQxNTA The previous token used to retrieve additional data |
Responses
Request samples
- Shell + Curl
- Python + Requests
- Java + Okhttp
- Node + Native
- Javascript + Xhr
- Php + Curl
- Go + Native
- Ruby + Native
- Csharp + Restsharp
curl --request GET \ --url https://api.sms.cx/numbers/rent/471ddea7-930c-49e8-8e99-2683834dd92e/inbound \ --header 'Authorization: Bearer REPLACE_ACCESS_TOKEN'
Response samples
- 200
- 400
- 401
- 403
- 404
- 405
- 429
- 500
{- "info": {
- "rentId": "471ddea7-930c-49e8-8e99-2683834dd92e",
- "phoneNumber": "+33612384540",
- "countryIso": "FR"
}, - "data": [
- {
- "msgId": "05f84c39-1f05-4bce-b55d-03ec10cfb5da",
- "from": "+33612454289",
- "countryIso": "FR",
- "to": "+33612384540",
- "text": "This is a reply on the rented phone number",
- "cost": 0,
- "receivedAt": "2022-10-09 14:15:05"
}, - {
- "msgId": "303b32a8-8c2d-49ee-a87f-cdd8b5d6ab7f",
- "from": "+33612966467",
- "countryIso": "FR",
- "to": "+33612384540",
- "text": "Another reply",
- "cost": 0,
- "receivedAt": "2022-10-09 10:10:21"
}, - {
- "msgId": "2cac3909-5661-4bbf-9bb4-589277e2cf13",
- "from": "+33612546695",
- "countryIso": "FR",
- "to": "+33612384540",
- "text": "Text received on phone number",
- "cost": 0,
- "receivedAt": "2022-10-07 08:37:15"
}
]
}
Edit settings for active rent
Edit settings of active rent
Errors for GET /numbers/rent/{rentId}/edit
HTTP code | Error code | Type | Description |
---|---|---|---|
400 | 1221 | invalid_param | The rentId provided is invalid |
400 | 1225 | invalid_param | Parameter autorenew must be type boolean |
400 | 1226 | invalid_param | The parameter callbackUrl is not a valid url |
400 | 1233 | invalid_param | At least one parameter required (autoRenew, callbackUrl) |
404 | 1223 | not_found | Rent ID not found |
Authorizations:
path Parameters
rentId required | string <uuid> 36 characters ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]... Example: 471ddea7-930c-49e8-8e99-2683834dd92e Identifier of the rental operation |
Request Body schema: application/json
autoRenew | boolean Default: false Auto renew the rent of the phone number at the end of the rental period |
callbackUrl | string or null <url> Callback URL (or webhook) to get the SMS that is received on the rented phone number (inbound SMS) |
Responses
Request samples
- Payload
- Shell + Curl
- Python + Requests
- Java + Okhttp
- Node + Native
- Javascript + Xhr
- Php + Curl
- Go + Native
- Ruby + Native
- Csharp + Restsharp
{- "autoRenew": false,
}
Response samples
- 200
- 400
- 401
- 403
- 404
- 405
- 429
- 500
{- "info": {
- "rentId": "484bb5f3-b2f7-40e1-9f9f-2fdd53c00b82",
- "datetime": "2022-11-02 13:37:25"
}
}
Delete originator
Deletes an originator if a valid identifier was provided.
Errors for DELETE /originators/{originatorId}
HTTP code | Error code | Type | Description |
---|---|---|---|
404 | 1300 | not_found | Originator ID not found |
Authorizations:
path Parameters
originatorId required | integer <int32> Example: 1388 Identifier of the originator |
Responses
Request samples
- Shell + Curl
- Python + Requests
- Java + Okhttp
- Node + Native
- Javascript + Xhr
- Php + Curl
- Go + Native
- Ruby + Native
- Csharp + Restsharp
curl --request DELETE \ --url https://api.sms.cx/originators/1388 \ --header 'Authorization: Bearer REPLACE_ACCESS_TOKEN'
Response samples
- 200
- 401
- 403
- 404
- 405
- 429
- 500
{- "info": {
- "id": 5,
- "originator": "MyCompany"
}
}
Get originators list
Retrieves the list of existing originators (sender ids). The originators are returned sorted by creation date, with the most recent group appearing first.
This endpoint should not return an error. If no originators are available, an empty data object is returned
Authorizations:
Responses
Request samples
- Shell + Curl
- Python + Requests
- Java + Okhttp
- Node + Native
- Javascript + Xhr
- Php + Curl
- Go + Native
- Ruby + Native
- Csharp + Restsharp
curl --request GET \ --url https://api.sms.cx/originators \ --header 'Authorization: Bearer REPLACE_ACCESS_TOKEN'
Response samples
- 200
- 401
- 403
- 405
- 429
- 500
{- "data": [
- {
- "id": 9,
- "originator": "InfoText",
- "twoWay": [ ],
- "isDefault": false,
- "approved": true,
- "createdAt": "2021-05-03 14:51:18"
}, - {
- "id": 11,
- "originator": "MyCompany",
- "twoWay": [ ],
- "isDefault": false,
- "approved": false,
- "createdAt": "2021-05-12 15:49:05"
}, - {
- "id": 12,
- "originator": "+33612542734",
- "twoWay": {
- "type": "VLN",
- "countryIso": "FR",
- "expireDate": "2022-03-16 14:00:00"
}, - "isDefault": false,
- "approved": true,
- "createdAt": "2022-02-01 14:51:18"
}
]
}
Create new originator
Creates and submits an originator for approval.
Errors for POST /originators
HTTP code | Error code | Type | Description |
---|---|---|---|
400 | 1301 | invalid_param | The originator is empty or parameter originator not set |
400 | 1303 | invalid_param | The parameter originator can contain only letters and numbers |
400 | 1304 | invalid_param | The alphanumeric originator provided is invalid (min 3, max 11 characters) |
400 | 1305 | invalid_param | The numeric originator provided is invalid (min 3, max 15 characters) |
400 | 1306 | duplicate_value | Originator already exists |
Authorizations:
Request Body schema: application/json
originator required | string [ 3 .. 15 ] characters ^[a-zA-Z0-9]+$ |
Responses
Request samples
- Payload
- Shell + Curl
- Python + Requests
- Java + Okhttp
- Node + Native
- Javascript + Xhr
- Php + Curl
- Go + Native
- Ruby + Native
- Csharp + Restsharp
{- "originator": "MyCompany"
}
Response samples
- 201
- 400
- 401
- 403
- 405
- 429
- 500
{- "info": {
- "id": 5,
- "originator": "MyCompany"
}
}
Get templates list
Retrieves the list of existing templates. The templates are returned sorted by creation date, with the most recent templates appearing first.
This endpoint should not return an error. If no templates are available, an empty data object is returned.
Authorizations:
Responses
Request samples
- Shell + Curl
- Python + Requests
- Java + Okhttp
- Node + Native
- Javascript + Xhr
- Php + Curl
- Go + Native
- Ruby + Native
- Csharp + Restsharp
curl --request GET \ --url https://api.sms.cx/templates \ --header 'Authorization: Bearer REPLACE_ACCESS_TOKEN'
Response samples
- 200
- 401
- 403
- 405
- 429
- 500
{- "data": [
- {
- "id": 20,
- "name": "Appointment reminder",
- "channel": "sms",
- "text": "Hello {{firstName}} {{lastName}}. This is to remind you of your appointment on {{date}}",
- "createdAt": "2021-07-11 09:09:44",
- "approved": true
}, - {
- "id": 44,
- "name": "Order confirmation",
- "channel": "sms",
- "text": "Your order {{orderNumber}} at Bike Shop in amount of {{price}} has been successfully placed. Regards, Bike Shop Team",
- "createdAt": "2021-07-07 09:18:59",
- "approved": true
}, - {
- "id": 58,
- "name": "Whatsapp order status",
- "channel": "whatsapp",
- "text": "Hi {{firstName}}. Your order {{orderNumber}} is being processed. Thank you!",
- "createdAt": "2021-05-22 08:22:25",
- "approved": true
}, - {
- "id": 65,
- "name": "Viber template ",
- "channel": "viber",
- "text": "Hi {{firstName}}. Thank you for your enquiry. We will get in touch shortly.",
- "createdAt": "2021-06-08 19:27:32",
- "approved": false
}
]
}
Create template
Creates a new template.
Errors for POST /templates
HTTP code | Error code | Type | Description |
---|---|---|---|
400 | 1801 | invalid_param | The text message is empty or parameter text not set |
400 | 1802 | invalid_param | The parameter text is invalid |
400 | 1803 | invalid_param | The name provided is invalid (min 3, max 100 characters) |
400 | 1806 | invalid_param | The parameter channel is not valid. Allowed values: |
400 | 1805 | duplicate_value | You already have a template with this name |
400 | 1811 | invalid_param | Text message too long (max 1000 characters) |
400 | 1808 | invalid_param | Button caption is too long (min 1, max. 30 characters) |
400 | 1809 | invalid_param | Invalid target URL |
400 | 1810 | invalid_param | Invalid image URL |
Authorizations:
Request Body schema: application/json
name | string [ 3 .. 100 ] characters The name of the template. If this parameter is omitted the name of the template will be set by the API eg. "Template 2021-06-11 21:00:00" |
text required | string Template text. For channels |
channel | string Enum: "sms" "viber" "whatsapp" The channel for wich the template is saved |
object (RichMedia) |
Responses
Request samples
- Payload
- Shell + Curl
- Python + Requests
- Java + Okhttp
- Node + Native
- Javascript + Xhr
- Php + Curl
- Go + Native
- Ruby + Native
- Csharp + Restsharp
{- "name": "Summer Sale 2021",
- "text": "Redeem this voucher in the next 30 days to get a 30% discount off all Summer Fashion {shortlink:xSgW}"
}
Response samples
- 201
- 400
- 401
- 403
- 405
- 429
- 500
{- "info": {
- "id": 36,
- "name": "Summer Sale 2021",
- "text": "Redeem this voucher in the next 30 days to get a 30% discount off all Summer Fashion ",
- "channel": "sms"
}
}
Get template
Retrieves the details of a template if a valid identifier was provided.
Errors for GET /templates/{templateId}
HTTP code | Error code | Type | Description |
---|---|---|---|
404 | 1800 | not_found | Template ID not found |
Authorizations:
path Parameters
templateId required | integer <int32> Example: 39774 Identifier of the template |
Responses
Request samples
- Shell + Curl
- Python + Requests
- Java + Okhttp
- Node + Native
- Javascript + Xhr
- Php + Curl
- Go + Native
- Ruby + Native
- Csharp + Restsharp
curl --request GET \ --url https://api.sms.cx/templates/39774 \ --header 'Authorization: Bearer REPLACE_ACCESS_TOKEN'
Response samples
- 200
- 401
- 403
- 404
- 405
- 429
- 500
{- "data": {
- "id": 37,
- "name": "Template 2021-07-20 11:55:39",
- "text": "Redeem this voucher in the next 30 days to get a 30% discount off all Summer Fashion {shortlink:xSgW}",
- "channel": "sms",
- "richMedia": { },
- "createdAt": "2021-07-20 11:55:39",
- "approved": true,
- "locked": false
}
}
Delete template
Deletes a template if a valid identifier was provided.
Errors for DELETE /templates/{templateId}
HTTP code | Error code | Type | Description |
---|---|---|---|
404 | 1800 | not_found | Template ID not found |
Authorizations:
path Parameters
templateId required | integer <int32> Example: 39774 Identifier of the template |
Responses
Request samples
- Shell + Curl
- Python + Requests
- Java + Okhttp
- Node + Native
- Javascript + Xhr
- Php + Curl
- Go + Native
- Ruby + Native
- Csharp + Restsharp
curl --request DELETE \ --url https://api.sms.cx/templates/39774 \ --header 'Authorization: Bearer REPLACE_ACCESS_TOKEN'
Response samples
- 200
- 401
- 403
- 404
- 405
- 429
- 500
{- "info": {
- "id": 36
}
}
Update template
Updates the specified template by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
Returns HTTP 204 No content
if the parameters provided did not update the template because the data was already the same.
Errors for PATCH /templates/{templateId}
HTTP code | Error code | Type | Description |
---|---|---|---|
404 | 1800 | not_found | Template ID not found |
400 | 1802 | invalid_param | The parameter text is invalid |
400 | 1803 | invalid_param | The name provided is invalid (min 3, max 100 characters) |
400 | 1804 | invalid_param | At least one parameter required (name, text) |
400 | 1811 | invalid_param | Text message too long (max 1000 characters) |
403 | 1812 | access_denied | Template is locked for editing |
400 | 1810 | invalid_param | Invalid image URL |
400 | 1808 | invalid_param | Button caption is too long (min 1, max. 30 characters) |
400 | 1809 | invalid_param | Invalid target URL |
400 | 1805 | duplicate_value | You already have a template with this name |
Authorizations:
path Parameters
templateId required | integer <int32> Example: 39774 Identifier of the template |
Request Body schema: application/json
name | string [ 3 .. 100 ] characters The name of the template. If this parameter is omitted the name of the template will be set by the API eg. "Template 2021-06-11 21:00:00" |
text | string Template text. For channels |
channel | string Enum: "sms" "viber" "whatsapp" The channel for wich the template is saved |
object (RichMedia) |
Responses
Request samples
- Payload
- Shell + Curl
- Python + Requests
- Java + Okhttp
- Node + Native
- Javascript + Xhr
- Php + Curl
- Go + Native
- Ruby + Native
- Csharp + Restsharp
{- "name": "My new template name",
- "text": "My new template text."
}
Response samples
- 200
- 400
- 401
- 403
- 404
- 405
- 429
- 500
{- "info": {
- "id": 488
}
}
Receive details of visitor of shortlink Webhook
POST
https://{{your-endpoint}}/path-for-shortlink-hit
The SMS.CX API will make a POST
request to your webhook endpoint, which must return HTTP response 200
. If the response is not HTTP 200, SMS.CX API will retry the callback request for the next 24 hours using an exponential backoff algorithm.
Authorizations:
Request Body schema: application/json
event required | string Enum: "shortlink_hit" "shortlink_hit_update" Event for which the callback request is made |
required | Array of objects (DataShortlinkHit) Event type data, grouped in multiple objects (up to 200 in a request) |
Responses
Request samples
- Payload
{- "event": "shortlink_hit",
- "data": [
- {
- "hitId": 12255,
- "shortlinkId": "Qqe",
- "phoneNumber": "+4915123596239",
- "phoneNumberCountryIso": "DE",
- "groupId": "45598",
- "campaignId": "df1d5b8c-71fa-4015-9e7d-6d52aae18b6b",
- "device": "mobile",
- "browser": "Mobile Safari",
- "browserVersion": "14.0",
- "os": "iOS",
- "osVersion": "14.6",
- "brand": "Apple",
- "model": "iPhone",
- "screenResolution": "980x2123",
- "acceptLanguage": "en-US",
- "ipAddress": "81.169.181.0",
- "countryIso": "DE",
- "city": "Berlin",
- "isBot": false,
- "datetime": "2022-03-07 11:31:56"
}, - {
- "hitId": 15594,
- "shortlinkId": "Qqe",
- "phoneNumber": "+393123934691",
- "phoneNumberCountryIso": "IT",
- "groupId": "45598",
- "campaignId": "df1d5b8c-71fa-4015-9e7d-6d52aae18b6b",
- "device": "mobile",
- "browser": "Samsung Browser",
- "browserVersion": "14.2",
- "os": "Android",
- "osVersion": "11",
- "brand": "Samsung",
- "model": "Galaxy S10",
- "screenResolution": "360x760",
- "acceptLanguage": "en-US",
- "ipAddress": "87.1.187.0",
- "countryIso": "IT",
- "city": "Perugia",
- "isBot": false,
- "datetime": "2022-03-07 11:31:57"
}, - {
- "hitId": 16656,
- "shortlinkId": "Qqe",
- "phoneNumber": "+33612157220",
- "phoneNumberCountryIso": "FR",
- "groupId": "45598",
- "campaignId": "df1d5b8c-71fa-4015-9e7d-6d52aae18b6b",
- "device": "mobile",
- "browser": "Android Browser",
- "os": "Android",
- "osVersion": "4.3",
- "brand": "Samsung",
- "model": "Galaxy Note 3",
- "screenResolution": "980x1742",
- "acceptLanguage": "en-US",
- "ipAddress": "78.193.204.0",
- "countryIso": "FR",
- "city": "Paris",
- "isBot": false,
- "datetime": "2022-03-07 11:31:57"
}
]
}
Get shortlinks list
Retrieves the list of existing shortlinks. The shortlinks are returned sorted by creation date, with the most recent shortlink appearing first.
This endpoint should not return an error. If no shortlinks are available, an empty data object is returned.
Authorizations:
Responses
Request samples
- Shell + Curl
- Python + Requests
- Java + Okhttp
- Node + Native
- Javascript + Xhr
- Php + Curl
- Go + Native
- Ruby + Native
- Csharp + Restsharp
curl --request GET \ --url https://api.sms.cx/shortlinks \ --header 'Authorization: Bearer REPLACE_ACCESS_TOKEN'
Response samples
- 200
- 401
- 403
- 405
- 429
- 500
{- "data": [
- {
- "id": "sBGj",
- "name": "My Shortlink",
- "hits": 15,
- "dateCreated": "2021-06-17 06:18:21"
}, - {
- "id": "XoVO",
- "name": "Second shortlink",
- "hits": 2464,
- "dateCreated": "2021-05-30 14:51:17"
}
]
}
Create shortlink
Creates a new shortlink.
Errors for POST /shortlinks
HTTP code | Error code | Type | Description |
---|---|---|---|
400 | 1401 | invalid_param | The URL is empty or parameter url not set |
400 | 1402 | invalid_param | The URL provided is invalid |
400 | 1404 | invalid_param | The parameter name is invalid (min 3, max 25 characters) |
400 | 1405 | duplicate_id | Short ID already exists |
Authorizations:
Request Body schema: application/json
name | string [ 3 .. 25 ] characters If this parameter is omitted the name of the shortlink will be set by the API eg. "Short link #433" |
url required | string A valid URL |
Responses
Request samples
- Payload
- Shell + Curl
- Python + Requests
- Java + Okhttp
- Node + Native
- Javascript + Xhr
- Php + Curl
- Go + Native
- Ruby + Native
- Csharp + Restsharp
{- "name": "My Shortlink",
}
Response samples
- 201
- 400
- 401
- 403
- 405
- 429
- 500
{- "info": {
- "id": "KgTX",
- "name": "My Shortlink",
}
}
Get shortlink hits
Retrieves the hits details (phone number, device, model, operating system, browser, city, country, etc.) of a shortlink if a valid identifier was provided.
Errors for GET /shortlinks/{shortId}
HTTP code | Error code | Type | Description |
---|---|---|---|
404 | 1400 | not_found | Shortlink ID not found |
Authorizations:
path Parameters
shortId required | string Example: KgTX Identifier of the shortlink |
query Parameters
short_response | boolean Default: false If set to true, it will return the full |
limit | integer <int32> Default: 500 Example: limit=100 A limit on the number of objects to be returned |
next | string Example: next=NTM2NTA The next token used to retrieve additional data |
previous | string Example: previous=NTQxNTA The previous token used to retrieve additional data |
Responses
Request samples
- Shell + Curl
- Python + Requests
- Java + Okhttp
- Node + Native
- Javascript + Xhr
- Php + Curl
- Go + Native
- Ruby + Native
- Csharp + Restsharp
curl --request GET \ --url 'https://api.sms.cx/shortlinks/KgTX?short_response=SOME_BOOLEAN_VALUE' \ --header 'Authorization: Bearer REPLACE_ACCESS_TOKEN'
Response samples
- 200
- 401
- 403
- 404
- 405
- 429
- 500
{- "info": {
- "id": "HSc5",
- "name": "My Shortlink",
- "dateCreated": "2021-05-12 16:57:03",
- "hits": 2
}, - "data": [
- {
- "hitId": 32764,
- "phoneNumber": "+4915123722313",
- "phoneNumberCountryIso": "DE",
- "campaignId": "7f543bdc-dcc5-47c3-b54a-ee425f78cb3c",
- "groupId": 55432,
- "device": "mobile",
- "browser": "Chrome",
- "browserVersion": "91",
- "os": "Android",
- "osVersion": "6",
- "brand": "Huawei",
- "model": "P30 Pro",
- "screenResolution": "2340x1080",
- "acceptLanguage": "en",
- "ipAddress": "204.79.200.0",
- "countryIso": "DE",
- "city": "Berlin",
- "datetime": "2020-02-28 13:15:00"
}, - {
- "hitId": 32776,
- "phoneNumber": "+393123873291",
- "phoneNumberCountryIso": "IT",
- "campaignId": "7f543bdc-dcc5-47c3-b54a-ee425f78cb3c",
- "groupId": 55432,
- "device": "mobile",
- "browser": "Safari",
- "browserVersion": "14",
- "os": "iOS",
- "osVersion": "14",
- "brand": "Iphone",
- "model": "10",
- "screenResolution": "236x1125",
- "acceptLanguage": "en",
- "ipAddress": "5.11.96.0",
- "countryIso": "IT",
- "city": "Rome",
- "datetime": "2020-02-28 14:00:00"
}
]
}
Delete shortlink
Deletes a shortlink and all the hits data associated, if a valid identifier was provided.
Errors for DELETE /shortlinks/{shortId}
HTTP code | Error code | Type | Description |
---|---|---|---|
404 | 1400 | not_found | Shortlink ID not found |
Authorizations:
path Parameters
shortId required | string Example: KgTX Identifier of the shortlink |
Responses
Request samples
- Shell + Curl
- Python + Requests
- Java + Okhttp
- Node + Native
- Javascript + Xhr
- Php + Curl
- Go + Native
- Ruby + Native
- Csharp + Restsharp
curl --request DELETE \ --url https://api.sms.cx/shortlinks/KgTX \ --header 'Authorization: Bearer REPLACE_ACCESS_TOKEN'
Response samples
- 200
- 401
- 403
- 404
- 405
- 429
- 500
{- "info": {
- "id": "sBGj"
}
}
Update shortlink
Updates the specified shortlink by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
Returns HTTP 204 No content
if the parameters provided did not update the contact because the data was already the same.
Errors for PATCH /shortlinks/{shortId}
HTTP code | Error code | Type | Description |
---|---|---|---|
404 | 1400 | not_found | Shortlink ID not found |
400 | 1401 | invalid_param | The URL is empty or parameter url not set |
400 | 1402 | invalid_param | The URL provided is invalid |
400 | 1404 | invalid_param | The parameter name is invalid (min 3, max 25 characters) |
400 | 1406 | invalid_param | At least one parameter required (name, url) |
400 | 1407 | duplicate_value | You already have a shortlink with this name |
Authorizations:
path Parameters
shortId required | string |
Request Body schema: application/json
name required | string [ 3 .. 25 ] characters New name for the shortlink |
url required | string New long URL |
Responses
Request samples
- Payload
- Shell + Curl
- Python + Requests
- Java + Okhttp
- Node + Native
- Javascript + Xhr
- Php + Curl
- Go + Native
- Ruby + Native
- Csharp + Restsharp
{- "name": "My Edited Shortlink",
}
Response samples
- 200
- 400
- 401
- 403
- 404
- 405
- 429
- 500
{- "info": {
- "id": "KgTX"
}
}
Export shortlink hits to CSV
Exports the hits details of a shortlink (phone number, device, model, operating system, browser, city, country, etc.) to a CSV file.
If there are no hits for the shortlink, an empty CSV file is returned (with first line headers).
Errors for GET /shortlinks/{shortId}/csv
HTTP code | Error code | Type | Description |
---|---|---|---|
404 | 1400 | not_found | Shortlink ID not found |
Authorizations:
path Parameters
shortId required | string Example: KgTX Identifier of the shortlink |
Responses
Request samples
- Shell + Curl
- Python + Requests
- Java + Okhttp
- Node + Native
- Javascript + Xhr
- Php + Curl
- Go + Native
- Ruby + Native
- Csharp + Restsharp
curl --request GET \ --url https://api.sms.cx/shortlinks/KgTX/csv \ --header 'Authorization: Bearer REPLACE_ACCESS_TOKEN'
Response samples
- 200
- 401
- 403
- 404
- 405
- 429
- 500
Export shortlink hits to XLSX
Exports the hits details of a shortlink (phone number, device, model, operating system, browser, city, country, etc.) to a XLSX file (Excel).
If there are no hits for the shortlink, an empty XLSX file is returned (with first line headers).
Errors for GET /shortlinks/{shortId}/xlsx
HTTP code | Error code | Type | Description |
---|---|---|---|
404 | 1400 | not_found | Shortlink ID not found |
Authorizations:
path Parameters
shortId required | string Example: KgTX Identifier of the shortlink |
Responses
Request samples
- Shell + Curl
- Python + Requests
- Java + Okhttp
- Node + Native
- Javascript + Xhr
- Php + Curl
- Go + Native
- Ruby + Native
- Csharp + Restsharp
curl --request GET \ --url https://api.sms.cx/shortlinks/KgTX/xlsx \ --header 'Authorization: Bearer REPLACE_ACCESS_TOKEN'
Response samples
- 200
- 401
- 403
- 404
- 405
- 429
- 500
Receive details of visitor of attachment Webhook
POST
https://{{your-endpoint}}//path-for-attachment-hit
The SMS.CX API will make a POST
request to your webhook endpoint, which must return HTTP response 200
. If the response is not HTTP 200, SMS.CX API will retry the callback request for the next 24 hours using an exponential backoff algorithm.
Authorizations:
Request Body schema: application/json
event required | string Enum: "attachment_hit" "attachment_hit_update" Event for which the callback request is made |
required | Array of objects (DataShortlinkHit) Event type data, grouped in multiple objects (up to 200 in a request) |
Responses
Request samples
- Payload
{- "event": "attachment_hit",
- "data": [
- {
- "hitId": 12255,
- "shortlinkId": "Qqe",
- "phoneNumber": "+4915123596239",
- "phoneNumberCountryIso": "DE",
- "groupId": "45598",
- "campaignId": "df1d5b8c-71fa-4015-9e7d-6d52aae18b6b",
- "device": "mobile",
- "browser": "Mobile Safari",
- "browserVersion": "14.0",
- "os": "iOS",
- "osVersion": "14.6",
- "brand": "Apple",
- "model": "iPhone",
- "screenResolution": "980x2123",
- "acceptLanguage": "en-US",
- "ipAddress": "81.169.181.0",
- "countryIso": "DE",
- "city": "Berlin",
- "isBot": false,
- "datetime": "2022-03-07 11:31:56"
}, - {
- "hitId": 15594,
- "shortlinkId": "Qqe",
- "phoneNumber": "+393123934691",
- "phoneNumberCountryIso": "IT",
- "groupId": "45598",
- "campaignId": "df1d5b8c-71fa-4015-9e7d-6d52aae18b6b",
- "device": "mobile",
- "browser": "Samsung Browser",
- "browserVersion": "14.2",
- "os": "Android",
- "osVersion": "11",
- "brand": "Samsung",
- "model": "Galaxy S10",
- "screenResolution": "360x760",
- "acceptLanguage": "en-US",
- "ipAddress": "87.1.187.0",
- "countryIso": "IT",
- "city": "Perugia",
- "isBot": false,
- "datetime": "2022-03-07 11:31:57"
}, - {
- "hitId": 16656,
- "shortlinkId": "Qqe",
- "phoneNumber": "+33612157220",
- "phoneNumberCountryIso": "FR",
- "groupId": "45598",
- "campaignId": "df1d5b8c-71fa-4015-9e7d-6d52aae18b6b",
- "device": "mobile",
- "browser": "Android Browser",
- "os": "Android",
- "osVersion": "4.3",
- "brand": "Samsung",
- "model": "Galaxy Note 3",
- "screenResolution": "980x1742",
- "acceptLanguage": "en-US",
- "ipAddress": "78.193.204.0",
- "countryIso": "FR",
- "city": "Paris",
- "isBot": false,
- "datetime": "2022-03-07 11:31:57"
}
]
}
Get attachments list
Retrieves the list of existing attachments. The attachments are returned sorted by creation date, with the most recent attachment appearing first.
This endpoint should not return an error. If no attachments are available, an empty data object is returned.
Authorizations:
Responses
Request samples
- Shell + Curl
- Python + Requests
- Java + Okhttp
- Node + Native
- Javascript + Xhr
- Php + Curl
- Go + Native
- Ruby + Native
- Csharp + Restsharp
curl --request GET \ --url https://api.sms.cx/attachments \ --header 'Authorization: Bearer REPLACE_ACCESS_TOKEN'
Response samples
- 200
- 401
- 403
- 405
- 429
- 500
{- "data": [
- {
- "id": "G3Df",
- "name": "My attachment #1",
- "fileType": "txt",
- "hits": 221,
- "dateCreated": "2021-07-03 20:57:52"
}, - {
- "id": "BYr6",
- "name": "Attachment #2",
- "fileType": "pdf",
- "hits": 3,
- "dateCreated": "2021-05-28 12:07:14"
}
]
}
Get attachment hits
Retrieves the hits details (phone number, device, model, operating system, browser, city, country, etc.) of an attachment if a valid identifier was provided.
Errors for GET /attachments/{attachmentId}
HTTP code | Error code | Type | Description |
---|---|---|---|
404 | 1420 | not_found | Attachment ID not found |
Authorizations:
path Parameters
attachmentId required | string Example: KgTX Identifier of the attachment |
query Parameters
short_response | boolean Default: false If set to true, it will return the full |
limit | integer <int32> Default: 500 Example: limit=100 A limit on the number of objects to be returned |
next | string Example: next=NTM2NTA The next token used to retrieve additional data |
previous | string Example: previous=NTQxNTA The previous token used to retrieve additional data |
Responses
Request samples
- Shell + Curl
- Python + Requests
- Java + Okhttp
- Node + Native
- Javascript + Xhr
- Php + Curl
- Go + Native
- Ruby + Native
- Csharp + Restsharp
curl --request GET \ --url 'https://api.sms.cx/attachments/KgTX?short_response=SOME_BOOLEAN_VALUE' \ --header 'Authorization: Bearer REPLACE_ACCESS_TOKEN'
Response samples
- 200
- 401
- 403
- 404
- 405
- 429
- 500
{- "info": {
- "id": "BYr6",
- "name": "Attachment 22",
- "fileType": "pdf",
- "dateCreated": "2021-05-28 12:07:14",
- "hits": 2
}, - "data": [
- {
- "hitId": 1332,
- "phoneNumber": "+4915123722313",
- "phoneNumberCountryIso": "DE",
- "campaignId": "7f543bdc-dcc5-47c3-b54a-ee425f78cb3c",
- "groupId": 55432,
- "device": "mobile",
- "browser": "Chrome",
- "browserVersion": "91",
- "os": "Android",
- "osVersion": "6",
- "brand": "Huawei",
- "model": "P30 Pro",
- "screenResolution": "2340x1080",
- "acceptLanguage": "en",
- "ipAddress": "204.79.200.0",
- "countryIso": "DE",
- "city": "Berlin",
- "datetime": "2020-03-28 13:15:00"
}, - {
- "hitId": 1445,
- "phoneNumber": "+393123873291",
- "phoneNumberCountryIso": "IT",
- "campaignId": "7f543bdc-dcc5-47c3-b54a-ee425f78cb3c",
- "groupId": 55432,
- "device": "mobile",
- "browser": "Safari",
- "browserVersion": "14",
- "os": "iOS",
- "osVersion": "14",
- "brand": "Iphone",
- "model": "10",
- "screenResolution": "236x1125",
- "acceptLanguage": "en",
- "ipAddress": "5.11.96.0",
- "countryIso": "IT",
- "city": "Rome",
- "datetime": "2020-03-28 14:00:00"
}
]
}
Delete attachment
Deletes an attachment and all the hits data associated, if a valid identifier was provided.
Errors for DELETE /attachments/{attachmentId}
HTTP code | Error code | Type | Description |
---|---|---|---|
404 | 1420 | not_found | Attachment ID not found |
Authorizations:
path Parameters
attachmentId required | string Example: KgTX Identifier of the attachment |
Responses
Request samples
- Shell + Curl
- Python + Requests
- Java + Okhttp
- Node + Native
- Javascript + Xhr
- Php + Curl
- Go + Native
- Ruby + Native
- Csharp + Restsharp
curl --request DELETE \ --url https://api.sms.cx/attachments/KgTX \ --header 'Authorization: Bearer REPLACE_ACCESS_TOKEN'
Response samples
- 200
- 401
- 403
- 404
- 405
- 429
- 500
{- "info": {
- "id": "BYr6"
}
}
Export attachment hits to CSV
Exports the hits details of an attachment (phone number, device, model, operating system, browser, city, country, etc.) to a CSV file.
If there are no hits for the attachment, an empty CSV file is returned (with first line headers).
Errors for GET /attachments/{attachmentId}/csv
HTTP code | Error code | Type | Description |
---|---|---|---|
404 | 1420 | not_found | Attachment ID not found |
Authorizations:
path Parameters
attachmentId required | string Example: KgTX Identifier of the attachment |
Responses
Request samples
- Shell + Curl
- Python + Requests
- Java + Okhttp
- Node + Native
- Javascript + Xhr
- Php + Curl
- Go + Native
- Ruby + Native
- Csharp + Restsharp
curl --request GET \ --url https://api.sms.cx/attachments/KgTX/csv \ --header 'Authorization: Bearer REPLACE_ACCESS_TOKEN'
Response samples
- 200
- 401
- 403
- 404
- 405
- 429
- 500
Export attachment hits to XLSX
Exports the hits details of an attachment (phone number, device, model, operating system, browser, city, country, etc.) to a XLSX file (Excel).
If there are no hits for the attachment, an empty XLSX file is returned (with first line headers).
Errors for GET /attachments/{attachmentId}/xlsx
HTTP code | Error code | Type | Description |
---|---|---|---|
404 | 1420 | not_found | Attachment ID not found |
Authorizations:
path Parameters
attachmentId required | string Example: KgTX Identifier of the attachment |
Responses
Request samples
- Shell + Curl
- Python + Requests
- Java + Okhttp
- Node + Native
- Javascript + Xhr
- Php + Curl
- Go + Native
- Ruby + Native
- Csharp + Restsharp
curl --request GET \ --url https://api.sms.cx/attachments/KgTX/xlsx \ --header 'Authorization: Bearer REPLACE_ACCESS_TOKEN'
Response samples
- 200
- 401
- 403
- 404
- 405
- 429
- 500
Receive details of a new optout Webhook
POST
https://{{your-endpoint}}/path-for-new-optout
The SMS.CX API will make a POST
request to your webhook endpoint, which must return HTTP response 200
. If the response is not HTTP 200, SMS.CX API will retry the callback request for the next 24 hours using an exponential backoff algorithm.
Authorizations:
Request Body schema: application/json
event required | string Value: "new_optout" Event for which the callback request is made |
required | Array of objects (DataNewOptout) Event data, grouped in multiple objects (up to 200 in a request) |
Responses
Request samples
- Payload
{- "event": "new_optout",
- "data": [
- {
- "hitId": 15446,
- "optoutId": "gHa",
- "optoutType": "link",
- "phoneNumber": "+4915123483506",
- "countryIso": "DE",
- "campaignId": "d7fb5bab-24c8-4da8-91b5-4ef614601648",
- "datetime": "2022-03-06 16:38:41"
}, - {
- "hitId": 15449,
- "optoutId": "gHa",
- "optoutType": "link",
- "phoneNumber": "+34612502042",
- "countryIso": "ES",
- "campaignId": "d7fb5bab-24c8-4da8-91b5-4ef614601648",
- "datetime": "2022-03-06 16:38:41"
}, - {
- "hitId": 15553,
- "optoutId": "gHa",
- "optoutType": "link",
- "phoneNumber": "+393123783085",
- "countryIso": "IT",
- "campaignId": "d7fb5bab-24c8-4da8-91b5-4ef614601648",
- "datetime": "2022-03-06 16:38:41"
}
]
}
Get optouts list
Retrieves the list of existing contacts that opted out. The optouts are returned sorted by creation date, with the most recent optout contact appearing first.
This endpoint should not return an error. If no optouts are available, an empty data object is returned.
Authorizations:
query Parameters
limit | integer <int32> Default: 500 Example: limit=100 A limit on the number of objects to be returned |
next | string Example: next=NTM2NTA The next token used to retrieve additional data |
previous | string Example: previous=NTQxNTA The previous token used to retrieve additional data |
Responses
Request samples
- Shell + Curl
- Python + Requests
- Java + Okhttp
- Node + Native
- Javascript + Xhr
- Php + Curl
- Go + Native
- Ruby + Native
- Csharp + Restsharp
curl --request GET \ --url https://api.sms.cx/optouts \ --header 'Authorization: Bearer REPLACE_ACCESS_TOKEN'
Response samples
- 200
- 401
- 403
- 405
- 429
- 500
{- "data": [
- {
- "id": 4,
- "phoneNumber": "+4915123130793",
- "countryIso": "DE",
- "optoutFrom": "link",
- "campaignId": "a079b9d0-2e2d-4de5-a895-dc476c98b4fb",
- "datetime": "2021-05-01 07:15:05"
}, - {
- "id": 14,
- "phoneNumber": "+393123118332",
- "countryIso": "IT",
- "optoutFrom": "admin",
- "datetime": "2021-05-12 17:21:12"
}
]
}
Add contact to optouts list
Add contacts to the optout list. Even if you mistakenly send SMS to a contact that is in the optouts list, the SMS.CX API will detect the contact and not send any messages to unsubscribed contacts. Also, you will not be billed - sending a SMS to an unsubscribed contact will be saved as 0 cost.
Errors for POST /optouts
HTTP code | Error code | Type | Description |
---|---|---|---|
400 | 1203 | invalid_param | The parameter phoneNumbers is empty or not set |
400 | 1208 | invalid_param | The parameter phoneNumbers must be an array of phone numbers |
400 | 1210 | invalid_param | The phone numbers provided are invalid |
400 | 1441 | invalid_param | No valid phone numbers were provided or already in the optout list |
Authorizations:
Request Body schema: application/json
phoneNumbers required | Array of strings Array of phone numbers in international E.164 format or national format. If national format is provided, for better validation you must use the parameter |
allowInvalid | boolean Default: false Set value |
countryIso | string 2 characters Two-letter country ISO of the phone number you want to validate. If an international E.164 phone number format is provided the countryIso will be ignored |
Responses
Request samples
- Payload
- Shell + Curl
- Python + Requests
- Java + Okhttp
- Node + Native
- Javascript + Xhr
- Php + Curl
- Go + Native
- Ruby + Native
- Csharp + Restsharp
{- "phoneNumbers": [
- "+4915123354593",
- "+41781652807",
- "39312383",
- "+33612224786",
- "+393123534678"
], - "allowInvalid": true
}
Response samples
- 200
- 400
- 401
- 403
- 405
- 429
- 500
{- "info": {
- "totalValid": 4,
- "totalInvalid": 1,
- "totalDuplicates": 0,
- "totalPhoneNumbers": 5,
- "phoneNumbersByCountry": {
- "DE": 1,
- "CH": 1,
- "FR": 1,
- "IT": 1
}, - "invalid": [
- "39312383"
]
}
}
Delete contact from optouts list
Removes a contact from the optout list if a valid phone number identifier was provided.
Only contacts that were added with the API can be deleted.
Contacts that opted out via link
cannot be deleted.
Errors for DELETE /optouts/{optoutId}
HTTP code | Error code | Type | Description |
---|---|---|---|
404 | 1202 | not_found | Phone number ID not found |
403 | 1443 | access_denied | Cannot delete this phone number from the optout list because it was added via optout type link . Allowed optout type to delete: admin |
Authorizations:
path Parameters
optoutId required | integer <int32> Example: 458 Identifier of the phone number in the optout list |
Responses
Request samples
- Shell + Curl
- Python + Requests
- Java + Okhttp
- Node + Native
- Javascript + Xhr
- Php + Curl
- Go + Native
- Ruby + Native
- Csharp + Restsharp
curl --request DELETE \ --url https://api.sms.cx/optouts/458 \ --header 'Authorization: Bearer REPLACE_ACCESS_TOKEN'
Response samples
- 200
- 401
- 403
- 404
- 405
- 429
- 500
{- "info": {
- "id": "14",
- "phoneNumber": "+393123118332"
}
}
Export optouts to CSV
Exports the contacts from the optout list to a CSV file.
If the optout list is empty, an empty CSV file is returned (with first line headers).
Authorizations:
Responses
Request samples
- Shell + Curl
- Python + Requests
- Java + Okhttp
- Node + Native
- Javascript + Xhr
- Php + Curl
- Go + Native
- Ruby + Native
- Csharp + Restsharp
curl --request GET \ --url https://api.sms.cx/optouts/csv \ --header 'Authorization: Bearer REPLACE_ACCESS_TOKEN'
Response samples
- 200
- 401
- 403
- 405
- 429
- 500
Export optouts to XLSX
Exports the contacts from the optout list to a XLSX file (Excel).
If the optout list is empty, an empty XLSX file is returned (with first line headers).
Authorizations:
Responses
Request samples
- Shell + Curl
- Python + Requests
- Java + Okhttp
- Node + Native
- Javascript + Xhr
- Php + Curl
- Go + Native
- Ruby + Native
- Csharp + Restsharp
curl --request GET \ --url https://api.sms.cx/optouts/xlsx \ --header 'Authorization: Bearer REPLACE_ACCESS_TOKEN'
Response samples
- 200
- 401
- 403
- 405
- 429
- 500
Get account balance
Retrieves the account balance, currency (eur, usd), billing (prepaid, postpaid).
Authorizations:
Responses
Request samples
- Shell + Curl
- Python + Requests
- Java + Okhttp
- Node + Native
- Javascript + Xhr
- Php + Curl
- Go + Native
- Ruby + Native
- Csharp + Restsharp
curl --request GET \ --url https://api.sms.cx/account/balance \ --header 'Authorization: Bearer REPLACE_ACCESS_TOKEN'
Response samples
- 200
- 401
- 403
- 405
- 429
- 500
{- "balance": 8947.27,
- "currency": "eur",
- "billing": "prepaid"
}
Get status of all channels
Retrieves the active status of all channels (true for active, false for inactive)
Authorizations:
Responses
Request samples
- Shell + Curl
- Python + Requests
- Java + Okhttp
- Node + Native
- Javascript + Xhr
- Php + Curl
- Go + Native
- Ruby + Native
- Csharp + Restsharp
curl --request GET \ --url https://api.sms.cx/account/channels/status \ --header 'Authorization: Bearer REPLACE_ACCESS_TOKEN'
Response samples
- 200
- 401
- 403
- 405
- 429
- 500
{- "sms": true,
- "viber": false,
- "whatsapp": true,
- "multichannel": true
}
Get channels pricing
Retrieves the full pricing for the requested channel.
Errors for GET /account/pricing/{channel}/{trafficType}
HTTP code | Error code | Type | Description |
---|---|---|---|
400 | 1521 | invalid_param | The channel requested is not valid |
403 | 1523 | no_coverage | No coverage |
Authorizations:
path Parameters
channel required | string Enum: "sms" "viber" "whatsapp" |
trafficType required | string Enum: "transactional" "promotional" "2way" |
Responses
Request samples
- Shell + Curl
- Python + Requests
- Java + Okhttp
- Node + Native
- Javascript + Xhr
- Php + Curl
- Go + Native
- Ruby + Native
- Csharp + Restsharp
curl --request GET \ --url https://api.sms.cx/account/pricing/%7Bchannel%7D \ --header 'Authorization: Bearer REPLACE_ACCESS_TOKEN'
Response samples
- 200
- 400
- 401
- 403
- 405
- 429
- 500
{- "AD": {
- "MOBILAND": 0.041,
- "DEFAULT": 0.041
}, - "AE": {
- "ETISALAT": 0.041,
- "DEFAULT": 0.041,
- "DU": 0.041
}, - "FR": {
- "ORANGE FRANCE": 0.041,
- "DEFAULT": 0.041,
- "SFR": 0.041,
- "BOUYGUES": 0.041,
- "MOBIQUITHINGS": 0.041,
- "AFONE": 0.041
}, - "NL": {
- "KPN": 0.041,
- "DEFAULT": 0.041,
- "VODAFONE LIBERTEL B.V.": 0.041,
- "T-MOBILE": 0.041,
- "TELFORT": 0.041,
- "INTERCITY ZAKELIJK": 0.041,
- "ASPIDER SOLUTIONS NEDERLAND B.V.": 0.041,
- "TELE2": 0.041,
- "TELEENA (MVNE)": 0.041,
- "VECTONE MOBILE/DELIGHT MOBILE": 0.041,
- "LYCAMOBILE": 0.041
}, - "DE": {
- "INTERACTIVE DIGITAL MEDIA": 0.041,
- "DEFAULT": 0.041,
- "NAKA AG": 0.041,
- "EASY WORLD": 0.041,
- "T-MOBILE": 0.041,
- "VODAFONE": 0.041,
- "VODAFONE/LYCAMOBILE": 0.041,
- "VODAFONE/TRUPHONE": 0.041,
- "TISMI BV": 0.041,
- "MULTICONNECT": 0.041,
- "ARGON NETWORKS": 0.041,
- "EPLUS/TELOGIC": 0.041,
- "EPLUS": 0.041,
- "EPLUS/SIPGATE": 0.041,
- "TELCOVILLAGE": 0.041,
- "O2": 0.041
}
}
Get pricing for channel by country iso
Retrieves the pricing for the requested channel, for a specific country ISO.
Errors for /account/pricing/{channel}/{trafficType}/{countryIso}
HTTP code | Error code | Type | Description |
---|---|---|---|
400 | 1521 | invalid_param | The channel requested is not valid |
400 | 1522 | invalid_param | Invalid country iso |
403 | 1523 | no_coverage | No coverage |
Authorizations:
path Parameters
channel required | string Enum: "sms" "viber" "whatsapp" |
trafficType required | string Enum: "transactional" "promotional" "2way" |
countryIso required | string 2 characters Example: FR |
Responses
Request samples
- Shell + Curl
- Python + Requests
- Java + Okhttp
- Node + Native
- Javascript + Xhr
- Php + Curl
- Go + Native
- Ruby + Native
- Csharp + Restsharp
curl --request GET \ --url https://api.sms.cx/account/pricing/%7Bchannel%7D/FR \ --header 'Authorization: Bearer REPLACE_ACCESS_TOKEN'
Response samples
- 200
- 400
- 401
- 403
- 405
- 429
- 500
{- "NL": {
- "KPN": 0.041,
- "DEFAULT": 0.041,
- "VODAFONE LIBERTEL B.V.": 0.041,
- "T-MOBILE": 0.041,
- "TELFORT": 0.041,
- "INTERCITY ZAKELIJK": 0.041,
- "ASPIDER SOLUTIONS NEDERLAND B.V.": 0.041,
- "TELE2": 0.041,
- "TELEENA (MVNE)": 0.041,
- "VECTONE MOBILE/DELIGHT MOBILE": 0.041,
- "LYCAMOBILE": 0.041
}
}
Get applications list
Retrieves the list of existing applications. The applications are returned sorted by creation date, with the most recent applications appearing first.
This endpoint should not return an error. If no applications are available, an empty data object is returned.
Authorizations:
Responses
Request samples
- Shell + Curl
- Python + Requests
- Java + Okhttp
- Node + Native
- Javascript + Xhr
- Php + Curl
- Go + Native
- Ruby + Native
- Csharp + Restsharp
curl --request GET \ --url https://api.sms.cx/applications \ --header 'Authorization: Bearer REPLACE_ACCESS_TOKEN'
Response samples
- 200
- 401
- 403
- 405
- 429
- 500
{- "data": [
- {
- "id": 19,
- "applicationId": "d762a696961514db75e536ffdf7a2fc2a65b59f3",
- "applicationSecret": "5dcbac9534dd864aeae2c06ab707b342b8e2787e",
- "applicationName": "My app 1",
- "scopes": "account applications attachments conversations groups multichannel numbers optouts originators reports shortlinks sms templates whatsapp viber",
- "tokenExpiration": "1 week",
- "createdAt": "2021-06-21 20:10:16"
}, - {
- "id": 107,
- "applicationId": "2d17a43e8eca31aa0d5c0bf6dd1228de016ce89b",
- "applicationSecret": "a971659bdd0cde747488384892c3eeecceda8481",
- "applicationName": "App 2",
- "scopes": "sms groups originators templates optouts",
- "tokenExpiration": "never",
- "createdAt": "2021-05-12 17:46:49"
}
]
}
Request samples
- Shell + Curl
- Python + Requests
- Java + Okhttp
- Node + Native
- Javascript + Xhr
- Php + Curl
- Go + Native
- Ruby + Native
- Csharp + Restsharp
curl --request GET \ --url https://api.sms.cx/applications/scopes \ --header 'Authorization: Bearer REPLACE_ACCESS_TOKEN'
Response samples
- 200
- 401
- 403
- 405
- 429
- 500
[- "sms",
- "viber",
- "whatsapp",
- "multichannel",
- "conversations",
- "reports",
- "groups",
- "originators",
- "templates",
- "shortlinks",
- "attachments",
- "optouts",
- "account",
- "applications",
- "numbers",
- "lookup",
- "otp"
]
Get application settings
Retrieves the settings of an application if a valid identifier was provided.
The method returns all scopes settings.
Errors for GET /applications/{applicationId}
HTTP code | Error code | Type | Description |
---|---|---|---|
404 | 1500 | not_found | Application ID not found |
Authorizations:
path Parameters
applicationId required | string Example: 7873310555ea4ee972518ae9559f276707c77fae Identifier of the application id |
Responses
Request samples
- Shell + Curl
- Python + Requests
- Java + Okhttp
- Node + Native
- Javascript + Xhr
- Php + Curl
- Go + Native
- Ruby + Native
- Csharp + Restsharp
curl --request GET \ --url https://api.sms.cx/applications/7873310555ea4ee972518ae9559f276707c77fae \ --header 'Authorization: Bearer REPLACE_ACCESS_TOKEN'
Response samples
- 200
- 401
- 403
- 404
- 405
- 429
- 500
{- "enforceOriginator": "InfoSMS",
- "applicationId": "dd316c87827dea724a735d7280fb5d81a0e68c3b",
- "name": "MyApplication",
- "scopes": "sms conversations reports groups originators templates shortlinks attachments optouts account applications numbers viber whatsapp",
- "tokenExpiration": "never",
- "settings": {
- "sms": {
- "enforceOriginator": "InfoText",
- "transliteration": {
- "alphabet": "NON_GSM",
- "removeEmojis": true
}, - "quietHours": {
- "start": "22",
- "stop": 9
}
}, - "multichannel": {
- "ttl": 300,
- "expireAfterTtl": true
}, - "otp": {
- "template": "Your verification code is {{pin}}",
- "from": "Verify",
- "pinType": "numbers",
- "pinLength": 5,
- "ttl": 300,
- "maxAttempts": 5,
}
}
}
This section represents a list of recent and upcoming changes to our API.
1.0.2 (10.10.2022)
- New endpoint
/numbers/rent
to rent phone numbers- GET
/numbers/rent/available/{countryIso}
to get list of available numbers for rent - GET
/numbers/rent
to get list of your rented numbers - POST
/numbers/rent
to rent phone number - GET
/numbers/rent/{rentId}
to get the status of a rented number - DELETE
/numbers/rent/{rentId}
to cancel a rented number - PATCH
/numbers/rent/{rentId}
to renew rent for a phone number - GET
/numbers/rent/{rentId}/inbound
to get inbound SMS from rented number - PATCH
/numbers/rent/{rentId}/edit
to edit settings for an active rent
- GET
1.0.1 (19.09.2022)
- New endpoint
/numbers/lookup
to lookup phone numbers (single or bulk lookup)- GET
/numbers/lookup/{phoneNumber}
to lookup a single mobile number - POST
/numbers/lookup
for bulk lookup of phone numbers
- GET
- New event
number_lookup
for webhook to receive data from number lookup - New endpoint
/otp
and/otp/{otpId}
to create new OTP request, verify OTP, get OTP details and status, cancel OTP.- POST
/otp
to create new OTP request - GET and POST
/otp/{otpId}
to get details or to verify a pending OTP - DELETE
/otp/{otpId}
to cancel a pending OTP request
- POST
- New event
otp_update
for webhook to receive updates about verifying the phone number
1.0.0 - initial
- New endpoint
/numbers/rent
to rent phone numbers- GET
/numbers/rent/available/{countryIso}
to get list of available numbers for rent - GET
/numbers/rent
to get list of your rented numbers - POST
/numbers/rent
to rent phone number - GET
/numbers/rent/{rentId}
to get the status of a rented number - DELETE
/numbers/rent/{rentId}
to cancel a rented number - PATCH
/numbers/rent/{rentId}
to renew rent for a phone number - GET
/numbers/rent/{rentId}/inbound
to get inbound SMS from rented number - PATCH
/numbers/rent/{rentId}/edit
to edit settings for an active rent
- GET
- New endpoint
/numbers/lookup
to lookup phone numbers (single or bulk lookup)- GET
/numbers/lookup/{phoneNumber}
to lookup a single mobile number - POST
/numbers/lookup
for bulk lookup of phone numbers
- GET
- New event
number_lookup
for webhook to receive data from number lookup - New endpoint
/otp
and/otp/{otpId}
to create new OTP request, verify OTP, get OTP details and status, cancel OTP.- POST
/otp
to create new OTP request - GET and POST
/otp/{otpId}
to get details or to verify a pending OTP - DELETE
/otp/{otpId}
to cancel a pending OTP request
- POST
- New event
otp_update
for webhook to receive updates about verifying the phone number