...
To send a new message call the following URL
POST https://<hostname>/imchanneimchannel/message
Text Message
There are two ways how incoming messages can be forwarded to the client's end-point. They can be delivered with or without contact name.
...
Code Block | ||
---|---|---|
| ||
{ "results": [ { "from": "385919998888", "to": "1234", "integrationType": "WHATSAPP", "receivedAt": "2019-07-19T11:23:26.998+0000", "messageId": "ABEGOFl3VCQoAhBalbc6rTQT6mgS29EmGZ7a", "pairedMessageId": null, "message": { "type": "TEXT", "text": "Support hello" }, "contact": { "name": "Frank" } } ] } |
Notes:
Parameter names | Type | Description |
---|---|---|
from | string | From Identifier |
to | string | To identifier |
integrationType | string | channel name |
receivedAt | string | Timestamp indicating when the message has been received by the platform |
messageId | string | unique identifier for message. In case of network problem it’s possibile to resend the same message with the same messageID. |
pairedMessageID | string | reference to another message for “quote” feature |
message.type | string | TEXT for text messages |
message.text | string | content of the text message |
contact.name | string | name linked with the from identifier if available |
Image message
An image message is identified bu type “IMAGE” and the payload is transferred through a URL called by CTLive when the message is received. Url is requested using GET only once, because after that, it’s stored for any use.
...
If you would like to send WhatsApp messages containing text and image, please check the example provided below.
Parameter | Type | Description |
---|---|---|
text |
| Text of the message that will be sent. |
imageUrl |
| URL of the image sent |
Code Block | ||
---|---|---|
| ||
{ "scenarioKey": "CC9F01A5DC7BEE2C2B829D203482A654", "destinations": [ { "to": { "phoneNumber": "41793026727" } } ], "whatsApp": { "text": "Get your message across!", "imageUrl": "<url>" }, } |
...
If you would like to send messages containing document file, please check the example provided below.
Parameter | Type | Description |
---|---|---|
text |
| Name of the file that will be sent. |
fileUrl | string | URL of the file sent |
Code Block |
---|
{ "scenarioKey": "CC9F01A5DC7BEE2C2B829D203482A654", "destinations": [ { "to": { "phoneNumber": "41793026727" } } ], "whatsApp": { "text": "File caption", "fileUrl": "https://www.documentUrl.com" } } |
...