1. Home
  2. Docs
  3. API Features
  4. Custom Channel

Custom Channel

Resource

POST https://api.robinhq.com/messages

Succes message: 201 Created

Error in JSON: 400 Bad Request

Wrong authentication: 401 Invalid authorisation data

 

Starting with v1.7 of the ROBIN API, we added the possibility to use your own custom channel. In order for this to work, the ROBIN API needs to be configured (please contact api@robinhq.com for assistance). A custom channel has the following characteristics:

  • 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

Webhook URL

Part of registering a custom channel, is defining a so called webhook URL. This is an URL that ROBIN posts replies to messages to. When an agent types a reply to a message that was created for a custom channel, that response is posted to the registered webhook URL for that channel. The data posted is a JSON string containing the following properties (this first section are properties that were provided to the original message):

{
  "ChannelAccountExternalIdentifier": "whatsapp",
  "ConversationGuid": "ddb44afc-b87d-4437-95c2-707543c84676",
  "ConversationExternalIdentifier": "convId",
  "MessageExternalIdentifier": "messId",
  "RelationExternalIdentifier": "john@email.com",
  "RelationName": "John",
  "Content": "This is a message",
  "IsPrivate": false,
  "Referrer": "http://robinhq.com",
  "Subject": "Question",
  "SentDateTime": "2017-09-12T12:34:56",
  "Attachments": [
    {
      "FileName": "attachment.txt",
      "Base64Content": "MQ=="
    }
  ]
}

The only exception is when a channel has “Send private as email” set and an agent sends a private reply, in which case the reply is sent directly via email and not posted to the webhook URL.

 

Schema of Custom Channel

KeyTypeRequiredDescriptionExample
ChannelAccountExternalIdentifierstringYesThis is the registered name for the custom channel, determined when the channel is registered."whatsapp"
ConversationGuidstringNoThe generated GUID of the conversation."ddb44afc-b87d-4437-95c2-707543c84676"
ConversationExternalIdentifierstringYesThis is the external ID for the conversation."convId"
MessageExternalIdentifierstringYesThis is the external ID for the message."messId"
RelationExternalIdentifierstringYesThe external ID for the relation (usually an email address or phone number)"john@email.com"
RelationNamestringYesThe name for the relation"John"
ContentstringYesThe content of the answer."This is a message"
IsPrivatebooleanNoIndicates whether the returned message is marked private by the agent.false
ReferrerstringNoThe referrer for the message, e.g. an URL"http://robinhq.com"
SubjectstringNoThe subject for the message when a new conversation will be created."Question"
SentDateTimestringNoThe date when a message was sent."2017-09-12T12:34:56"
Attachmentsarray[Attachment]NoAn attachment object contains the following properties:
FileName
Base64Content
[]
FileNamestringNoThe filename of the attachment."attachment.txt"
Base64ContentstringNoThe bytes of the attachment as base64 encoded string."MQ=="