Send SMS
This request sends an SMS message.
The server has to support SMS messages in order for this request to succeed. See the system capabilities resource for more information.
Resource
POST /communications/sms
Parameters
None
Payload
An SMS object containing the message contents and the receivers phone numbers.
The SMS message must include at least one receiver’s phone number and may include the reply-to phone number.
Note: not all SMS providers support including a reply address. If no reply address is included then the default caller-id is used.
Response
An SMS object containing the sent message with the object IDs the system has generated.
Context
Authorization |
User |
Errors
HTTP code | Xelion code | Description |
---|---|---|
400 |
10202 |
failed to decode the SMS message |
10203 |
the destination phone number is not found or invalid |
Example
Request
POST https://xelion.nl/api/v1/master/communications/sms
Payload
{
"subject": "Bird lives",
"contents": {
"objectType": "Comment",
"content": "Bird lives!"
},
"participants": [
{
"role": "rtTo",
"address": "969",
"addressable": {
"oid": "1557797",
"objectType": "Person"
},
"objectType": "Addressee"
},
{
"role": "rtTo",
"address": "0618033988",
"objectType": "Addressee"
},
{
"address": "0623553260",
"role": "rtReplyTo",
"addressable": {
"commonName": "Arnon Ron",
"oid": "1556377",
"objectType": "Person"
},
"objectType": "Addressee"
}
],
"objectType": "SMSMessage"
}
Response
{
"object": {
"subject": "Bird lives",
"date": "2023-04-17 12:45:48",
"contents": {
"content": "Bird lives!",
"contentType": "",
"oid": "2121028",
"objectType": "Comment"
},
"durationSec": 0,
"status": "Scheduled",
"incoming": false,
"retrieved": false,
"displayed": false,
"displayedUser": "",
"flagged": false,
"forwarded": false,
"processed": false,
"recordingStatus": "unknown",
"hasAttachment": false,
"hasInlineAttachment": false,
"hasMessageReference": false,
"contentSummary": "dit zijn 160 karakters die in een SMS passen",
"contentSummaryIsComplete": true,
"participants": [
{
"commonName": "+31618033988",
"role": "rtFrom",
"address": "+31618033988",
"addressable": {
"commonName": "+31618033988",
"oid": "1853517",
"objectType": "UnknownAddressable"
},
"addresseeLabel": "",
"oid": "2121030",
"objectType": "Addressee"
},
{
"commonName": "+31623553260",
"role": "rtTo",
"address": "+31623553260",
"addressable": {
"commonName": "+31623553260",
"oid": "1853517",
"objectType": "UnknownAddressable"
},
"addresseeLabel": "",
"oid": "2121030",
"objectType": "Addressee"
}
],
"voicemail": false,
"voicemailIsHeard": false,
"callId": "",
"id": "",
"callFlowId": "",
"phone": "",
"isConferenceCall": false,
"callAnswerTime": "",
"callAnswerTimeSec": 0,
"callEndTime": "",
"onHoldDuration": 0,
"trunk": "",
"phoneLine": {
"permissions": "ReadWriteRemove",
"commonName": "Wesley Leg",
"oid": "1651226",
"objectType": "XCCPhoneLine"
},
"wrapUpTime": 0,
"transferredFromName": "",
"transferredToName": "",
"afterCallType": "",
"packetsLog": [],
"permissions": "ReadWriteRemove",
"commonName": "subject",
"oid": "2121027",
"objectType": "SMSMessage"
},
"links": [
{
"rel": "self",
"href": "https://xelion.nl/api/v1/master/communications/sms",
"method": "GET"
}
]
}