Chat API
Chat API
Endpoint
Method: POST
URL: https://<host>/contacts/chat
Mandatory Attributes
Name | Description | Data Type | Length | Comments |
---|---|---|---|---|
| Agent Email Address | String | 256 | |
| Agent Identifier | String | 50 | |
| Conversation Identifier | String | 256 | UUID, Chat Conversation Identifier |
| Language Code | String | 5 | us-en, au-en, gb-en |
| Agent Message | String | 512 | Number of characters |
| Agent Timestamp | Long | ||
| Participant Message | String | 512 | Number of characters |
| Participant Timestamp | Long | ||
| Participant Email Address | String | 256 | |
| Participant Identifier End Consumer | String | 50 | |
| Name of Category Name | String | 128 | |
| Name of the Organization | String | 128 | |
| Name of the Client | String | 128 |
Optional Attributes
Name | Description | Data Type | Length | Comments |
---|---|---|---|---|
| Journey Identifier | String | 256 | UUID, Journey Identifier |
| Name of Metadata Map Parameter | String | A maximum of 50 non-Speech metadata keys per category. Refer Restricted Metadata Field List. |
Request
curl --location --request POST 'https://host/contacts/chat' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'Authorization: Bearer 1234567890' \ --data-raw '{ "metadata": { "tenantName": "Acme Corp", "orgName": "Sales", "catName": "Leads" }, "data": { "convId": "0238ef3c-4252-11ea-b77f-2e728ce88125", "lang": "us-en", "agentId": "Agent1", "psId": "Participant1", "agentEmailId": "agent1@xyz.com", "psEmailId": "ps1@acmecorp.com", "messages": [ { "agent": { "ts": 1577836800000, "msg": "Hi , Good morning" }, "ps": { "ts": 1577836850000, "msg": "Hi, May I know the delivary status" } } ], "journeyId": "02d8f01e-42b0-11ea-b77f-2e728ce88125" } }'
Request with Additional Metadata
curl --location --request POST 'https://host/contacts/chat' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'Authorization: Bearer 1234567890' \ --data-raw '{ "metadata": { "tenantName": "qatest216ga", "orgName": "DefaultOrg", "catName": "cachecat", "metadataMap": {"custom-test-key-3":"custom-test-value-3", "custom-test-key-4":"custom-test-value-4"} }, "data": { "convId": "w332-w325", "lang": "en-us", "agentId": "Agent1", "psId": "Participant1", "agentEmailId": "agent1@xyz.com", "psEmailId": "ps1@acmecorp.com", "messages": [ { "agent": { "ts": 1657718513000, "msg": "Hi , Good morning" }, "ps": { "ts": 1657718573000, "msg": "Hi, May I know the delivary status" } }, { "agent": { "ts": 1657718633000, "msg": "Can you provide your order id" }, "ps": { "ts": 1657718693000, "msg": "my order id is 43543543" } }, { "agent": { "ts": 1657718753000, "msg": "with in 2 day it will deliver" }, "ps": { "ts": 1657718813000, "msg": "Thank you" } }, { "agent": { "ts": 1657877265000, "msg": "Thank you welcome" } } ], "journeyId": "w332-w325" } }'
Success response
{ "status": 202 "message": "accepted" }
Error response
Http Status : can be one of 400, 401, 403, 404, 500, 503 { "status": 400, "errors": [ { "type": "/errors/contact-payload", "title": "entity-identifier", "detail": "tenant/org/cat not found!" } ] }