Send Chat Message to Addressable
This request posts a message to a chat session. This request has the same semantic as Send Chat Message, but has a different resource URL that specifies the addressable instead of the chat session. Consequently, the app doesn’t have to lookup the session ID but has on the other hand no guarantee that the addressable is chattable.
Resource
POST /addressables/<OID>/chat
Where OID
is the object ID of the addressable.
Parameters
None
Payload
Response
The Chat Message object contains the chat contents and the object ID.
Context
Authorization |
User |
Errors
HTTP code | Xelion code | Description |
---|---|---|
400 |
10200 |
No chat contents were specified. |
10202 |
Failed to decode the Chat Contents object. |
|
10204 |
An empty chat message is sent. |
|
404 |
10100 |
The addressable is not chattable or no addressable with the specified OID exists. |
404 |
10066 |
The chat session is disabled, chats cannot be sended. |
Example
Request
POST https://xelion.nl/api/v1/master/addressables/2718281/chat
Payload
{
"text": "we need a bigger boat",
}
Response
{
"object": {
"subject": "we need a bigger boat",
"date": "2024-10-11 15:20:42",
"contents": {
"content": "we need a bigger boat",
"contentType": "",
"oid": "4647667",
"objectType": "Comment"
},
"durationSec": 0,
"incoming": false,
"retrieved": true,
"displayed": true,
"displayedUser": "",
"flagged": false,
"forwarded": false,
"processed": false,
"recordingStatus": "unknown",
"hasAttachment": false,
"hasInlineAttachment": false,
"hasMessageReference": false,
"contentSummary": "we need a bigger boat",
"contentSummaryIsComplete": true,
"participants": [
{
"commonName": "Arno",
"role": "rtFrom",
"address": "",
"addressable": {
"commonName": "Arno",
"oid": "1389401",
"objectType": "Person"
},
"addresseeLabel": "Arno",
"person": {
"commonName": "Arno",
"oid": "1389401",
"objectType": "Person"
},
"oid": "4647668",
"objectType": "Addressee"
},
{
"commonName": "Haas",
"role": "rtTo",
"address": "",
"addressable": {
"iconId": "4435216",
"commonName": "Haas",
"oid": "1815710",
"objectType": "Person"
},
"addresseeLabel": "Haas",
"person": {
"commonName": "Haas",
"oid": "1815710",
"objectType": "Person"
},
"oid": "4647669",
"objectType": "Addressee"
}
],
"voicemail": false,
"voicemailIsHeard": false,
"callId": "",
"id": "d9c2cbbde7cdd747",
"callFlowId": "",
"phone": "",
"isConferenceCall": false,
"callAnswerTimeSec": 0,
"onHoldDuration": 0,
"trunk": "",
"phoneLine": {
"permissions": "ReadWriteRemove",
"commonName": "Arno",
"oid": "1389593",
"objectType": "XCCPhoneLine"
},
"wrapUpTime": 0,
"chatSessionType": "user",
"whatsAppTemplateCategory": "",
"transferredFromName": "",
"transferredToName": "",
"chatSession": {
"permissions": "ReadWriteRemove",
"commonName": "Chat Haas <-> Arno",
"oid": "1935036",
"objectType": "XCCChatSession"
},
"afterCallType": "",
"packetsLog": [],
"permissions": "ReadWriteRemove",
"commonName": "Arno -> Haas, 2024-10-11",
"oid": "4647666",
"objectType": "XCCUserChat"
}
}