To send a message to an existing client, you need to provide either clientId or threadsClientId.
Following are two types of answers in order of priority:
- By
threadsClientId: This is an internal client ID. It is applicable for both authorized and unauthorized clients. - 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
| Parameter | Type | Description |
clientId | string (optional) | External client identifier |
threadsClientId | long (optional) | Internal client identifier in edna Chat Center |
login | string | Login of the agent on whose behalf the message will be sent |
channelType | string | Target status of the agent (READY or OUTGOING) |
appMaker | string (optional) | appMarker of the client application |
text | string (optional) | Message text, max length is 2,000 characters |
attachments | list <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.
| Parameter | Type | Description |
url | string | File URL. String up to 4,000 characters |
name | string | File name. String up to 1,000 characters |
type | string | File MIME type. String up to 256 characters |
size | integer | File size in bytes |
"attachments": [
{
"url": "http://...",
"name": "test.jpg",
"type": "image/jpeg",
"size": 256
}
],
...
HTTP Request
Example for clientID:
POST /api/v1/messages/outgoing-from-myself HTTP/1.1
Content-Type: application/json
Authorization: Bearer <integrator_token>
Content-Length: 152
Host: localhost: 8080
{
"text": "message",
"attachments": [],
"clientId": "clientId",
"channelType": "MOBILE",
"login": "login",
"status": "READY"
}
Response Parameters
| Parameter | Type | Description |
id | long | 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
}