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.

NameTypeDescription
errorslist<errors>

List of errors
(see Errors object below)

Error response body

NameTypeDescription
timestampstringTimestamp value
pathstringURL of the requested method
methodstringRequest method type
statusinteger

Bad response status.

  • 4xx error status codes indicate an error because of the information provided
  • 5xx error status codes indicate server errors
messagestringDetailed error message
codeintegerSpecific error codes

Success Status Codes

NameStatusDescription
200OKThe request was successfully completed
201CreateA new resource was successfully created
202AcceptedThe request was accepted
204No ContentThe server has fulfilled the request but does not need to return a response body

Error Status Codes

NameStatusDescription
400Bad RequestThe request cannot be understood by the server due to incorrect syntax
401UnauthorizedIndicates that the request requires user authentication information
403ForbiddenUnauthorized request. The client does not have access rights to the content
404Not FoundThe server cannot find the requested resource
405Method Not AllowedThe request HTTP method is known by the server but has been disabled and cannot be used for that resource
409ConflictThe request could not be completed due to a conflict with the current state of the resource
412Precondition Failed The client has indicated preconditions in its headers which the server does not meet
413Payload Too LargeRequest entity is larger than limits defined by serve
414URI Too LongThe URI requested by the client is longer than the server can interpret
415Unsupported Media TypeThe media type in Content-type of the request is not supported by the server
429Too Many RequestsThe 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.

NameTypeDescription
Content-TypestringContent type of the payload, always expects application/json
X-Dexatel-KeystringAuthorization key

Response headers

NameTypeDescription
Locationstring (URL)Absolute path of newly created object
Content-TypestringContent-type of the payload, which always sends application/json
Total-CountintegerTotal count of the records

Attribute Types

The following string attribute types are used throughout the API:

NameDescriptionExample
uuid8-4-4-4-12 format string consisting of hex characters (0-f)01b620c7-8381-4cbf-995c-87456ae04830
dateUTC timeYYYY-DD-MM HH:MM:SS
urlURL starting with http or httpshttps://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:

  • {first_name}
  • {last_name}
  • {custom1}
  • {custom2}
  • {code}

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.

NameDescription
object ID (UUID)Is unique for all accounts
sender codeIs 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