Send WhatsApp Template
This request sends a WhatsApp template to the selected addressable.
Resource
POST /whatsapptemplates/<OID>/send
Where OID
is the object ID of the WhatsApp template.
Parameters
None
Payload
Make sure an addressable and number is given.
The parameters are required as well.
Response
The Chat Message object contains the chat contents and the object ID.
Context
Authorization |
User |
Errors
Example
Request
POST https://xelion.nl/api/v1/master/whatsapptemplates/1588675/send
Payload
{
"receiver": {
"oid": "4574814",
"objectType": "Person"
},
"number": "+316999999999",
"headerValue": "header",
"bodyParameters": [
{
"oid": "2160697",
"value": "4"
}
],
"buttons": [
{
"oid": "2161445",
"value": "this is a button value"
}
]
}
Response
{
"object": {
"subject": "Herinnering afspraak header\nDit is een service bericht, uw afspraak is morgen om 4 uur. Vergeet uw tanden niet te poetsen.\nXelion\nwww.tandarts.nl",
"date": "2024-10-11 15:24:19",
"contents": {
"content": "Herinnering afspraak header\nDit is een service bericht, uw afspraak is morgen om 4 uur. Vergeet uw tanden niet te poetsen.\nXelion\nwww.tandarts.nl",
"contentType": "",
"oid": "4647701",
"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": "Herinnering afspraak header\nDit is een service bericht, uw afspraak is morgen om 4 uur. Vergeet uw tanden niet te poetsen.\nXelion\nwww.tandarts.nl",
"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": "4647702",
"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": "4647703",
"objectType": "Addressee"
}
],
"voicemail": false,
"voicemailIsHeard": false,
"callId": "",
"id": "ce446930aee57b45",
"callFlowId": "",
"phone": "",
"isConferenceCall": false,
"callAnswerTimeSec": 0,
"onHoldDuration": 0,
"trunk": "",
"phoneLine": {
"permissions": "ReadWriteRemove",
"commonName": "Telefoonaansluiting Arno",
"oid": "1389593",
"objectType": "XCCPhoneLine"
},
"wrapUpTime": 0,
"chatSessionType": "user",
"whatsAppTemplateCategory": "",
"transferredFromName": "",
"transferredToName": "",
"chatSession": {
"permissions": "ReadWriteRemove",
"commonName": "Chat Haas <->Telefoonaansluiting Arno",
"oid": "1935036",
"objectType": "XCCChatSession"
},
"whatsAppTemplateCategory": "Marketing",
"afterCallType": "",
"packetsLog": [],
"permissions": "ReadWriteRemove",
"commonName": "Arno -> Haas, 2024-10-11",
"oid": "4647700",
"objectType": "XCCUserChat"
}
}