This single API provides a multitude of functionality for multi-channel outbound messaging.

Headers

Request HeaderDescription
keyService Key
content-typeapplication/json
##Request Body
{  
   "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 CodeMessageDescription
1001QueuedReturned when the request is accepted by IMIconnect.
7000Invalid JSONReturned when an invalid JSON request is sent.
7001Authentication failedReturned when an invalid service key or profile key is provided in the request.
7002Service key missingReturned when the parameter key is missing in the message request.
7003Mandatory parameters missingReturned when the mandatory parameters configured in custom event are missing.
7004Invalid parametersReturned when the parameters are invalid.
7006Internal error occurredReturned when an internal error occurs.
7007Service inactiveReturned when the service is in inactive state.
7009Max number of destinationsReturned 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.

   "message":{        "template":"<Template ID>",      "parameters":{           "parameter1":"<value>",         "parameter2":"<value>",         "parameter3":"<value>"      },   }

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.
Message length is limited as per SMS is 1024 bytes.

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:

  • 1 - low

  • 2 - Medium

  • 3 - High

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:

  • 1 – Text (default)
  • 2 – Flash
  • 3 – Binary
  • 4 – Unicode

If no parameter is specified, type defaults to Text.

bodyStringYes (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:

ParameterTypeMandatoryDescription
linkidNumberYesThis parameter is mandatory when the smartlinks parameter is configured. The linkid gets generated for a smartlink created using IMIconnect.
validityNumberNoSpecifies the time in minutes after which the link will expire.
Language
Credentials
Header
Copyright © 2000 - 2021 IMImobile Limited | All Rights Reserved