Step 2: Response to request “Send an SMS”

tyntec will immediately respond to a HTTPS POST request to “Send an SMS”. The response will contain the request ID, the size of your message and list of respective message IDs. In the case there are delivery issues, the response will contain possible delivery issues following an immediate check for inconsistencies (e.g., case sensitivity, wrong parameter, too many characters, no receiver defined, etc.). The HTTP status code returned will be accordingly.

Successful Request Response (JSON)

HTTP/1.1 200 OK
{
 "requestId":"12-75cfafba-8799-4f2b-8505-ece6af6abf01",
 "size":"2",
 "msgIdList":["12-1407778865439+1234567890","12-1407778865439+1234567891"]
}

Successful Request Response (XML)

HTTP/1.1 200 OK

 12-75cfafba-8799-4f2b-8505-ece6af6abf01
 2
 
  12-1407778865439+1234567890
  12-1407778865439+1234567891
 

Unsuccessful Request Response (JSON)

HTTP/1.1 400 Bad Request
{
 "responseText":"*see list below*"
}

HTTP status codes

HTTP Code

Message

Description

200 OK

*see code examples “Un/Successful Request Response”*

OR

*see code examples “Message Notification”*

The HTTPS request was accepted. The posted message passed an initial consistency check and tyntec will reply with the respective request ID, size and message ID.

OR

The requested message notification can be retrieved and is returned.

400 Bad Request

*see validation error message list below*

The HTTPS request failed to pass the validation, i.e., one or more of the required parameters of the request are empty/mission/contradictory/invalid. The given message provides more information as to why the validation failed.

403 Forbidden

Username/password wrong or missing.

The provided credentials are not authorized.

404 Not Found

The requested message notification cannot be retrieved.

The request URI is either non-existent or the respective authentication is invalid.

405 Method Not Allowed

Invalid request method.

The request contains an invalid HTTP method (POST/GET).

406 Not Acceptable

The content-type is not supported. Allowed values are “application/xml” and “application/json”.

The request is neither JSON nor XML format, or the header reads “Content-Type”.

415 Unsupported Media Type

The media type is not supported. Allowed media-types are “application/xml” and “application/json”.

The request is neither JSON nor XML format, or the HTTP header reads “Accept”.

500 Internal Server Error

Please retry. If error persists, please contact customer support.

Unexpected error.

 

Validation error message may be one reason or a combination of the below:

Message

Sent

Description

Invalid authentication

Send/Query actions

Invalid username and/or password, or wrong authentication token.

Request ID is missing

Query action

Please specify the request-ID for which the message status should be retrieved.

Sender is missing

Send action

The mandatory parameter “from” is not specified.

Receiver is missing

Send action

The mandatory parameter “to” is not specified.

Receiver number is not numeric

Send action

The mandatory parameter “to” is malformed. It has to be an international phone number.

Message is empty

Send action

It is not allowed to send an empty message.

More than one message content parameter is set

Send action

Please use EITHER “message”, “unicode” or “wappush” to send a message.

Message exceeds maximum character length of 3000

Send action

Message text exceeds the limit of 3000 symbols.

The respond-back URL is invalid

Send action

Please format the URL according to http(s)://host(:port).

One or more mandatory parameters are missing

Send action

The request is missing mandatory parameters.

Your message is rejected because it has over-length

Send action

Your account settings block the sending of over-length message.

The requested URI was not found

Query action

The requested URI is either non-existent or the respective authentication is invalid.

Unexpected error, please retry. If error persists, please contact your customer support

Query action/Send action

Something unexpected occurred during the processing of the request.

The parameter ${invalidparameter} is invalid

Send action

The request contains at least one invalid parameter. ${invalidparameter} will state which parameter.