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
    "message": { //Optional
        "template": "<Message template ID.>",
        "parameters": {
            "parameter1": "<value>",
            "parameter2": "<value>",
            "parameter3": "<value>"
        }
    },
    "deliverychannel": "appmessaging", //Mandatory
    "channels": {
        "appmessaging": {
            "message": {
                "text": "RTM_message",
                "attachment": {
                    "file": "<URL of resource, e.g. http://ip/image.jpg>",
                    "contentType": "image",
                    "size": "10"
                }
            },
            "notification": {
                "web_extras": {
                    "collapse_key": "web_col_key",
                    "action": "web_col_key",
                    "url": "<Valid http URL>"
                },
                "title": "notification_title",
                "text": "notification_text",
                "windows_extras": {
                    "logo": "<URL of resource, e.g. http://ip/image.jpg>",
                    "sound": "wind_not_sound",
                    "image": "<URL of resource, e.g. http://ip/image.jpg>",
                    "badge": "wnd_badge",
                    "notificationaction": {
                        "action": "OPEN_URL",
                        "value": "<Valid HTTP URL>"
                    }
                },
                "interactive": {
                    "category": "DOUBLE_YES_NO",
                    "pushref": "pu_ref",
                    "actions": [{
                            "action": "OPEN_APP",
                            "identifier": "YES",
                            "pos": 1
                        }, {
                            "action": "OPEN_APP",
                            "identifier": "NO",
                            "pos": 2
                        }
                    ]
                },
                "ios_extras": {
                    "attachmenturl": "<URL of resource, e.g. http://ip/image.jpg>",
                    "collapse_key": "ios_col_key",
                    "sound": "ios_ex_sound",
                    "badge": "ios_badge_",
                    "notificationaction": {
                        "action": "OPEN_URL",
                        "value": "<Valid HTTP URL>"
                    }
                },
                "android_extras": {
                    "collapse_key": "and_col_key",
                    "sound": "android_not_sound",
                    "iconurl": "<URL of resource, e.g. http://ip/image.jpg>",
                    "customtags": {
                        "imageurl": "and_not_image"
                    },
                    "notificationaction": {
                        "action": "OPEN_URL",
                        "value": "<Valid HTTP URL>"
                    }
                }
            },
            "thread_type": "conversation",
            "thread_title": "thread_title",
          	"thread_id": "please enter the thread id for the 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.>"
        }, {
            "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.>"
        }
    ]
}

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.Real Time channel sends messages to enable mobile apps to provide App-Messaging.

It supports rich multimedia messages with text and optional multimedia items.

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.

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.

For more information on notify URL formats, click Message Receipts.

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 override the service's default values and the parameters in the base request.

appmessaging
The following parameters are part of the appmessaging.

ParameterTypeMandatoryDescription
messageJSONObjectYesFor more information, see message.
notificationJSONObjectNoFor more information, see notification.
thread_typeStringYesSpecifies the thread type.
thread_titleStringYesSpecifies the thread title.
  • message

The following table defines the parameters in the message object block.

Parameter

Type

Mandatory

Description

text

String

Yes

Specifies the message.

attachment

JSONObject

No

The attachments parameter is in itself an object parameter block for the following sub-parameters:

  • contentType
  • file
  • preview
  • size
  • duration
  • latitude
  • longitude

For more information on attachment, see attachment.

attachment
The following parameters are part of the attachment block.

Parameter

Type

Mandatory

Description

contentType

String

Yes

MIME content type, such as image/jpg for JPEG images.

Supported content types:

  • file

  • image

  • video

  • audio

  • location

fileStringYesComplete URL of file.
previewStringNo, unless contentType is video.A base64 string of a JPEG image to display as a preview for video.
sizeIntegerNoSize of content in bytes.
durationStringNo, unless contentType audio or videoDuration of audio or video in seconds.
latitudeStringNo, unless contentType is locationSpecifies the latitude of the location.
longitudeStringNo, unless contentType is locationSpecifies the longitude of the location.
  • notification

The following table defines the parameters in the notification block object block.

Parameter

Type

Mandatory

Description

title

String

Yes

Specifies the notification title.

text

String

Yes

Specifies the notification text.

android_extras

JSONObject

No

The following keys are available under android_extras:

For detailed information, see Push:Android.

ios_extras

JSONObject

No

The following keys are available under ios_extras:

For detailed information, see
Push:iOS.

windows_extras

JSONObject

No

The following keys are available under windows_extras:

For detailed information, see
Push:Windows.

web_extras

JSONObject

No

The following keys are available under web_extras:

  • collapsekey
  • action
  • url

For detailed information, see
Push:Web.

interactiveJSONObjectNoFor more information, see Section: Interactive.

notificationaction
The following parameters are part of the notificationaction parameter block.

Parameter

Type

Mandatory

Description

action

String

No

Following are the actions you can configure:

  • OPEN_URL: Requires a URL as action value.
  • OPEN_WEBVIEW: Requires a URL as action value.
  • OPEN_HTML: Requires a html code to render as action value.
  • DEEPLINK: Requires a deeplink URL as action value.
  • OPEN_APP: Does not require an action value.
valueStringNoSpecifies the value that is used to complete the action configured. For example, if you configure action as OPEN_URL, then you have to configure value with a URL such as www.bbc.com.**Note: If the action is set to OPENAPP**, value is not required.

📘

It is not mandatory to define notificationaction. But if you set an action, you must specify a _value _that is used to complete the configured action.

interactive
The following parameters are part of the interactive block.

Parameter

Type

Mandatory

Description

pushref

String

No

Define if the sender intends to use the message interaction result as a trigger for rules.

category

String

Yes

The category can be one of the following:

  • SINGLE_DISMISS
  • SINGLE_OPEN
  • SINGLE_SUBSCRIBE
  • SINGLE_UNSUBSCRIBE
  • SINGLE_SHARE
  • SINGLE_DEEPLINK
  • SINGLE_REPLY
  • DOUBLE_YES_NO
  • DOUBLE_ACCEPT_CANCEL
  • DOUBLE_SHARE_CANCEL
  • DOUBLE_SHOPNOW_CANCEL
  • DOUBLE_LATER_NOW
  • DOUBLE_PLAY_NOW_PLAY_LATER
  • DOUBLE_OK_LEARN_MORE
  • DOUBLE_SUBSCRIBE_UNSUBSCRIBE
  • DOUBLE_BUY_NOW_BUY_LATER
  • DOUBLE_LIKE_SHARE
  • DOUBLE_REPLY_DISMISS
  • DOUBLE_REPLY_NO_DISMISS
  • DOUBLE_REPLY_YES_DISMISS
  • DOUBLE_REPLY_YES_NO

Where the option is prefixed with SINGLE, only one choice is available. In the case of DOUBLE, two choices are available. In either case the actions parameter depends on the parameter set for category.

actions

JSONArray

Yes

Using the actions parameter, interactive actions can be built.

The actions parameter is a parameter array block consisting of:

  • pos

  • action

  • value

Note: Depending on the category choice, the outcome of the actions parameter varies.

interactive > actions parameter array block

The following parameters are part of the actions array

Parameter

Type

Mandatory

Description

pos

String

Yes

A numerical value that places the interactive element in the position specified.

action

String

Yes

Action to perform when interaction takes place, for instance:

  • DISMISS
  • OPEN_URL (Requires URL to be opened in value parameter)
  • OPEN_APP
  • DEEPLINK (Requires app page to be opened in value parameter)
  • OPENWEBVIEW (Requires URL to be opened in value parameter)
  • SHARE (Requires the content to be shared)
  • TRIVIAL_REPLY
  • INLINE_REPLY
valueStringYes, depending on action parameter.For certain actions, the value of value is used to complete the action.

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.
{
  "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>"
        }
      ]
}
Language
Credentials
Header
Copyright © 2000 - 2021 IMImobile Limited | All Rights Reserved