Step 1: Request “Send an SMS”

To send a new outgoing SMS, make a POST request to the requests resource. The following code blocks give a basic example of how to send an SMS:

curl
-u username:password
-X POST
-H "Content-Type: application/json"
-d '{
      "from":"MyCompany",
      "to":"+491622943176",
      "message":"This is an example."
     }'
https://rest.tyntec.com/sms/v1/outbound/requests

For time-sensitive one-time passwords, we suggest using the following basic example:

curl
-u username:password
-X POST
-H "Content-Type: application/json"
-d '{
      "from":"MyCompany",
      "to":"+491622943176",
      "message":"This is an example.",
      "validityPeriod":"00:01"
     }'
https://rest.tyntec.com/sms/v1/outbound/requests

Response to basic example for Sending SMS (JSON):

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

The following code blocks demonstrate the expected and accepted message format (the parameters are filled with examples):

 Sending SMS (JSON)

"from":"+4915112345678",
 "to":"+4917912345678",
(*choose one of the following*)  
 "message":"This is an example.",
 "unicode":,
 "wappush":
 {
  "title":,
  "url":
  },
(*optional*)
 "userContext":"testmessage1",
 "sendDateTime":"2014-12-24T18:30:00+01:00",
 "validityPeriod":"03:00",
 "callbackUrl":"https://tyntec.com/",
 "flash":true
}

Sending SMS (XML)


 +4915112345678
 +4917912345678
(*choose one of the following*)
 This is an example.
 
 


 
(*optional*)
 testmessage1
 2014-12-24T18:30:00+01:00
 03:00
 https://tyntec.com/
 true

In this request there are a number of parameters that need to be defined, others are optional:

Parameter

Optional/Mandatory

Possible Values

Description

from

Mandatory

Any international phone number OR alphanumeric sender ID (1 – 11 characters)*

This parameter gives the identification of the sending party, which can either be the phone number in international format or an alphanumeric identifier with up to 11 characters*.

*Some destination networks impose restrictions on the sender ID format. Please check the coverage list and/or contact your account manager for more information.

to

Mandatory

Any international phone number

This parameter represents the receiving party’s phone number in international format

(*choose one of the following*)

Mandatory

Only one of the following parameters has to be set

This API version supports sending messages either as plain text SMS (with GSM-7 encoding – http://en.wikipedia.org/wiki/GSM_03.38), as Unicode SMS (with USC-2 encoding), or as WAP-Push SMS (with UTF-8 encoding). The expected encoding given in the HTTPS POST request for all message types is UTF-8. tyntec automatically translates your UTF-8 string into the respective encoding. The maximum overall length for accepted messages is 3000 UTF-8 characters (counted before the encoding). The maximum length of a single SMS is limited to 160 (message)/70 (Unicode) / 130 (wappush) characters depending on the final encoding (counted after encoding). tyntec automatically splits the sent message into concatenated messages if the message exceeds the given limits. These concatenated messages are unified by the handset once again and are displayed as one message (if supported by the handset).

NOTE: tyntec will charge for each part of the concatenated message as an individual message.

message

 

Any UTF-8 encoded string

The message will be sent with characters encoded in the GSM standard alphabet GSM-7. Max. length is 160 characters per single message and 153 characters per concatenated message. Characters that are not supported by the GSM-7 alphabet are replaced by “*”. 

unicode

 

Any UTF-8 encoded string

The message will be sent with characters encoded in the GSM Unicode alphabet USC-2. Max. length is 70 characters per single message and 66 characters per concatenated message.

wappush - title

 

Any UTF-8 encoded string

The message part of the WAP-Push message in the UTF-8 encoding.

Wappush - url

 

Any pre-formatted URL

This URL will be interpreted directly and displayed by the handset as a web link (if supported by the handset). Max. length of a WAP-Push (incl. title and URL) is 130 characters per single message and 123 characters per concatenated message.

userContext

Optional

Any UTF-8 encoded string

This parameter allows for personalized identifiers or context. This field will not be modified by tyntec.

 The message notification will return this identifier in addition to the request ID and message ID.

sendDateTime

Optional

Any future date in the format “yyyy-MM-ddT-HH:mm:ss+HH:mm” (according to ISO 8601)

tyntec will submit the message at this given date. Otherwise tyntec will submit your message immediately.

Default time zone is UTC.

validityPeriod

Optional

Any time in the format “hh:mm”

tyntec will attempt to resend the message for the time specified (validityPeriod can be set from 00:01 to 48:00). The default value is 48:00.

callbackUrl

Optional

Any valid URL

This parameter allows for overriding of the default call-back URL for this message. If it is not specified, the default call-back URL will be used for push message notifications.

If no call-back URL is provided, tyntec will not enable push message notifications. No matter, the status of the message and the message notification will be available via the HTTPS GET “Query the status of an SMS”.

flash

Optional

true/false

This parameter specifies that the sent message is sent as a flash-SMS, i.e., the message will only be displayed one time and will not be stored on the handset (if supported by the handset). The default value is false.