Messages

Anonymize message

PATCH
/beta/conversations/{conversationId}/messages/{messageId}/anonymize

Request the anonymization of a single message in a conversation.

Authorization

ApiKeyAuth anonymization
headerAuthorization<token>

Scope: anonymization

Path Parameters

conversationId*integer

the id of the conversation in which the message belongs

Formatint64
messageId*string

the id of the message to anonymize

Formatuuid

Response Body

The message's anonymization request status

application/json
  1. response
data*
Example Request
curl -X PATCH 'https://dev.dixa.io/beta/conversations/{conversationId}/messages/{messageId}/anonymize' \  -H 'Authorization: <API token>'
{
"data": {
"id": "b165fdaa-51d6-44b0-bfcd-5f431d623fa7",
"entityType": "MessageAnonymizationType",
"_type": "Message",
"initiatedAt": "2021-12-01T12:46:36.581Z[GMT]",
"targetEntityId": "10749_1b9adc49-62f7-4056-a9c0-c18c1f25afdb",
"requestedBy": "4c7af391-b7fd-4560-9d82-b3464eef8776"
}
}

List messages

GET
/beta/conversations/{conversationId}/messages

Get all messages for a particular conversation by providing the conversation id. Note that messages in ContactForm conversations can have attributes of "_type": "EmailAttributes" if they are created through a webform, or "_type": "ContactFormAttributes" when created through a chat widget.

Authorization

ApiKeyAuth
headerAuthorization<token>

Path Parameters

conversationId*integer
Formatint64

Response Body

List of messages for a conversation sorted from oldest to newest

application/json
  1. response
data?array<>
Example Request
curl -X GET 'https://dev.dixa.io/beta/conversations/{conversationId}/messages' \  -H 'Authorization: <API token>'
{
"data": [
{
"id": "11b95893-0514-4606-a5d8-1880172b3a55",
"authorId": "41646d42-edc0-493e-ac7b-814d9ff40a2e",
"externalId": "13244",
"createdAt": "2021-12-01T12:46:36.581Z[GMT]",
"attributes": {
"emailContent": {
"content": {
"value": "Hello, this is a regular email content",
"_type": "Text"
},
"_type": "Regular"
},
"from": {
"email": "some-help@email.dixa.io",
"name": "Help"
},
"to": [
{
"email": "someone@somecompany.com",
"name": "Some One"
}
],
"cc": [],
"bcc": [],
"isAutoReply": false,
"inlineImages": [
{
"url": "https://files.dixa.io/public/something/attachment/inline-image-1",
"prettyName": "image001.png"
}
],
"attachments": [
{
"url": "https://files.dixa.io/private/something/attachment/attachment-1",
"prettyName": "Picture"
}
],
"direction": "Outbound",
"originalContentUrl": {
"url": "https://files.dixa.io/private/something/email_original_data/a1b2c3d4"
},
"_type": "EmailAttributes"
}
},
{
"id": "12c95893-0514-4606-a5d8-1880172b3a56",
"authorId": "41646d42-edc0-493e-ac7b-814d9ff40a2e",
"externalId": "13245",
"createdAt": "2021-12-01T12:47:36.581Z[GMT]",
"attributes": {
"emailContent": {
"file": {
"url": "https://files.dixa.io/private/something/email_stripped_content/large-email-content",
"prettyName": "Large Email Content"
},
"_type": "TooLarge"
},
"from": {
"email": "some-help@email.dixa.io",
"name": "Help"
},
"to": [
{
"email": "someone@somecompany.com",
"name": "Some One"
}
],
"cc": [
{
"email": "manager@somecompany.com",
"name": "Manager"
}
],
"bcc": [
{
"email": "archive@somecompany.com"
}
],
"isAutoReply": false,
"inlineImages": [],
"attachments": [
{
"url": "https://files.dixa.io/private/something/attachment/attachment-2",
"prettyName": "Large Document"
},
{
"url": "https://files.dixa.io/private/something/attachment/attachment-3",
"prettyName": "Spreadsheet"
}
],
"direction": "Inbound",
"originalContentUrl": {
"url": "https://files.dixa.io/private/something/email_original_data/b2c3d4e5"
},
"_type": "EmailAttributes"
}
}
]
}

Add message

POST
/beta/conversations/{conversationId}/messages

Add a message to a conversation. For inbound messages the author is assumed to be the requester of the conversation (end user). For outbound messages the author is specified using the agentId field.
If attachments are added to the message, they will be copied and stored in Dixa.
Content in outbound message is required except for Whatsapp messages.
Supported channels are Chat, Messenger, Contact Form, Email, Sms (outbound only), Whatsapp (outbound and Markdown only).

Supported Markdown syntax for Markdown content: bold **text**, italic *text*, bold & italic ***text***, strikethrough ~text~, blockquote > Quoted text. \n Message about quoted text, ordered list List:\n1. Item\n2. Item\n3. Item, unordered list List:\n* Item\n* Item\n* Item, inline code This is code``.

Whatsapp channel:
Only one attachment is allowed per WhatsApp message.
Supports adding a message with attachment only (no content).
Supports the following file types for attachments: .jpg, .jpeg, .png, .pdf, .doc, .docx, .pptx, .xlsx

Authorization

ApiKeyAuth conversation.reply
headerAuthorization<token>

Scope: conversation.reply

Path Parameters

conversationId*integer
Formatint64

Request Body

The message to be added to a conversation

application/json
  1. body

Only Outbound messages are supported for Sms and Whatsapp.

content*||
attachments?array<>
integrationEmail?string

Internal email address registered for the integration with format: <email-address>@email.dixa.io

externalId?string

Client generated identifier for external reference

Response Body

The added message

application/json
  1. response
data*
curl -X POST 'https://dev.dixa.io/beta/conversations/{conversationId}/messages' \  -H 'Authorization: <API token>' \  -H 'Content-Type: application/json' \  -d '{  "content": {    "value": "I need some help!",    "_type": "Html"  },  "attachments": [    {      "url": "http://attachment.url",      "prettyName": "Filename"    }  ],  "_type": "Inbound"}'
{
"data": {
"content": {
"value": "An amazing message",
"_type": "Html"
},
"direction": "Outbound",
"authorId": "bac5a02c-15b3-44da-ae1e-ab7b9db4aa89",
"messageId": "87bac308-e49f-4134-84cc-96b868f1e1e4",
"createdAt": "2021-06-09T08:18:37.284Z"
}
}