post https://api.imiconnect.io/resources/v1/messaging
Headers
Request Header | Description |
---|---|
Content-Type | application/json |
key | Service Key |
Response
Response Code | Message | Description |
---|---|---|
1001 | Queued | Returned when the request is accepted by IMIconnect. |
7000 | Invalid JSON | Returned when an invalid JSON request is sent. |
7001 | Authentication failed | Returned when an invalid service key or profile key is provided in the request. |
7002 | Service key missing | Returned when the parameter key is missing in the message request. |
7003 | Mandatory parameters missing | Returned when the mandatory parameters configured in custom event are missing. |
7004 | Invalid parameters | Returned when the parameters are invalid. |
7006 | Internal error occurred | Returned when an internal error occurs. |
7007 | Service inactive | Returned when the service is in inactive state. |
7009 | Max number of destinations | Returned when an API request exceeds the limit (1000) to send messages using messaging API. |
Body Parameters
The following are the parameters of the request body:
Parameter | Type | Mandatory | Description |
---|---|---|---|
deliverychannel | String | Yes | wa for WhatsApp |
destination | JSONArray | Yes | The destination parameter is an array of up to 1,000 entries. Messages can be sent to single or multiple recipients in a single request. For more details, refer to destination array. |
channels | JSONArray | Yes | For more details, refer to channels array. |
expiry | String | No | Expiry time in UTC format, after which messages will not be pushed. For example, 2015-04-12T13:00:19.456Z or 2015-04-12T18:30:19.456+5:30. |
correlationid | String | No | A client-side identifier chosen by the Service Provider to correlate requests and their subsequent responses. The correlationid can be up to 50 bytes long. |
notifyurl | String | No | The IMIconnect platform will send notifications to the URL specified in the notifyurl parameter. The URL is used to retrieve the status of the message sent. The notifyurl can also be configured while creating a service. If the URL is specified in both the service and the messaging API, preference will be given to the messaging API request. |
callbackData | String | No | An identifier or data that will be sent alongside notifications to the notifyurl. This can serve as identifying notifications. |
Channels
The channels parameter block configures channel communication parameters for channel-specific features
"channels":{
"AppleBusinessChat":{
"type":"text",
"text":"Text Message"
}
}
"channels":{
"AppleBusinessChat":{
"type":"text",
"text":"plain mt text message\uFFFC",
"attachments":[
{
"url":"https://4.img-dpreview.com/files/p/E~TS590x0~articles/3925134721/0266554465.jpeg",
"mimeType":"image/jpeg"
}
]
}
}
"channels":{
"AppleBusinessChat":{
"type":"richLink",
"richLinkData":{
"url":"https://youtu.be/gM0qOa_H-rs",
"title":"Mpbile Testing",
"assets":{
"video":{
"url":"https://youtu.be/gM0qOa_H-rs",
"mimeType":"video/mp4"
}
}
}
}
}
"channels":{
"AppleBusinessChat":{
"type":"interactive",
"interactiveData":{
"data":{
"version":"1.0",
"requestIdentifier":"21d4a1c4-327c-ba35-45b1-36a050b15ad2",
"images":[
{
"identifier":"6de6a59c-846f-45d8-a1d7-24382d9919db",
"url":"http://drohnemieten.dein-betrieb.com/wp-content/uploads/2017/05/maxresdefault.jpg"
},
{
"identifier":"c020521e-cc3c-41fa-876e-a445237a6f83",
"url":"https://www.lens-rumors.com/wp-content/uploads/2014/10/Nikon-AF-S-DX-Nikkor-18-140mm-f3.5-5.6G-ED-VR-sample-images1.jpg"
},
{
"identifier":"b70de3eb-a412-4fdd-a4b1-cb4eef853ded",
"url":"http://www.tompetty.com/sites/g/files/g2000007521/f/sample1_1.jpg"
}
],
"listPicker":{
"sections":[
{
"items":[
{
"style":"default",
"title":"iPhone X",
"imageIdentifier":"c020521e-cc3c-41fa-876e-a445237a6f83",
"subtitle":"So immersive the device itself disappears into the experience",
"order":0,
"identifier":"0"
},
{
"style":"default",
"title":"iPhone 8",
"imageIdentifier":"b70de3eb-a412-4fdd-a4b1-cb4eef853ded",
"subtitle":"iPhone 8 introduces an all new glass design",
"order":1,
"identifier":"1"
},
{
"style":"default",
"title":"iPhone SE",
"imageIdentifier":"6de6a59c-846f-45d8-a1d7-24382d9919db",
"subtitle":"A big step for small",
"order":2,
"identifier":"2"
}
],
"title":"Available offers!",
"multipleSelection":true,
"order":0
}
]
}
},
"useLiveLayout":true,
"receivedMessage":{
"style":"small",
"title":"The best deals on new iPhones!",
"subtitle":"Upgrade to a brand new iPhone this summer",
"imageIdentifier":"6de6a59c-846f-45d8-a1d7-24382d9919db"
}
}
}
}
Text
Parameter | Mandatory | Description |
---|---|---|
type | Yes | Options: text, richlink, interactive |
text | Yes | The text of the text message, which can contain URLs and formatting |
attachments | No | Contains the attachment object |
- The attachments object
Parameter | Mandatory | Description |
---|---|---|
url | Yes | Publicly accessible URL that is a direct link to the media |
mimeType | Yes | The MIME type |
Richlinks
Parameter | Mandatory | Description |
---|---|---|
type | Yes | Options: text, richlink, interactive |
richlinkData | Yes | Rich link object |
- The rich link object
Parameter | Mandatory | Description |
---|---|---|
url | Yes | Publicly accessible URL that is a direct link to the media |
title | Yes | Title of the rich link message |
assets | Yes | Contains image or video asset |
"assets":{
"image":{
"url":"https://4.img-dpreview.com/files/p/E~TS590x0~articles/3925134721/0266554465.jpeg",
"mimeType":"image/jpeg"
}
}
"assets":{
"video":{
"url":"https://youtu.be/gM0qOa_H-rs",
"mimeType":"video/mp4"
}
}
List Picker
Parameter | Mandatory | Description |
---|---|---|
type | Yes | Options: text, richlink, interactive |
interactiveData | Yes | Contains the list/date picker data |
- The interactiveData object
Parameter | Mandatory | Description |
---|---|---|
version | Yes | A string representing the version number of the message extension schema. Should be 1.0. |
requestIdentifier | Yes | A string that representing a unique identifier for the request. IMIconnect returns the ID in the response it sends back to the client application |
images | Yes | An array of image dictionaries |
listPicker | Yes if you want to send list picker | A dictionary that tells Messages how the list picker should behave and what content it should show to the customer. |
event | Yes if want to send date picker | A dictionary that tells Messages how the date picker should behave and what content it should show to the customer. |
- images
Parameter | Mandatory | Description |
---|---|---|
data | Yes | Direct link to the image |
identifier | Yes | A string containing the image identifier, which must be unique within the list of images. |
- list picker
"listPicker":{
"sections":[
{
"items":[
{
"style":"default",
"title":"iPhone X",
"imageIdentifier":"c020521e-cc3c-41fa-876e-a445237a6f83",
"subtitle":"So immersive the device itself disappears into the experience",
"order":0,
"identifier":"0"
},
{
"style":"default",
"title":"iPhone 8",
"imageIdentifier":"b70de3eb-a412-4fdd-a4b1-cb4eef853ded",
"subtitle":"iPhone 8 introduces an all new glass design",
"order":1,
"identifier":"1"
},
{
"style":"default",
"title":"iPhone SE",
"imageIdentifier":"6de6a59c-846f-45d8-a1d7-24382d9919db",
"subtitle":"A big step for small",
"order":2,
"identifier":"2"
}
],
"title":"Available offers!",
"multipleSelection":true,
"order":0
}
]
}
},
"useLiveLayout":true,
"receivedMessage":{
"style":"small",
"title":"The best deals on new iPhones!",
"subtitle":"Upgrade to a brand new iPhone this summer",
"imageIdentifier":"6de6a59c-846f-45d8-a1d7-24382d9919db"
}
}
}
}
- date picker
"event":{
"timezoneOffset":-100,
"identifier":"fd296699-6ad1-4c96-af78-ae10dee1f19c",
"title":"NHS Appointments",
"timeslots":[
{
"duration":1800,
"startTime":"2019-01-01T15:30+0000",
"identifier":"0"
},
{
"duration":1800,
"startTime":"2019-01-02T16:30+0000",
"identifier":"1"
},
{
"duration":1800,
"startTime":"2019-01-03T16:30+0000",
"identifier":"2"
},
{
"duration":1800,
"startTime":"2019-01-04T12:30+0000",
"identifier":"3"
},
{
"duration":1800,
"startTime":"2019-01-05T13:30+0000",
"identifier":"4"
},
{
"duration":1800,
"startTime":"2019-01-06T17:30+0000",
"identifier":"5"
},
{
"duration":1800,
"startTime":"2019-01-07T15:30+0000",
"identifier":"0"
},
{
"duration":1800,
"startTime":"2019-01-08T15:30+0000",
"identifier":"0"
},
{
"duration":1800,
"startTime":"2019-01-09T15:30+0000",
"identifier":"0"
},
{
"duration":1800,
"startTime":"2019-01-10T15:30+0000",
"identifier":"0"
},
{
"duration":1800,
"startTime":"2019-01-11T15:30+0000",
"identifier":"0"
}
],
"location":{
"title":"5 St Johns Street",
"latitude":51.5209041,
"longitude":-0.1025591,
"radius":16
}
}
},
"useLiveLayout":true,
"replyMessage":{
"style":"small",
"title":"Selected time",
"alternateTitle":"06-Aug-2018 at 10:00 AM"
},
"requestIdentifier":"b0291fd1-d2ac-4109-bd53-9258d6748619",
"receivedMessage":{
"style":"small",
"title":"NHS Appointment",
"subtitle":"Available appointments at your locall GP",
"imageIdentifier":"a9b37a98-92a2-4f65-b74a-6a0cabf51b93"
}
}
}
}