Import conversation

POST
/v1/conversations/import

Import a previously created conversation into Dixa. For inbound messages the author is assumed to be the requester of the conversation (end user), unless the specific channel supports overriding the message author through its attributes. For outbound messages the author is specified using the agentId field.

Authorization

ApiKeyAuth conversation.import
headerAuthorization<token>

Scope: conversation.import

Request Body

The type of conversation to import

application/json
  1. body
genericChannelName*string

The conversation channel. Currently supported values are 'email' and 'genericapimessaging'. See payload examples for each case.

requesterId*string
Formatuuid
requesterConnectionStatus?string

values: [Connected, Disconnected]

direction*string

values: [Inbound, Outbound]

messages?array<|>
createdAt*string
Formatdate-time
assignment?
externalId?string
closing?

Triggers the closing of the conversation

attributes?unknown

A set of dynamic attributes that are specific to the conversation channel, but not limited to it. See channel specific examples for your use case.

Response Body

The id of the imported conversation

application/json
  1. response
data*
curl -X POST 'https://dev.dixa.io/v1/conversations/import' \  -H 'Authorization: <API token>' \  -H 'Content-Type: application/json' \  -d '{  "genericChannelName": "genericapimessaging",  "requesterId": "9c2a2cce-699f-4a72-89d9-fda5bc8dec8b",  "requesterConnectionStatus": "Connected",  "direction": "Inbound",  "messages": [    {      "content": {        "value": "Hi, I need help with my order",        "_type": "Text"      },      "attachments": [],      "createdAt": "2021-12-01T13:00:00.003Z",      "_type": "InboundImport"    },    {      "content": {        "value": "Sure — what seems to be the problem?",        "_type": "Text"      },      "agentId": "cd4ceb58-bb3a-443c-9cd8-4f088feafe5b",      "attachments": [],      "createdAt": "2021-12-01T14:00:00.004Z",      "_type": "OutboundImport"    }  ],  "createdAt": "2021-12-01T11:00:00.001Z",  "assignment": {    "agentId": "cd4ceb58-bb3a-443c-9cd8-4f088feafe5b",    "assignedAt": "2021-12-01T12:00:00.002Z"  },  "_type": "GenericConversationImport"}'
{
"data": {
"id": 100,
"partialErrors": [
{
"message": "The conversation could not be assigned"
},
{
"message": "Invalid attachment url in message. externalId: 42"
}
]
}
}