Send Messages from Agents to Existing Clients in edna Chat Center in the Routing Queue

To send a message to an existing client, you must provide either clientId or threadsClientId.

Following are two types of answers in order of priority:

  1. By threadsClientId: This is an internal client ID. It is applicable for both authorized and unauthorized clients.
  2. By clientId: This is an external client ID. It is more often used for authorized clients; it is not tied to a specific thread.

Permissions

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

Request Parameters

ParameterTypeDescription
clientIdstring (optional)External client identifier
threadsClientIdlong (optional)Internal client identifier in edna Chat Center
loginstringLogin of the agent on whose behalf the message will be sent
modestringRouting mode for the thread, available values are TO_FREE_SLOT, TO_READY_OPERATOR, and TO_ROUTING. The default value is TO_ROUTING.
userIdslist of numbersList of agent identifiers to assign the thread to during routing
loginslist of stringsList of agent logins to assign the thread to during routing
skillIdslist of numbersList of the required skills to assign the thread to during routing
unitIdslist of numbersList of the required departments to assign the thread to during routing
prioritynumberThread priority in the routing queue. Threads with a lower value of priority will be assigned first.
commentstringFree form comment, max length is 220 symbols
channelTypestringTarget status of the agent (READY or OUTGOING)
appMakerstring (optional)appMarker of the client application
textstring (optional)Message text, max length is 2,000 characters
attachmentslist <attachemntDTO>List of attachments for the message

Example of an Attachment Object

The image name must contain the file extension, or the file type (for example, image/jpg) must be specified for the file to be displayed correctly to the client.

ParameterTypeDescription
urlstringFile URL. String up to 4,000 characters
namestringFile name. String up to 1,000 characters
typestringFile MIME type. String up to 256 characters
sizeintegerFile size in bytes
"attachments": [
    {
        "url": "http://...",
        "name": "test.jpg",
        "type": "image/jpeg",
        "size": 256
    }
],
...

HTTP Request

Example for clientID:

POST /api/v1/messages/outgoing-to-queue HTTP/1.1
Content-Type: application/json
Authorization: Bearer <integrator_token>
Content-Length: 203
Host: localhost: 8080
{
    "text": "message",
    "attachments": [],
    "clientId": "clientId",
    "channelType": "MOBILE",
    "login": "login",
    "mode": "TO_ROUTING",
    "logins": [
        "login"
    ],
    "priority": 100
}

Response Parameters

ParameterTypeDescription
idlong Unique identifier of the message in edna Chat Center
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Content-Length: 16
{
    "id": 2
}