This single API provides a multitude of functionality for multi-channel outbound messaging.
Headers
Request Header | Description |
---|---|
key | Service Key |
content-type | application/json |
{
"correlationid":"<Unique transaction ID from the client end>", //Optional
"notifyurl":"<Notifications will be sent to the URL specified here>", //Optional
"callbackData":"<Identifier sent alongside notifications to the notifyurl>", //Optional
"expiry":"<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. >", //Optional
"priority":"<Accepts numbers 1-low, 2-medium, and 3-high>", //Optional
"deliverychannel":"sms", //Mandatory
"message":{ //Optional
"template":"<Message template ID.>",
"parameters":{
"parameter1":"<value>",
"parameter2":"<value>",
"parameter3":"<value>"
}
},
"channels":{ //Mandatory
"smartlinks":[
{
"linkid": "<specifies the link id that is generated for a smartlink using IMIconnect. >",
"validity": "<Specifies the time in minutes after which the link will expire>"
}
],
"sms":{
"type":"<Message type 1– Text, 2- Flash, 3– Binary, 4– Unicode>",
"text":"<Channel specific message text>",
"body":"<Hexadecimal content for binary type message>",
"media-path":"<Media path which will be appended to SMS text>",
"senderid":"<Predefined Sender ID for this message>"
}
},
"destination":[ //Mandatory
{
"msisdn/customerid":[
"<value1>",
"<value2>"
],
"correlationid":"<A unique transaction ID up to 50 bytes used by Client to match requests with responses. Will override correlationid given in request body.>"
},
{
"msisdn/customerid":[
"<value1>",
"<value2>"
],
"correlationid":"<A unique transaction ID up to 50 bytes used by Client to match requests with responses. Will override correlationid given in request body.>" //Optional
}
]
}
Response
This API may return the following response codes:
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. |
Parameters
The following are the parameters of the request body:
Parameter | Type | Mandatory | Description |
---|---|---|---|
deliverychannel | String | Yes | Specifies the channel to send a message. When the channel is set to sms, the messages are limited to 1024 bytes. |
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. |
message | JSONObject | No | The message parameter block references a template via the template ID which is created within the IMIconnect platform. The amount of sub-parameters in the parameters block depends on the number of parameters expected in the template. These parameters are supplied to the template for substitution in the final message.
Note: If you use message templates, then the parameter name should match with the parameter specified in the template. The parameters in this message block are overridden if a channel specific parameter block is also used. |
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. |
priority | String | No | This parameter is used to specify the message priority. The priority is defined while creating the client in the admin screen. All the services that are created under this client will have same priority. Messages of equal priorities are delivered in the natural order of their arrival at their destinations. The options for this parameter are:
If any invalid option or text is passed, then the priority is set as configured while creating the client. |
Channels
The channels parameter block configures channel communication parameters and will overrides the service's default values and the parameters in the base request.
The following parameters are part of the sms parameter block which in turn is part of the channels block.
Parameter | Type | Mandatory | Description |
---|---|---|---|
text | String | Yes | Text message up to 1024 characters. |
senderid | String | No | The Sender ID for this message. Note: The senderid asset must be pre-configured and associated with the channel. If the senderid is not configured, a default senderid CONNCT can be used to send the message. |
media-path | String | No | Media path which appends to the text message. |
type | String | No | Following are the supported message types:
If no parameter is specified, type defaults to Text. |
body | String | Yes (when type is set to 3) | When type is set to 3, the body shall contain hexadecimal content for binary type message. |
{
"channels":{
"sms":{
"text":"<Channel specific message text>",
"type":"<Message type 1– Text, 2- Flash, 3– Binary, 4– Unicode>",
"senderid":"<Predefined Sender ID for this message>",
"body":"<Hexadecimal content for binary type message>",
"media-path":"<Media path which will be appended to SMS text>",
}
}
}
smartlinks
An array that contains the parameters of Smartlink. This is an optional parameter. To use Smartlinks, you must create a smartlink and use the link id in messaging API. These smartlinks can be used in SMS, RT and OTT messaging channels.
Following are the parameters of smartlinks:
Parameter | Type | Mandatory | Description |
---|---|---|---|
linkid | Number | Yes | This parameter is mandatory when the smartlinks parameter is configured. The linkid gets generated for a smartlink created using IMIconnect. |
validity | Number | No | Specifies the time in minutes after which the link will expire. |