Channel API
Introduction
In Agent Inbox there is a possibility to use your own custom channel. In order for this to work, the Agent Inbox API needs to be configured (please contact [email protected] for assistance). A custom channel has the following characteristics that needs to be defined before getting started:
- External identifier
- Name
- Avatar (2 sizes: 18\18px and 26\26 px)
- Webhook URL
- Support private messaging (true/false)
- Send private as email (true/false)
- Support select webstore (true/false)
- Support sending attachments
The incoming and outgoing requests are the same for a custom channel, but there is one thing that we want to highlight: ConversationGuid. This field is generated by Agent Inbox. So for the first incoming request, this doesn't has any value or function. With the first answer the agent from Agent Inbox we will send the ConversationGuid in the outgoing JSON. If the next incoming request has the same ConversationGuid, we will map the message into that conversation without having matching external identifiers for Conversation and Relation.
Messages
POST https://api.robinhq.com/messages/
Response codes
Code | Description |
---|---|
201 | Created |
400 | Bad Request |
401 | Invalid authorisation data |
Request body
{
"ChannelAccountExternalIdentifier": "customChannel",
"ConversationGuid": "mscConvGuid",
"ConversationExternalIdentifier": "convId",
"MessageExternalIdentifier": "messId",
"RelationExternalIdentifier": "[email protected]",
"RelationName": "John",
"Content": "This is a message",
"IsPrivate": false,
"Referrer": "http://cm.com",
"Subject": "Question",
"SentDateTime": "2021-09-12T12:34:56",
"Attachments": [
{
"FileName": "attachment.txt",
"Base64Content": "MQ=="
}
]
}
Request schema
Name | Type | Required | Description | |
---|---|---|---|---|
ChannelAccountExternalIdentifier | String | Yes | This is the registered name of the custom channel, determined when the channel is registered | |
ConversationGuid | String | No | The generated GUID of the conversation | |
ConversationExternalIdentifier | Integer | Yes | This is the external ID of the conversation | |
MessageExternalIdentifier | String | Yes | This is the external ID of the message | |
RelationExternalIdentifier | Float | Yes | The external ID of the relation (usually an email address or phone | number) |
RelationName | String | Yes | The name of the relation | |
Content | String | Yes | The content of the answer | |
IsPrivate | Boolean | No | Indicates whether the returned message is marked private by the agent | |
Referrer | String | No | The referrer of the message, e.g. an URL | |
Subject | String | No | The subject of the message when a new conversation will be created | |
SentDateTime | String | No | The date when a message was sent | |
Attachments | Array | Yes | An attachment object | |
FileName | String | Yes | The filename of the attachment. Can be left empty if no attachments are attached | |
Base64Content | String | No | The bytes of the attachment as base64 encoded string. Can be left empty if no attachments are attached |
Updated 5 months ago