Status and Error Codes
The Dexatel API uses HTTP response codes to indicate the status of requests. Below is a comprehensive guide to understanding the response codes and error messages you might encounter while using the API.
Response
The REST API responds to each request with an HTTP response code. In case of a problem, the system responds with a list of errors.
Name | Type | Description |
---|---|---|
errors | list<errors> |
List of errors (see Errors object below) |
Error response body
Name | Type | Description |
---|---|---|
timestamp | string | Timestamp value |
path | string | URL of the requested method |
method | string | Request method type |
status | integer |
Bad response status.
|
message | string | Detailed error message |
code | integer | Specific error codes |
Success Status Codes
Name | Status | Description |
---|---|---|
200 | OK | The request was successfully completed |
201 | Create | A new resource was successfully created |
202 | Accepted | The request was accepted |
204 | No Content | The server has fulfilled the request but does not need to return a response body |
Error Status Codes
Name | Status | Description |
---|---|---|
400 | Bad Request | The request cannot be understood by the server due to incorrect syntax |
401 | Unauthorized | Indicates that the request requires user authentication information |
403 | Forbidden | Unauthorized request. The client does not have access rights to the content |
404 | Not Found | The server cannot find the requested resource |
405 | Method Not Allowed | The request HTTP method is known by the server but has been disabled and cannot be used for that resource |
409 | Conflict | The request could not be completed due to a conflict with the current state of the resource |
412 | Precondition Failed | The client has indicated preconditions in its headers which the server does not meet |
413 | Payload Too Large | Request entity is larger than limits defined by serve |
414 | URI Too Long | The URI requested by the client is longer than the server can interpret |
415 | Unsupported Media Type | The media type in Content-type of the request is not supported by the server |
429 | Too Many Requests | The user has sent too many requests in a given amount of time |
Headers
Request headers
API accepts headers in the request and sends responses with headers as metadata.
Name | Type | Description |
---|---|---|
Content-Type | string | Content type of the payload, always expects application/json |
X-Dexatel-Key | string | Authorization key |
Response headers
Name | Type | Description |
---|---|---|
Location | string (URL) | Absolute path of newly created object |
Content-Type | string | Content-type of the payload, which always sends application/json |
Total-Count | integer | Total count of the records |
Attribute Types
The following string attribute types are used throughout the API:
Name | Description | Example |
---|---|---|
uuid | 8-4-4-4-12 format string consisting of hex characters (0-f) | 01b620c7-8381-4cbf-995c-87456ae04830 |
date | UTC time | YYYY-DD-MM HH:MM:SS |
url | URL starting with http or https | https://www.google.com |
did |
Up to 15 digits string, consisting of numbers only. The spaces, dashes and the plus at the beginning to be ignored |
18001234567 |
identifier |
Object name used as an identifier. Consists of letters, numbers, dashes and underscores |
company-intro-template |
name | Informative object name. Consists of letters, numbers, spaces, and allowed characters (. , : * _ ! ? % # + - = @ _ [ ] { } ()) | late campaign 27/09 |
template |
Template text with variables. Contains at
least one variable value.
Possible variable values are:
|
hi {first_name}, you have an appointment at {timestamp} |
Uniqueness Constraints
Object attribute values are unique in some scope. When the uniqueness is attempted to be broken by an API request, the 409 error status code is expected to be returned.
Name | Description |
---|---|
object ID (UUID) | Is unique for all accounts |
sender code | Is unique per account and channel. |
template name | Is unique in the scope of the account per channel. The account cannot have more than one template with the same name in the same channel. |
audience name | Is unique in the scope of the account. The account cannot have more than one audience with the same name |
sender name | Is unique in the scope of the channel and account. The sender name is unique for each channel and account |
contact | Is unique in the scope of the audience and the account. A contact cannot be added to the same audience more than once |
Updated 9 months ago