Email API
Email API
Endpoint
Method: POST
URL: https://<host>/contacts/email
Mandatory Attributes
Name | Description | Data Type | Length | Comments |
---|---|---|---|---|
| Agent Email Address | String | 256 | This is required to determine agent vs participant for Incoming and Outgoing messages. |
| Agent Identifier | String | 50 | |
| Email Body | String | 1 MB | |
| Conversation Identifier | String | 256 | UUID, Email Conversation Identifier |
| From Address | String | 256 | |
| Language Code | String | 5 | us-en, au-en, gb-en |
| Messages Identifier | String | 36 | UUID, Email Thread Identifier |
| Participant Email Address | String | 256 | Would require to determine the addressed participant. |
| Participant Identifier | String | 50 | |
| Email Subject | String | 78 | RFC-5322 |
| To Address | String Array | ||
| Sent/Received Timestamp | Long | ||
| 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 |
---|---|---|---|---|
| CC or BCC | String Array | ||
| 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/email' \ --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", "msgId": "0238f22a-4252-11ea-b77f-2e728ce88125", "lang": "us-en", "sub": "Goods Delivary Status", "ts": 1577836800000, "body": "Hi John, I'm writing this email to enquire about the my delivery status", "agentId": "Agent1", "psId": "Participant1", "agentEmailId": "agent1@xyz.com", "psEmailId": "ps1@acmecorp.com", "from": "agent1@xyz.com", "to": [ "ps1@acmecorp.com", "ps2@acmecorp.com" ], "journeyId": "02d8f01e-42b0-11ea-b77f-2e728ce88125" } }'
Request with Additional Metadata
curl --location --request POST 'https://host/contacts/email' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'Authorization: Bearer 1234567890' \ --data-raw '{ "metadata": { "tenantName": "Acme Corp", "orgName": "Sales", "catName": "Leads", "metadataMap": {"custom-test-key-3":"custom-test-value-3", "custom-test-key-4":"custom-test-value-4"} }, "data": { "convId": "0238ef3c-4252-11ea-b77f-2e728ce88125", "msgId": "0238f22a-4252-11ea-b77f-2e728ce88125", "lang": "us-en", "sub": "Goods Delivary Status", "ts": 1577836800000, "body": "Hi John, I'm writing this email to enquire about the my delivary status", "agentId": "Agent1", "psId": "Participant1", "agentEmailId": "agent1@xyz.com", "psEmailId": "ps1@acmecorp.com", "from": "agent1@xyz.com", "to": [ "ps1@acmecorp.com", "ps2@acmecorp.com" ], "journeyId": "02d8f01e-42b0-11ea-b77f-2e728ce88125" } }'
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!" } ] }