Custom Channel
Integrate third-party messaging app into Alexa360
Last updated
Integrate third-party messaging app into Alexa360
Last updated
To receive a message via a Custom Channel, the following steps need to be followed:
1 .When a contact attempts to send a message, the messaging service provider will call your custom integration server with the message payload (please review API documentation of messaging service provider for reference).
2. Your custom integration server will receive the message and will post it to (in format).
To send a message via a Custom Channel, the following steps need to be followed:
1. When a User/Workflow/Broadcast will attempt to send a message, will call your custom integration server with the message payload (in format).
2. Your custom integration server will receive the message and will post it to the messaging service provider in the format that they require (please review API documentation of messaging service provider for reference).
3. The messaging service provider will receive the Webhook and confirm if the message has been delivered successfully. Tips, if the message is not delivered successfully, you can try adding a retry mechanism in your custom integration server.
Custom Channe
lAPI Base URL
1. Phone Number: Use this if the messaging service provider recognizes contacts based on their Phone Number.
Sample format: +96560796076
2. Custom ID: Use this if the messaging service provider recognizes contacts based on a custom-generated ID.
1. The maximum character length is 50
2. A-Z
, a-z
, 0-9
, _
, =
, +
, /
and @
are allowed.
5. The following dialog will provide the Channel ID, API Token, and Webhook URL e.g.
1. Channel ID: gfd8g7fd89dgfd
2. API Token: aaaxczsadzxcasdacxzcasdaaaxczsadzxcasdacxzcasd
3. Webhook URL: https://app.alexa360.io/custom/channel/webhook/
Sample for Messages
Sample for Messaging Echoes
Sample for Messaging Receipts
Fields
Field
Description
Validation
channelId
Unique Channel ID
contactId
Unique Contact ID
events.type
Event type
Required. Available type: message, message_echo, and message_status
events.mId
Message ID
Required. Unique message ID. Max 50 char
events.timestamp
UNIX Epoch Time(milliseconds)
Required. Time of the event that triggered the callback
events.message.type
Message type
Required. Available message types: text, attachment, location and quick_reply. Refer Message Type section for other message type samples.
events.message.text
Message text
Required. Max length 7,000 characters
events.status.value
Text
Required if event.type is message_status. Available status values: sent, delivered, read, and failed
events.status.message
Text
Required if events.status.value is failed.
contact.firstName
First name
Optional. Max 50 characters
contact.lastName
Last name
Optional. Max 50 characters
contact.profilePic
Profile pic URL
Optional. Avatar size should be no more than 100 kb. Recommended 720x720
contact.locale
Locale Code
Optional. Refer here for the list of values.
contact.countryCode
Country Code
Optional. 2 letters country code - ISO ALPHA-2 Code
contact.timezone
Time zone
Optional. (min: -24) (max: 24)
contact.email
Email address
Optional. Max 50 characters
contact.phone
Phone number
Optional. Max 18 characters
contact.language
Language
Optional. ISO 639-1
Authentication has to be done on the endpoint before passing the message to the Messaging Service Provider. Here is an express middleware example
Fields
Field
Description
Validation
type
Message type
Required. text
text
Message text
Required. Max length 7,000 characters
Sample for Media File
Field
Description
Validation
type
Message type
Required. attachment.
attachment.type
Attachment type
Required.Available attachment types: image, video, audio and file
attachment.url
URL
Required. Max 2,000 characters. Make sure itβs a public link so users or contacts able to see the content
attachment.mimeType
Mime type of the attachment
Optional
attachment.fileName
File name
Optional. File name should include extension. Max 256 characters (including file extension). Sending a file without extension or with the wrong extension might cause the contact or user to be unable to open the file
attachment.description
File description
Optional. Max 256 characters. Only applicable for attachment.type = image
Sample for location
Field
Description
Validation
type
Message type
Required. location
latitude
Coordinates
Required. Latitude (Β±90Β°) within valid ranges
longitude
Coordinates
Required. Longitude (Β±180Β°) within valid ranges
address
Location Address
Optional. Max 256 characters
Sample for Quick Reply
Field
Description
Validation
type
Message type
Required. quick_reply
title
Quick reply title
Required. Max 256 characters
replies
Reply text
Required. Max 10 replies with max 256 characters for each reply
{
"error": {
"message": "Error message"
}
}
This feature is currently in Beta.
Webhook URL is used to POST the Messages
, Messaging Echoes
and Messaging Receipts
to the platform.
The following code will be calling the webhook on the platform and will be creating the contact (if it does not exist) and saving the message against the contact.
Required. Unique field. Is generated by
Required. Unique contact id. Max 50 char
will be calling the following endpoint <API Base URL>/message
Here is the cURL example of calling the endpoint