Broadcast Push Message with Filters

The Broadcast Push Message with Filters API, based on a selected mobile platform (iOS, Android, BlackBerry,Windows, and Web), broadcasts push notification to only a subset of users.

This is a secure API and the user needs to provide security credentials to invoke this API.

URL

The HTTP URL for Broadcast Push Message with Filters API is:

<host>:<port>/api/v1/message/push

This API implements Gateway Filter for Authentication to authenticate access of the API by a user.

Based on the content format, the payload's request header content type for:

  • XML is text/xml;charset=UTF-8
  • JSON is application/json;charset=UTF-8

Method

Post

Input Parameters

The following fields are input parameters:

Input Parameter Level – Two Level – Three Level- Four Required Type Description
messageRequest           An array of messageRequest objects
  appId     Yes long Unique ID assigned to an app
  global     Optional   .An array of global objects
  messages         An array of messages objects
    message       An array of message objects
      content Optional   An array of content objects
content
- priorityService (boolean value - Optional)
- data (push message -Optional)
- mimeType (label for a data so system can know it like,text/plain - Optional)
      overrideMessageId Optional string If you wish to change the push message and yet the message is not sent, then you need to pass the old message ID in sample request to update the existing push message to be sent
      startTimestamp Optional date time format Time relative to a starting point
      expiryTimestamp Optional date time format Time relative to an ending point
      subscribers osType (Required)
allActive (Required)
  An array of subscribers objects
- allActive (boolean value)
- osType (Apple, Anroid, Windows, BlackBerry, and Web)
    platformSpecificProps   Optional   An array of platform specific properties. For more details, see
    type   Required string Type of channel, such as push
  invocationTracking     Optional string

The entity that invokes the channel
This value is used in a dynamic column on the Status page; the name of the column is fetched from the Configuration page

IMPORTANT: This parameter is available from Quantum Fabric Engagement versions 9.4.0.1, 9.5.0.1, 9.6.0.1, and 9.7.0.1.

Sample Request

XML

<?xml version="1.0" encoding="UTF-8"?>
<messageRequest appId="BulkPushApp_132012">
   <global>
      <subscribers />
      <platformSpecificProps />
   </global>
   <messages>
      <message expiryTimestamp="0" overrideMessageId="0" refId="" startTimestamp="0" type="PUSH">
         <subscribers>
            <subscriber allActive="true" osType="iphone" />
         </subscribers>
         <content>
            <mimeType>text/plain</mimeType>
            <priorityService>false</priorityService>
            <data>apple broadcast push</data>
         </content>
      </message>
   </messages>
</messageRequest>

JSON

{
	"messageRequest": {
		"appId": "22874-10836483458",
		"global": {},
		"messages": {
			"message": {
				"content": {
					"priorityService": "false",
					"data": "push",
					"mimeType": "text/plain"
				},
				"overrideMessageId": 0,
				"startTimestamp": 0,
				"expiryTimestamp": 0,
				"subscribers": {
					"subscriber": [
						{
						"allActive":true,
						"osType":"androidgcm"
						}
					]
				},
				"platformSpecificProps": {},
				"type": "PUSH"
			}
		}
	}
}

Sample Response

XML

{
  "details" : [ {
    "refId" : "",
    "description" : "",
    "msgId" : "7716369070950409534"
  } ],
  "id" : "7716369071581121961",
  "message" : "Request Queued. "
}

JSON

{
  "details" : [ {
    "refId" : "",
    "description" : "",
    "msgId" : "7715504112921814245"
  } ],
  "id" : "7715504135616990626",
  "message" : "Request Queued. "
}

NOTE:
refId: Here, refId refers to an ID that returns the same value as a user provided in the push payload.
msgId: Here, msgId refers to an ID that is used to map messagerequest table and messageentry table for internal data record.
id: Here, id refers to request ID displayed under Settings > Status > List view > Request ID column

Response Status

Code Description
Status 200 Request queued
Status 400 Invalid Kony appId or application is not published with given appId
No active subscribers found for application ID
Invalid request format. OS type invalid
Invalid request format. No enum constant com.kony.kms.enums.MessageType
Status 401 Unauthorized request
Status 500 Server failure to process request