To send an outgoing message to a specific device, provide its identity in the deviceAddress field.
Permissions
---- Permissions:INTEGRATOR,OPERATOR,SUPERVISOR ----
Request Parameters
| Parameter | Type | Description |
text | string | Message text |
attachments | list <attachmentDTO> (optional) | List of attachments the for message |
applicationDescriptor.channelType | string | Channel type |
applicationDescriptor.clientId | string | Authorized external client ID |
applicationDescriptor.unauthorizedClientId | string (optional) | Unauthorized external client ID |
applicationDescriptor.deviceAddress | string | Address of the device in the specified channelType to send the message to |
applicationDescriptor.appMarker | string (optional) | Identifier of an application on the specified device to send the message to |
HTTP Request
- Example of sending a message to WhatsApp:
POST /api/v1/messages/outgoing-to-device HTTP/1.1
Content-Type: application/json
Authorization: Bearer <integrator_token>
Content-Length: 163
Host: localhost: 8080
{
"text": "message",
"attachments": [],
"clientApplicationDescriptor": {
"channelType": "WHATSAPP",
"deviceAddress": "89000000000"
}
}
- Example of sending a message to mobile:
POST /api/v1/messages/outgoing-to-device HTTP/1.1
Content-Type: application/json
Authorization: Bearer <integrator_token>
Content-Length: 250
Host: localhost: 8080
{
"text": "message",
"attachments": [],
"clientApplicationDescriptor": {
"channelType": "MOBILE",
"clientId": "012-3456-7890-12",
"appMarker": "myApp",
"deviceAddress": "wsfck62auiv00gz14vedivwptm09ahmrhz"
}
}
Response Parameters
| Parameter | Type | Description |
id | long | Unique identifier of the message in edna Chat Center |
threadId | long | Unique identifier of the new thread for the sent message in edna Chat Center |
clientId | long | Unique identifier of the client to whom the message was sent |
clientExternalId | string | Unique external identifier of the client to whom the message was sent |
agentId | long | Unique identifier of the agent from whom the message was sent |
Example of a Successful HTTP Response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Content-Length: 102
{
"id": 1,
"threadId": 2,
"clientId": 1,
"clientExternalId": null,
"agentId": 3
}