Overview
Push API is used to:
- Create campaigns (targeting all users or a group of users) to send notifications.
- Target a single user using a unique user attribute.
- Personalize payload for each user.
API Endpoint
Method: POST
https://pushapi-0X.moengage.com/v2/transaction/sendpush
The 'X' in the API Endpoint URL refers to the MoEngage Data Center (DC). MoEngage hosts each customer in a different DC. You can find your DC number (value of X) and replace the value of 'X' in the URL by referring to the DC and API endpoint mapping here.
Authentication
The API request will be authenticated through Basic Authentication. Basic Authentication sends a Base64-encoded string containing your username and password with every API request. It encodes a 'username: password' string in Base64 and appends the encoded string with 'Basic '. This string is included in the authorization header as shown below:
{"Authorization":"Basic Base64_ENCODED_APPKEY_APIKEY=="}
You can obtain the username and password details from the MoEngage dashboard.
- On the left navigation menu in the MoEngage dashboard, go to Settings > Account > APIs.
- Copy the following details:
- Username: Under Workspace ID (earlier app id), click the copy icon to copy the username.
- Password: In the API keys section, click the copy icon in the Push templates tile to copy the API key.
- Use these details to authenticate the API requests.
Request Headers
Key | Required | Sample Values | Description |
---|---|---|---|
Content-Type |
Required | {"Content-Type": "application/json"} | Set the Content-Type header to application/json. |
Authorization | Required | {"Authorization":"Basic Base64_ENCODED_APPKEY_APIKEY=="} | This authentication parameter, used for access control, must be passed in the request. For more information on generating the authentication header, refer to Authentication. |
MOE-APPKEY | Required | {“MOE-APPKEY”: “Workspace ID”} |
This is the workspace ID (earlier APP ID) of your MoEngage workspace. The MOE-APPKEY must be passed in the request. You can find your MoEngage Workspace ID in the MoEngage dashboard: Settings > Account > APIs -> Workspace ID (earlier app id) For more information, refer to Authentication. |
Request Body
Key | Required | Values | Description |
---|---|---|---|
appId | Required | String | This field denotes the app ID that you must pass to create the campaign. You can find it by selecting Settings > Account > APIs > API keys > Push tile on the MoEngage dashboard. MoEngage recommends that you test API integration in the Test Environment. The App ID for TEST ACCOUNT is suffixed with _DEBUG. |
campaignName | Required | String |
This field denotes the campaign name. The campaign name should be unique for All Users and Custom Segment campaigns.
|
campaignTags | Optional | String |
Used to add more context to campaigns. Context can be descriptive names or campaign themes such as onboarding, retention, country, and all users. Tags can also be used to filter campaigns or identify the behaviors of users who received these campaigns. The list of tags should be passed in this field. For example,
|
signature | Required | String |
A signature is required to verify whether the client is authorized to make the API call. It is generated from a hash of the campaign name, app ID, and API secret. MoEngage uses the SHA 256 method to generate this hash. Python code is used to generate the signature for your test account, and use your account's app_id. Python code to generate the signature for your test account, use the app_id that is appropriate for your account.
Generated Signature:
|
requestType | Optional | String | The value of this key is used to indicate the intention of an API request. The default value is push. |
targetPlatform | Required | List | This field denotes the platform devices that are targeted by your campaign. The Push API allows you to target users on Android, iOS, and Web platforms. You can target one or more platforms. If you want to send Web (Chrome) push notifications through the API, you should choose Web as the platform. |
targetAudience | Required | String |
This field denotes the target segment for the campaign. Supported values are:
|
targetUserAttributes | Optional | JSON Object |
This object contains the target user attribute details. For more information, refer to Target User Attributes. Note:
|
payload | Required | JSON Object | This object contains the payload details. Supported values are: |
campaignDelivery | Required | String |
This field helps decide when the campaign should be sent. Note:
|
conversionGoals | Optional | JSON Object |
This object contains the conversion goals details. For more information, refer to Conversion Goals.
|
advancedSettings | Optional | JSON Object | This object contains information about advanced settings. For more information, refer to Advanced Settings. |
Target User Attributes
Key | Required | Values | Description |
---|---|---|---|
attribute | Optional | String |
This field denotes a unique identifier or characteristic of an entity or object used to specify the target users. This value is required when the targetAudience value is User. Other fields used are:
|
comparisonParameter | Optional | String |
This field denotes a condition or operator that compares the user attributes against a specific value. Supported values are:
Note: The maximum number of parameters that can be added while using the "in" comparisonParameter is 50. This value is required when the targetAudience value is User. |
attributeValue | Optional | String | This field denotes the actual value assigned to an attribute, which is used for comparison or filtering. This value is required when the targetAudience value is User. |
isCustom | Optional | Boolean | This field denotes whether a custom attribute has been added. For custom attributes, targeting is done on any custom attribute with the available fields. Set the key "isCustom" to true. |
Android
Key | Required | Values | Description |
---|---|---|---|
message | Required | String | This field denotes the main content or text to be displayed in the notification/message. |
title | Required | String | This field denotes the headline or subject of the notification/message. |
channel_Id | Optional | String | This field denotes the channel identifier for the campaign. |
summary | Optional | String | This field denotes the brief summary or condensed version of the content. Typically displayed in collapsed notifications. |
richContent | Optional | list | An object or HTML string containing rich text, images, or other multimedia to enhance the message. Supported values are:
|
defaultAction | Optional | list | This helps you define the default action triggered when the user interacts with the notification. |
additionalActions | Optional | list | This object contains a list of extra actions or buttons that the user can perform, providing more functionality for the notification. Supported actions are:
A maximum of two additional action buttons can be used at a time. |
fallback | Optional | JSON Object | This JSON object contains the fallback values for the values mentioned above. |
iOS
Key | Required | Values | Description |
---|---|---|---|
message | Required | String | This field denotes the primary text or body of the notification/message. |
title | Required | String | This field denotes the title or subject line of the notification/message. |
subtitle | Optional | String | This field denotes the subtitle of the notification/message. |
contentAvailable | Optional | Integer | Used for updating the iOS app’s badge count with push notifications. Supported values are 0 or 1. |
richContent | Optional | list |
This field denotes a resource, such as an image or multimedia attachment, to provide additional visual or interactive elements. Supported contents are:
Image, video, and audio are only supported after iOS-10. |
defaultAction | Optional | list |
This object contains a set of default actions associated with the notifications. Supported values are:
|
additionalActions | Optional | list | This object contains a set of supplementary actions or buttons associated with the notification, enabling users to perform specific tasks. You can add only one category for additional actions. |
fallback | Optional | JSON Object | This JSON object contains the fallback values for the values mentioned above. |
Web
Key | Required | Values | Description |
---|---|---|---|
message | Required | String | This field denotes the main text content or notification body displayed to users. |
title | Required | String | This field denotes the subject or heading of the notification. |
redirectURL | Required | String | This field denotes the URL to which the user will be redirected upon interacting with the notification. |
iconURL | Required | String | This field denotes the URL of an icon image representing the notification, usually displayed alongside the title and message. |
imageURL | Optional | String | This field denotes the URL of an additional image to be shown in the notification, providing further context or visual appeal. |
autoDismiss | Optional | Boolean | This field specifies whether to dismiss the notification automatically after 8 seconds. |
fallback | Optional | JSON Object | This JSON object contains the fallback values for the values mentioned above. |
Conversion Goals
Key | Required | Values | Description | ||||
---|---|---|---|---|---|---|---|
name | Required | String | This field denotes the readable name of the conversion goal for the Campaign Info. | ||||
eventName | Required | String | This field denotes the actual event name. | ||||
attrs | Optional | Array |
This field denotes the event attribute filters. It contains the following elements:
The following are the supported filter types:
|
conversionGoals
The following are sample payloads for the conversionGoals key:
Single Conversion Goals vs. Multiple Conversion Goals
You can pass a single conversion goal or multiple conversion goals. If you are passing multiple conversion goals, the first conversion goal in the list is considered the primary conversion goal for the campaign. A Push campaign supports a maximum of five conversion goals on its list.
"conversionGoals": [
{
"name": "Added To Cart",
"eventName": "AddedTocart",
"attrs": {
"name": "product_sku",
"filter": "is",
"value": "10089712",
"type": "string"
}
}
]
"conversionGoals": [
{
"name": "Added To Cart",
"eventName": "AddedTocart",
"attrs": {
"name": "product_sku",
"filter": "is",
"value": "10089712",
"type": "string"
}
},
{
"name": "Order Placed",
"eventName": "OrderSuccess",
"attrs": {
"name": "product_price",
"filter": "is equal to",
"value": 999,
"type": "numeric"
}
}
]
Without Event Attribute Filter
Event attributes are optional. You can track a conversion goal just with an event name (without any event attribute). The following is a sample payload without the event attribute filter:
{
"name": "Added To Cart",
"eventName": "AddedTocart",
}
With String Event Attribute Filter
The following are sample payloads with string event attribute filters:
{
"name": "Added To Cart",
"eventName": "AddedTocart",
"attrs": {
"name": "product_sku",
"filter": "is",
"value": "10089712",
"type": "string"
}
}
{
"name": "Added To Cart",
"eventName": "AddedTocart",
"attrs": {
"name": "product_sku",
"filter": "is not",
"value": "10089712",
"type": "string"
}
}
{
"name": "Added To Cart",
"eventName": "AddedTocart",
"attrs": {
"name": "product_sku",
"filter": "contains",
"value": "10089712",
"type": "string"
}
}
{
"name": "Added To Cart",
"eventName": "AddedTocart",
"attrs": {
"name": "product_sku",
"filter": "does not contain",
"value": "10089712",
"type": "string"
}
}
{
"name": "Added To Cart",
"eventName": "AddedTocart",
"attrs": {
"name": "product_sku",
"filter": "starts with",
"value": "10089712",
"type": "string"
}
}
{
"name": "Added To Cart",
"eventName": "AddedTocart",
"attrs": {
"name": "product_sku",
"filter": "does not start with",
"value": "10089712",
"type": "string"
}
}
{
"name": "Added To Cart",
"eventName": "AddedTocart",
"attrs": {
"name": "product_sku",
"filter": "ends with",
"value": "10089712",
"type": "string"
}
}
{
"name": "Added To Cart",
"eventName": "AddedTocart",
"attrs": {
"name": "product_sku",
"filter": "does not end with",
"value": "10089712",
"type": "string"
}
}
{
"name": "Added To Cart",
"eventName": "AddedTocart",
"attrs": {
"name": "product_sku",
"filter": "in the following",
"value": ["10089711", "10089712", "10089713",]
"type": "string"
}
}
{
"name": "Added To Cart",
"eventName": "AddedTocart",
"attrs": {
"name": "product_sku",
"filter": "not in the following",
"value": ["10089711", "10089712", "10089713",],
"type": "string"
}
}
{
"name": "Added To Cart",
"eventName": "AddedTocart",
"attrs": {
"name": "product_sku",
"filter": "exists",
"type": "string"
}
}
{
"name": "Added To Cart",
"eventName": "AddedTocart",
"attrs": {
"name": "product_sku",
"filter": "does not exist",
"type": "string"
}
}
Note: The “value“ key is not present here.
With Numeric/Double Event Attribute Filter
{
"name": "Added To Cart",
"eventName": "AddedTocart",
"attrs": {
"name": "product_price",
"filter": "is equal to",
"value": 999,
"type": "numeric"
}
}
{
"name": "Added To Cart",
"eventName": "AddedTocart",
"attrs": {
"name": "product_price",
"filter": "is not equal to",
"value": 999,
"type": "numeric"
}
}
{
"name": "Added To Cart",
"eventName": "AddedTocart",
"attrs": {
"name": "product_price",
"filter": "is between",
"value": "899,999",
"type": "numeric"
}
}
{
"name": "Added To Cart",
"eventName": "AddedTocart",
"attrs": {
"name": "product_price",
"filter": "is not between",
"value": "899,999",
"type": "numeric"
}
}
Note: The “value“ key has a comma-separated string value.
{
"name": "Added To Cart",
"eventName": "AddedTocart",
"attrs": {
"name": "product_price",
"filter": "is greater than",
"value": 999,
"type": "numeric"
}
}
{
"name": "Added To Cart",
"eventName": "AddedTocart",
"attrs": {
"name": "product_price",
"filter": "is less than",
"value": 999,
"type": "numeric"
}
}
{
"name": "Added To Cart",
"eventName": "AddedTocart",
"attrs": {
"name": "product_price",
"filter": "exists",
"type": "numeric"
}
}
{
"name": "Added To Cart",
"eventName": "AddedTocart",
"attrs": {
"name": "product_price",
"filter": "does not exist",
"type": "numeric"
}
}
Note: The “value“ key is not present here.
Advanced Settings
Key | Required | Values | Description |
---|---|---|---|
ttl | Optional | JSON Object | This field denotes the duration for which the push notification service keeps a push message before it's discarded if it can't be delivered. If not delivered, Push Services (GCM/WEB) retry to send the message until the TTL (in minutes) does not expire. Send ‘0’ if it is not applicable to you. After the TTL has expired, push notifications will not be shown to the user. The default value for TTL is 36 mins and applies only to Android push or Web push notifications. |
ignoreFC | Optional | String |
This field denotes if the ignoreFC is enabled. Supported values are:
Note: This field is case-sensitive. When passing the value in the request, follow the case as described in the allowed values above.
|
countFC | Optional | String |
This field denotes if the countFC is enabled. Supported values are:
Values are "true" or "false" only when ignoreFC value is set to true.
|
notificationPrioritySettings | Optional | JSON Object | This field denotes whether the notification priority settings are configured. Supported values are "true" or "false" only for Android push / Web push notifications. It uses the GCM/FCM flag to send time-critical messages with high priority and drains the user's device battery more than normal messages. This object contains information about notification priority settings. For more information, refer to notificationPrioritySettings. |
pushAmp+ | Optional | String | This field denotes whether the pushAmp+ is enabled. Supported values are "true" or "false." For more information about Push Amp+, refer to Push Amp+ help documentation. |
preCacheSegment | Optional | String | This field denotes whether the preCacheSegment is enabled. Supported values are "true" or "false." Applicable for scheduled and periodic campaigns. If enabled, pre-caches the segmentation and improves campaign sending time. For caching, it is recommended that the campaign be created at least 2 hours before the scheduled time. |
campaignThrottleTime | Optional | Intg | This field denotes if the campaign throttle time is configured. Push throttling allows you to control the rate of sending a push notification. The value to be passed can be between 1 and 360 (minutes). |
campaignThrottleRpm | Optional | Intg |
The default throughput for the Push API is 100K RPM. You can send either of the key-value pairs in the Push API payload between campaignThrottleRpm and campaignThrottleTime. Both of the key-value pairs are optional.
|
useJinjaPersonalization | Optional | String |
This field denotes whether Jinja personalization can be used in the payload. Values are "true" or "false." A boolean value is used to indicate if Jinja personalization is applied to the message payloads. It is recommended that this personalization format be used. For example, you can add the following Jinja code to personalize the user name. |
ignoreMinimumDelay | Optional | String |
This field denotes whether ignore minimum delay is enabled. Supported values are "true" or "false." This is a boolean value to indicate if the Client level Minimum Delay setting should be applied for the campaign. The default value is true, if this field is not passed in the API. |
inboxExpiry | Optional | Integer | This field specifies the expiry value for the push notification in hours. |
iOSTargetDevice | Optional | String |
Supported values are:
|
deliverWhenActive | Optional | String |
This field specifies whether the push notifications will be delivered when the device is in an active state. supported value: "true" and "false". |
bypassDND | Optional | Boolean |
This field specifies whether to deliver the notification immediately, bypassing device restrictions such as battery optimizations or low-power modes. |
notificationPrioritySettings
Key | Required | Values | Description |
---|---|---|---|
Android | Optional | String |
This field denotes the notification priority configured for Android devices for this campaign.
|
iOS | Optional | Integer |
This field denotes the notification priority configured for iOS devices for this campaign. Supported values are:
|
Response Codes
Status Code | Request State | Error | Description |
---|---|---|---|
200 | Success | NA | This response is returned when the request is processed successfully. |
Invalid JSON | This response is returned when an incorrect JSON format is passed. | ||
Invalid Request Type | This response is returned when an invalid request type is passed, that is, other than push. | ||
Invalid appId | This response is returned when no dashboard exists for the given app ID. | ||
appId is not present | This response is returned when appID is missing in the request. | ||
Please specify a campaign name of more than or equal to 5 characters | This response is returned when the campaign name is less than 5 characters. | ||
Request limit exceed. | This response is returned when the dashboard is blocked for push API. | ||
Campaign name is missing | This response is returned when the campaign name is missing in the request. | ||
Signature is missing | This response is returned when the signature is missing in the request for Push API. | ||
Signature is not verified | This response is returned when the signature is incorrect. Verify the app secret and campaign name while generating signature. | ||
key is Mandatory | This response is returned when the key is missing from the payload. | ||
Campaign With this name already exists. For targetAudience type All User or Custom Segment you can't create campaign with same campaign previous name | This response is returned when the campaign name already exists. Try a new campaign name. | ||
key is not of Type List | This response is returned when the key contains a value that is not supported. | ||
value is not a allowed value. Allowed values for this field are : example | This response is returned when the key contains a value that is not supported. | ||
Failed to get all whitelisted event list | This response is returned when failed to get all whitelisted action from the data-team management team. | ||
Custom Segment Name: s_name not found in our database.Please verify same on Dashboard | This response is returned when the defined custom segment is not found in the MoEngage database. | ||
error or set isCustom to True. | This response is returned when the defined user attribute is not among the allowed types when the is_custom is set to false. | ||
Selected Attribution window is not within limits (1 - 36 hours) | This response is returned when the Selected attribution window is not within limits (1 - 36 hours). | ||
Error parsing parameters | This response is returned when some value in the payload fails in parsing. |
Sample cURL Request
curl --location 'https://pushapi-0X.moengage.com/v2/transaction/sendpush\
--header 'content-type: application/json' \
--header 'MOE-APPKEY: {{Workspace_ID or APP_ID}}' \
--header 'Authorization: Basic {{Authorization_Key}}' \
--data '{
"appId": "ABC123",
"campaignName": "Test_Campaign",
"signature": "{{Signature}}",
"requestType": "push",
"targetPlatform": [
"ANDROID"
],
"targetAudience": "User",
"targetUserAttributes": {
"attribute": "USER_ATTRIBUTE_USER_EMAIL",
"comparisonParameter": "is",
"attributeValue": "abc@example.com"
}
,
"payload": {
"ANDROID": {
"message": "this is message",
"title": "this is title",
"Summary": "this is summary",
"richContent": [
{
"type": "image",
"value": "https://images.iimg.in/c"
}
],
"defaultAction": {
"type": "richlanding",
"value": "https://www.moengage.com"
},
"additionalActions": [
{
"type": "call",
"value": "123123",
"name": "call button",
"iconURL": "abc"
}
]
},
"IOS": {
"message": "this is ios message",
"title": "this is ios title",
"richContent": [
{
"type": "sound",
"value": "custSound4.wav"
}
],
"additionalActions": [
{
"category": "INVITE_CATEGORY"
}
]
},
"WEB": {
"message": "this is web message",
"title": "this is web title",
"redirectURL": "https://www.google.com",
"iconURL": "sbc.jpeg",
"imageURL": "https://cdn.dribbble.com/users/146881/screenshots/1180383/despicable_me_1x.jpg"
}
},
"campaignDelivery": {
"type": "soon"
},
"conversionGoals": [
{
"name": "amount1",
"eventName": "AddedTocart",
"attrs": {
"filter": "is between",
"name": "amount",
"value": "10,100",
"type": "numeric"
}
}
],
"advancedSettings": {
"ttl": {
"ANDROID": 12,
"WEB": 24
},
"ignoreFC": false,
"sendAtHighPriority": true,
"inboxExpiry": 360
}
}
Sample Response
{
"requestId": "{{requestId}}",
"responseId": "{{responseId}}",
"cid": "{{cid}}",
"status": "Success"
}
Response Body
Key | Values | Description |
---|---|---|
requestId | string | This field indicates the request ID. |
responseId | string | This field indicates the response ID. |
cid | string | This field indicates the campaign ID. |
status | string | This field indicates the campaign status. |
Response Code Structure
{
"requestId": "{{requestId}}",
"responseId": "{{responseId}}",
"cid": "{{cid}}",
"status": "Success"
}
{
'responseId': response_id,
'Error_Message': error_msg,
'status': 'Fail',
'Payload error': error_msg
}
Rate Limit
You can create 10000 requests per minute.
Sample Payloads Examples
Here are the sample payloads across different platforms (Android, iOS, and Web).
Example 1
"ANDROID": {
"message": "Message", // Message of the push notification
"title": "Title", // Title of the push notification
"channel_id": "ChannelId", // Channel id of push notification (Optional)
"richContent": [ //List of rich content items. Android push notifications have support Image, Coupon and Sound. One single notifcation can support all combinations of these three types of rich content.
{
"type": "image",
"value": "https://images.iimg.in/c"
},
{
"type": "coupon",
"value": "free" // when user click notifications, this code will be copied.
},
{
"type": "sound",
"value": "tring"
}
],
"defaultAction": { // Default action when user click on notifications.
"type": "richlanding", // Type of the default action
"value": "https://www.google.co.in/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8 ",
"kvPairs" :{ // additional key value pairs to be passed while sending notification.
"key1" : "value1",
"Key2" : "value2"
}
},
"additionalActions": [ // List of action buttons. Maximum 2 buttons are allowed.
{
"type": "call",// action type
"value": "12345678", // respective value
"name": "Call button", // action name, displayed on notification
"iconURL": "abc" // url for icon to be displayed
},
{
"type": "copy", // action type
"value": "12345678", // respective value
"name": "Copy button", // action name, displayed on notification
"iconURL": "abc" // icon url
}
],
"fallback": { // Complete replica of the android dict, in case a personalization is failed, this message content will be sent.
}
},
"IOS": {
"message": "Message", // message
"title": "Tittle", // title
"subtitle": "Subtitle", // subtitle
"contentAvailable": 1, //BadgeCount
"richContent": [ // rich content
{
"type": "sound",
"value": "custSound4.wav"
},
{
"type": "coupon",
"value": "free"
},
{
"type": "image",
"value": "xyz.jpg"
}
],
"additionalActions": [ (optional)// action buttons defined in the application; Just need to mention category here.
{
"category": "INVITE_CATEGORY"
}
],
"defaultAction": { (optional) // default action when user click on notification.
"type": "navigation",
"value": "",
"kvPairs" :{ // additional key value pairs to be passed while sending notification.
"key1" : "value1",
"Key2" : "value2"
}
},
"fallback": { // fall back payload in case there is personalization failure
"message": "fallback ios", // fallback message
"title": "title", // fallback title
"richContent": [ // fallback rich content
{
"type": "coupon",
"value": "iOS" //This value of coupon code will be copied when user click the notification
}
],
"additionalActions": [ // fallback action buttons
{
"category": "INVITE_CATEGORY"
}
]
}
},
"WEB": {
"message": "Message", // Message
"title": "Title", // title
"redirectURL": "https://www.google.com", // URL on which user should be redirected on click.
"iconURL":"https://app.moengage.com/v3/images/favicon.ico", // URL for the icon to be displayed, only https urls are supported
"imageURL": "https://cdn.dribbble.com/users/146881/screenshots/1180383/despicable_me_1x.jpg", // url for image to be displayes in message, only https urls are supported
"fallback":{ // replica of the complete dict in case there is personalization failure.
}
}
Example 2
This is a sample payload to target all users for each platform and also all platforms.
{
"appId": "XXXXXXXXXXXXXXXXXXXXXXXX",
"campaignName": "Test Push", // Name of the campaign.
"campaignTags": ["Transactional"],
"signature": "d7d28929ba474edf293b7c892efe22ec0e426ab1ba242b50c96f3126b9285385",
"requestType": "push", // Type of request (push)
"targetPlatform": [
"ANDROID"
],
"targetAudience": "All Users",
"payload": {
"ANDROID": { // Android Payload, detailed is described above
"message": "Android Message",
"title": "Android Message Title",
"Summary": "Android Summary",
"richContent": [
{
"type": "image",
"value": "https://images.iimg.in/c"
},
{
"type": "coupon",
"value": "free"
},
{
"type": "sound",
"value": "tring"
}
],
"defaultAction": {
"type": "richlanding",
"value": "https://www.google.co.in/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8 "
},
"additionalActions": [
{
"type": "call",
"value": "12345678",
"name": "Call button",
"iconURL": "abc"
},
{
"type": "copy",
"value": "12345678",
"name": "Copy button",
"iconURL": "abc"
}
]
}
},
"campaignDelivery": {
"type": "soon", //values can be - soon/later/periodic; if later/periodic, please provide respective values as well.
},
"conversionGoals": [
{
"name": "amount 1",
"eventName": "AddedTocart",
"attrs": {
"filter": "is between",
"name": "amount",
"value": "10,100",
"type": "numeric"
}
}
],
"advancedSettings": {
"ttl": {
"ANDROID": 12 // the ttl for both Android and iOS platforms are tracked in ANDROID field.
},
"ignoreFC": "false",
"sendAtHighPriority": "true",
"inboxExpiry": 360 //in hours
}
}
{
"appId": "XXXXXXXXXXXXXXXXXXXXXXXX",
"campaignName": "Test Push", // Name of the campaign.
"campaignTags": ["Promotional"],
"signature": "d7d28929ba474edf293b7c892efe22ec0e426ab1ba242b50c96f3126b9285385",
"requestType": "push", // Type of request (push/status)
"targetPlatform": [
"IOS"
],
"targetAudience": "All Users",
"payload": {
"IOS": {
"message": "iOS Message",
"title": "iOS Message Title",
"richContent": [
{
"type": "sound",
"value": "custSound4.wav"
}
],
"additionalActions": [
{
"category": "INVITE_CATEGORY"
}
]
}
},
"campaignDelivery": {
"type": "soon",//values can be - soon/later/periodic; if later/periodic, please provide respective values as well.
},
"conversionGoals": [
{
"name": "amount 1",
"eventName": "AddedTocart",
"attrs": {
"filter": "is between",
"name": "amount",
"value": "10,100",
"type": "numeric"
}
}
],
"advancedSettings": {
"ignoreFC": "false"
},
"inboxExpiry": 360 //in hours
}
{
"appId": "XXXXXXXXXXXXXXXXXXXXXXXX",
"campaignName": "Test Push",// Name of the campaign.
"signature": "d7d28929ba474edf293b7c892efe22ec0e426ab1ba242b50c96f3126b9285385",
"requestType": "push", // Type of request (push/status)
"targetPlatform": [
"WEB"
],
"targetAudience": "All Users",
"payload": {
"WEB": {
"message": "Web Message",
"title": "Web Message Title",
"redirectURL": "https://www.google.com",
"iconURL": "sbc.jpeg",
"imageURL": "https://cdn.dribbble.com/users/146881/screenshots/1180383/despicable_me_1x.jpg",
"fallback": {}
}
},
"campaignDelivery": {
"type": "soon",//values can be - soon/later/periodic; if later/periodic, please provide respective values as well.
},
"conversionGoals": [
{
"name": "amount 1",
"eventName": "AddedTocart",
"attrs": {
"filter": "is between",
"name": "amount",
"value": "10,100",
"type": "numeric"
}
}
],
"advancedSettings": {
"ttl": {
"WEB": 24
},
"ignoreFC": "false",
"sendAtHighPriority": "true"
}
}
{
"appId": "XXXXXXXXXXXXXXXXXXXXXXXX",
"campaignName": "Test Push",// Name of the campaign.
"signature": "d7d28929ba474edf293b7c892efe22ec0e426ab1ba242b50c96f3126b9285385",
"requestType": "push",// Type of request (push/status)
"targetPlatform": [
"ANDROID",
"IOS",
"WEB"
],
"targetAudience": "All Users",
"payload": {
"ANDROID": {
"message": "Android Message",
"title": "Android Message Title",
"Summary": "summary",
"richContent": [
{
"type": "image",
"value": "https://images.iimg.in/c"
},
{
"type": "coupon",
"value": "free"
},
{
"type": "sound",
"value": "tring"
}
],
"defaultAction": {
"type": "richlanding",
"value": "https://www.google.co.in/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8 "
},
"additionalActions": [
{
"type": "call",
"value": "12345678",
"name": "Call button",
"iconURL": "abc"
},
{
"type": "copy",
"value": "12345678",
"name": "Copy button",
"iconURL": "abc"
}
]
},
"IOS": {
"message": "iOS Message",
"title": "iOS Message Tittle",
"richContent": [
{
"type": "sound",
"value": "custSound4.wav"
}
],
"additionalActions": [
{
"category": "INVITE_CATEGORY"
}
]
},
"WEB": {
"message": "Web Message",
"title": "Web Message Title",
"redirectURL": "https://www.google.com",
"iconURL": "sbc.jpeg",
"imageURL": "https://cdn.dribbble.com/users/146881/screenshots/1180383/despicable_me_1x.jpg",
"fallback": {}
}
},
"campaignDelivery": {
"type": "soon",
},
"conversionGoals": [
{
"name": "amount 1",
"eventName": "AddedTocart",
"attrs": {
"filter": "is between",
"name": "amount",
"value": "10,100",
"type": "numeric"
}
}
],
"advancedSettings": {
"ttl": {
"ANDROID": 12, // the ttl for both Android and iOS platforms are tracked in ANDROID field.
"WEB": 24
},
"ignoreFC": "false",
"sendAtHighPriority": "true"
}
}
Example 3
This example shows different payloads to target different segments of users.
{
"appId": "XXXXXXXXXXXXXXXXXXXXXXXX",
"campaignName": "Test Push", // Reuse this campaign name for requests that should be clubbed in the same campaign.
"signature": "d7d28929ba474edf293b7c892efe22ec0e426ab1ba242b50c96f3126b9285385",
"requestType": "push", // Type of request (push)
"targetPlatform": [
"ANDROID"
],
"targetAudience": "User",
"targetUserAttributes":{
"attribute": "USER_ATTRIBUTE_USER_EMAIL",
"comparisonParameter": "is",
"attributeValue": "abc@example.com"
},
"payload": {
"ANDROID": { // Android Payload, detailed is described above
"message": "Android Message",
"title": "Android Message Title",
"Summary": "Android Summary",
"richContent": [
{
"type": "image",
"value": "https://images.iimg.in/c"
},
{
"type": "coupon",
"value": "free"
},
{
"type": "sound",
"value": "tring"
}
],
"defaultAction": {
"type": "richlanding",
"value": "https://www.google.co.in/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8 "
},
"additionalActions": [
{
"type": "call",
"value": "12345678",
"name": "Call button",
"iconURL": "abc"
},
{
"type": "copy",
"value": "12345678",
"name": "Copy button",
"iconURL": "abc"
}
]
}
},
"campaignDelivery": {
"type": "soon" //values can be - soon/later/periodic; if later/periodic, please provide respective values as well.
},
"conversionGoals": [
{
"name": "amount 1",
"eventName": "AddedTocart",
"attrs": {
"filter": "is between",
"name": "amount",
"value": "10,100",
"type": "numeric"
}
}
],
"advancedSettings": {
"ttl": {
"ANDROID": 12 // the ttl for both Android and iOS platforms are tracked in ANDROID field.
},
"ignoreFC": "false",
"sendAtHighPriority": "true",
"inboxExpiry": 360 //in hours
}
}
{
"appId": "XXXXXXXXXXXXXXXXXXXXXXXX",
"campaignName": ""Test Push",
"signature": "d7d28929ba474edf293b7c892efe22ec0e426ab1ba242b50c96f3126b9285385",
"requestType": "push",
"targetPlatform": [
"ANDROID",
"IOS",
"WEB"
],
"targetAudience": "Custom Segment",
"customSegmentName": "Android_TranV2",
"payload": {
"ANDROID": {
"message": "testing txn v2",
"title": "testing txn v2",
"Summary":"summary",
"richContent": [
{
"type": "image",
"value": "https://images.iimg.in/c"
},
{
"type": "coupon",
"value": "free"
},
{
"type": "sound",
"value": "tring"
}
],
"defaultAction": {
"type": "richlanding",
"value": "https://www.google.co.in/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8 "
},
"additionalActions": [
{
"type": "call",
"value": "12345678",
"name": "Call button",
"iconURL": "abc"
},
{
"type": "copy",
"value": "12345678",
"name": "Copy button",
"iconURL": "abc"
}
]
},
"IOS": {
"message": "7th",
"title": "Test Case custom segment5",
"richContent": [
{
"type": "sound",
"value": "custSound4.wav"
}
],
"additionalActions": [
{
"category": "INVITE_CATEGORY"
}
]
},
"WEB": {
"message": "Test Case WEB",
"title": "Test Case WEB",
"redirectURL": "https://www.google.com",
"iconURL": "sbc.jpeg",
"imageURL": "https://cdn.dribbble.com/users/146881/screenshots/1180383/despicable_me_1x.jpg",
"fallback": {}
}
},
"campaignDelivery": {
"type": "soon"
},
"conversionGoals": [
{
"name": "amount 1",
"eventName": "AddedTocart",
"attrs": {
"filter": "is between",
"name": "amount",
"value": "10,100",
"type": "numeric"
}
}
],
"advancedSettings": {
"ttl": {
"ANDROID": 12, // the ttl for both Android and iOS platforms are tracked in ANDROID field.
"WEB": 24
},
"ignoreFC": "false",
"sendAtHighPriority": "true",
"inboxExpiry": 360 //in hours
}
}
{
"appId": "XXXXXXXXXXXXXXXXXXXXXXXX",
"campaignName": "Test Push", // Name of the campaign.
"signature": "d7d28929ba474edf293b7c892efe22ec0e426ab1ba242b50c96f3126b9285385",
"requestType": "push", // Type of request (push)
"targetPlatform": [
"ANDROID"
],
"targetAudience": "User",
"targetUserAttributes": {
"attribute": "user",
"comparisonParameter": "is",
"attributeValue": "user",
"isCustom":true
},
"payload": {
"ANDROID": { // Android Payload, detailed is described above
"message": "Android Message",
"title": "Android Message Title",
"Summary": "Android Summary",
"richContent": [
{
"type": "image",
"value": "https://images.iimg.in/c"
},
{
"type": "coupon",
"value": "free"
},
{
"type": "sound",
"value": "tring"
}
],
"defaultAction": {
"type": "richlanding",
"value": "https://www.google.co.in/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8 "
},
"additionalActions": [
{
"type": "call",
"value": "12345678",
"name": "Call button",
"iconURL": "abc"
},
{
"type": "copy",
"value": "12345678",
"name": "Copy button",
"iconURL": "abc"
}
]
}
},
"campaignDelivery": {
"type": "soon" //values can be - soon/later/periodic; if later/periodic, please provide respective values as well.
},
"conversionGoals": [
{
"name": "amount 1",
"eventName": "AddedTocart",
"attrs": {
"filter": "is between",
"name": "amount",
"value": "10,100",
"type": "numeric"
}
}
],
"advancedSettings": {
"ttl": {
"ANDROID": 12 // the ttl for both Android and iOS platforms are tracked in ANDROID field.
},
"ignoreFC": "false",
"sendAtHighPriority": "true",
"inboxExpiry": 360 //in hours
}
}
{
"appId": "XXXXXXXXXXXXXXXXXXXXXXXX",
"campaignName": "Test Push",
"signature": "d7d28929ba474edf293b7c892efe22ec0e426ab1ba242b50c96f3126b9285385",
"requestType": "push",
"targetPlatform": [
"ANDROID",
"IOS",
"WEB"
],
"targetAudience": "All Users",
"payload": {
"ANDROID": {
"message": "gp 7th nov",
"title": "7th nov",
"richContent": [
{
"type": "image",
"value": "https://images.iimg.in/c"
},
{
"type": "coupon",
"value": "free"
},
{
"type": "sound",
"value": "tring"
}
],
"defaultAction": {
"type": "richlanding",
"value": "https://www.google.co.in/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8 "
},
"additionalActions": [
{
"type": "call",
"value": "12345678",
"name": "Call button",
"iconURL": "abc"
},
{
"type": "copy",
"value": "12345678",
"name": "Copy button",
"iconURL": "abc"
}
]
},
"IOS": {
"message": "7th",
"title": "Test Case custom segment5",
"richContent": [
{
"type": "sound",
"value": "custSound4.wav"
}
],
"additionalActions": [
{
"category": "INVITE_CATEGORY"
}
]
},
"WEB": {
"message": "Test Case WEB",
"title": "Test Case WEB",
"redirectURL": "https://www.google.com",
"iconURL": "sbc.jpeg",
"imageURL": "https://cdn.dribbble.com/users/146881/screenshots/1180383/despicable_me_1x.jpg",
"fallback": {}
}
},
"campaignDelivery": {
"type": "soon"
},
"conversionGoals": [
{
"name": "amount 1",
"eventName": "AddedTocart",
"attrs": {
"filter": "is between",
"name": "amount",
"value": "10,100",
"type": "numeric"
}
}
],
"advancedSettings": {
"ttl": {
"ANDROID": 12, // the ttl for both Android and iOS platforms are tracked in ANDROID field.
"WEB": 24
},
"ignoreFC": "false",
"sendAtHighPriority": "true",
"inboxExpiry": 360 //in hours
}
}
Example 4
This payload describes the sample for the push API response payload.
// sample success push respons payload
{
"status": "Success",// shows valid request and accepted for processing
"responseId": "cd13199a-0f70-4bf2-9c54-99879eefae76",
"requestId": "",
"cid": "581e08281069b855c03576d2"
}
// sample failure push response payload
{
"status": "Fail", // shows invalid request
"Error_Message": "Campaign Name not found", // reason of failure
"responseId": "5612064a-24fa-4e8c-9e8a-c1c4221fe0ea",
"requestId": "",
}
Postman Collection
We have made it easy for you to test the APIs. Click here to view it in Postman.