Send Messages to Specific Devices

To send an outgoing message to a specific device, provide its identity in the deviceAddress field.

Permissions

  ----
  Permissions:INTEGRATOR,OPERATOR,SUPERVISOR
  ----

Request Parameters

ParameterTypeDescription
textstringMessage text
attachmentslist <attachmentDTO> (optional)List of attachments the for message
applicationDescriptor.channelTypestringChannel type
applicationDescriptor.clientIdstringAuthorized external client ID
applicationDescriptor.unauthorizedClientIdstring (optional)Unauthorized external client ID
applicationDescriptor.deviceAddressstringAddress of the device in the specified channelType to send the message to
applicationDescriptor.appMarkerstring (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

ParameterTypeDescription
idlong Unique identifier of the message in edna Chat Center
threadIdlong Unique identifier of the new thread for the sent message in edna Chat Center
clientIdlong Unique identifier of the client to whom the message was sent
clientExternalIdstring Unique external identifier of the client to whom the message was sent
agentIdlong 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
}