MoEngage Docs

Push APIs

Push APIs is used to:

  1. Create campaigns (targeting all users or a group of users) to send notifications.
  2. Target a single user using unique user attribute.
  3. Personalise payload for each user.

Push API helps in:

Personalised push message
Message can be personalised using user attributes tracked through MoEngage platform.
Multiple conversion Goals
Developers can now add more than 1 conversion goal to their campaigns.
Action buttons for Android/iOS apps
Developers can as well add interactive notification actions to their notifications
Support for the Web (Chrome) push
Developers can send Web push as well via this API
iOS 10 support for title, subtitle
Along with messages, you can send title and subtitle in notifications. Enable this service to add the title, subtitle column in the request body. For more details, contact the MoEngage support team.
Image support
In webpush, other than icon, the image link should be "https", "http" images are not supported.

Push API Endpoints

MoEngage supports multiple data centers with different dashboards and push API endpoints. When you sign up with MoEngage, you will be assigned a particular data center and the relevant dashboard is displayed. Use the push API endpoints associated with the data center.

For more information about your data center, contact [email protected]

You can find out which data center you are assigned to when you log in to the dashboard. The following table describes the dashboard URL and push API endpoint associated with the data center.

Two versions of the dashboard URL and data API endpoints are provided by MoEngage.

Data Centers and API Endpoints

Syntax

New version

POST https://api-01.moengage.com/v2/transaction/sendpush
POST https://api-02.moengage.com/v2/transaction/sendpush
POST https://api-03.moengage.com/v2/transaction/sendpush

Old version

POST https://pushapi.moengage.com/v2/transaction/sendpush
POST https://pushapi-eu.moengage.com/v2/transaction/sendpush
POST https://pushapi-serv3.moengage.com/v2/transaction/sendpush

👍

Support for Old and New Endpoints

Support for both old and new Push API endpoints will be available, but we recommend that you start using the new endpoints as soon as possible.

Request Headers

Request Headers

'Content-Type':'application/json'

Request Body

1.Parameters necessary for the API call should be passed as a JSON object string in the request body.
2.If the keys with in the parameter is listed as mandatory, then their corresponding values are also mandatory.

##Request Body Attributes

Key

Mandatory Field

Description

appId

Yes

APP ID provided by MoEngage to identify the specific app. You can find it under Settings -> Transactional Push Settings on MoEngage Dashboard. We strongly recommend you to test API integration on Test Environment. The App Id for TEST ACCOUNT is suffixed with _DEBUG.

campaignName

Yes

Used to check the campaign details/statistics on MoEngage dashboard. Campaign name should be unique for All Users & Custom Segment campaigns. For User Level API requests:

  • campaign name should be same if multiple requests belong to a single type of the campaign.
  • campaign names should be Unique if all the API requests belong to different campaign types.
    NOTE : API automatically creates campaign with given name. You need not to create campaign from dashboard to use the name.

signature

Yes

Signature is required to verify if the client is authorized to make the API call. It is generated from a hash of Campaign Name, App Id and API Secret. You can find API Id (or App Id) & API Secret in your MoEngage Dashboard under Settings->Transaction Push Settings

requestType

No

The value of this key is used to indicate the intention of API request.
Default value is push to create push campaigns.

targetAudience

Yes

Target segment for the campaign. It can have one of the following values

  • All Users - to target all users of your App/Website

  • Custom Segment : to target pre-created user segments. You will have to use MoEngage dashboard to create/manage custom segments. Please note that the custom segment name should exactly match to the name of target segment on MoEngage dashboard

customSegmentName

Mandatory if Target Audience value is Custom Segment else optional.

Name of the custom segment as saved or defined on the dashboard

  • User - target is just one individual user

targetUserAttributes

Mandatory if Target Audience value is User

In case the target audience is User, you can target the user via user properties/attributes. You have to send the following parameters to find the user
- attribute
- comparison parameter
- attribute value

Note:
For API Requests where target audience is a specific user, if campaign with the given name already exists, existing campaign data corresponding to the given campaign name will be used for sending notification.
Any edits in other parts of campaign data within the API request params will be ignored.
If any changes are required in the campaign data, please change the name of the campaign in API Request, so that a new campaign is created.

Note:
For targeting over 100 users via user attribute:
bulkUserRequest - “true”,
requestId - Mandatory, should be unique for each request.

targetPlatform

Yes

To choose the platform devices being targeted by your campaign. Push API allows you to target users on Android app, iOS app, Windows app and Web platforms. You can target one or more platforms. If you are sending Web (Chrome) push notifications through the API, you should choose Web as the platform.

payload

Yes

Enables push message and rich content (image, sound and so on) sent to your customers. Do the following:

  1. Configure messages separately to the target platforms you want to send.
  2. Include payload for at-least one platform in your API request.

Rich Content supported on different platforms are as follows.
ANDROID - coupon, image, sound
IOS - coupon, sound, image, audio, video ( image, video and audio are only supported after IOS-10)
WINDOWS - coupon
Note : image, video and audio can not be used together.

campaignDelivery

Yes

Helps decide when the campaign should be sent.
All notifications targeted to single user will be sent as soon as possible (ASAP).
Scheduling campaign for Later or Periodically is applied only for segmented or all users campaigns.

conversionGoals

No

List of conversion goals. Once set it can't be changed for a specific campaign.

For numeric attributes, allowed filter types are:
[ ‘is between’ , ‘is less than, ‘is greator than’, is equal to` ]

advancedSettings

No

Advanced settings for the push include settings like TTL ( time to live), ignoreFC, countFC and priority of the message.

TTL

No

If not delivered, Push Services(GCM/APNS/MPNS) will retry to send the message until the TTL (in hours) does not expire. Send ‘0’ if it is not applicable for you. After TTL has expired, push notification will not be shown to the user. Default value for TTL is 36 hours and is applicable only to Android push / Web push notifications.

ignoreFC

No

Values are "true" or "false".
"true" value - Bypasses Frequency capping set using dashboard and will send the notifications to everyone in the target segment.
"false" value - Applies the Frequency cap set on dashboard and will not send the notification once limit is reached.
If the key is not present, it will be treated as ignoreFC="False" . While testing your API, ensure that you set this flag as "true" else you might not receive few notifications.

countFC

No

Values are "true" or "false" only when ignoreFC value is set to true.
"true" value - Only push campaigns are counted in frequency cap count.
"false" value - Push campaigns are not counted in frequency cap count.

sendAtHighPriority

No

Values are "true" or "false" only for Android push / Web push notifications. Uses GCM/FCM flag to send time critical messages with high priority and drains user's device battery more than normal messages.

pushAmp+

No

Values are "true" or "false". Push For more information about Push Amp+, refer to Push Amp+ help documentation

preCacheSegment

Values are "true" or "false". Applicable for scheduled and periodic campaigns. If enabled, pre-caches the segmentation and campaign sending time will be improved. For caching, it is recommended to create the campaign at least 2 hours before the scheduled time.

campaignThrottleTime

No

Values are in integer (time in minutes). Push throttling allows you to control the rate of sending push notification. Value to be passed can be between 1 and 360 (minutes).

useJinjaPersonalization

No

Values are "true" or "false". A boolean value to indicate if Jinja personalization is applied on the message payloads. Recommended to use this personalization format.

ignoreMinimumDelay

No

Values are "true" or "false". A boolean value to indicate if Client level Minimum Delay setting to be applied for the campaign. Default value is true, if not passed in the API.

defaultAction

Yes for Android and Web.
Optional for iOS and Windows

Different deep-linking options for Android/iOS/Windows (app) platform. You can define the action when the user clicks on the notification through this.

additionalActions

No

Additional action buttons for Android. The buttons allowed for ANDROID are call, snooze, copy, share. Maximum of two additional action buttons can be used at a time.

Examples

Request Header

"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 "
}
"value" in the above example should not be blank.

Campaign Name

e.g. If you want to push updates to your users for Billing and Order Confirmation, all the push requests related to billing can have a same campaign name: “Billing Campaign” while all the push requests related to order delivery can have the campaign name as “Orders Campaign”. As a result, one would be able to see aggregated stats for all related (All Billing or All Order Confirmation) API requests under one campaign name.

Signature

Signature example as follows:

# Python2.x
from hashlib import sha256
app_id = "MAZW51234N1IMMSH5HKBHK_DEBUG" #(Please refer to required parameters section)
campaign_name = "TEST"
api_secret = "S3pVzjBF9use" # This is the sample key. Each app has a different secret key
signature_key = app_id+'|'+ campaign_name+'|'+ api_secret
signature = sha256(signature_key).hexdigest()

# Python3.x
from hashlib import sha256
app_id = "MAZW51234N1IMMSH5HKBHK_DEBUG" #(Please refer to required parameters section)
campaign_name = "TEST"
api_secret = "S3pVzjBF9use" # This is the sample key. Each app has a different secret key
signature_key = app_id+'|'+ campaign_name+'|'+ api_secret
signature = sha256(signature_key.encode('utf-8')).hexdigest()
Generated Signature: 
bc52a205a64d18d9978d9532a59f6302e2a5745bd1fda05929dd6f044a9fb7b3

targetAudience

User-based targeting is done based on fields as described in the example.
In the example, user email is used for user-based targeting.

// e.g. To target All Users
"targetAudience": "All Users",

// e.g. To target a custom segment with name: MySegment123
"targetAudience": "Custom Segment",
"customSegmentName": "MySegment123",

// e.g. To target an user with Email Id as [email protected], it will be
"targetAudience": "User",
"targetUserAttributes": 
{
    "attribute": "USER_ATTRIBUTE_USER_EMAIL",
    "comparisonParameter": "is",
    "attributeValue": "[email protected]"
},

Other fields used are:
for unique id use - USER_ATTRIBUTE_UNIQUE_ID
for email use - USER_ATTRIBUTE_USER_EMAIL
for mobile number use - USER_ATTRIBUTE_USER_MOBILE
for Google Advertising identifier - MOE_GAID
for iOS Identifier for advertising - ADVERTISING_IDENTIFIER
for device push token - PUSH_ID ( same key is used for android gcmId, iOS push token and windows channel uri)

For custom attributes, targeting is done on any custom attribute along with the available fields. Set the extra key, "isCustom" to true.
comparisonParameter supports only "is" and "in" query types.
The following example describes the custom attribute set to true.

"targetAudience": "User",
  "targetUserAttributes": {

   "attribute": "subscriber_id",
   "isCustom": true,
   "comparisonParameter": "is",
   "attributeValue": "123456"},

targetPlatform

//List of platforms to target
"targetPlatform":["ANDROID"],
//To target All platforms
"targetPlatform":["IOS","ANDROID","WINDOWS","WEB"],

##payload

"payload": {
    "ANDROID": { // payload specific to Android
    },
    "IOS": { // payload specific to iOS
    },
    "WINDOWS": { // payload specific to Windows
     },
     "WEB": { // payload specific to web.
    }
 }
"richContent": [
    {
      "type": "sound",
      "value": "custSound4.wav"
    },
    {
      "type": "coupon",
      "value": "free"
    },
    {
      "type": "image",
      "value": "xyz.jpg"
    },
    {
      "type": "image",
      "value": "xyz.gif"
    },
    {
      "type": "video",
      "value": "xyz.mp4"
    },
    {
      "type": "audio",
      "value": "xyz.mp3"
    }
  ]

campaignDelivery

// send campaign asap
"campaignDelivery": {
    "type": "soon"
  },
// send campaign later, only for segmented or all users campaigns.
"campaignDelivery": {
    "type": "later",
    "date": "11/07/2016",
    "time": "04:33 PM"
  },
// send periodic campaign, only for segmented and all users campaigns.
"campaignDelivery": {
    "type": "periodic",
    "endDate": "11/07/2016",
    "time": "04:55 PM",
    "repeatAfter": "1" // campaign will be recurring sent after every 1 day.
  },

conversionGoals

// single conversion goal 
"conversionGoals": [
    {
      "name": "amount 1", // name of the goal to be displayed in dashboard.
      "eventName": "AddedTocart", // event on which conversion should be tracked.
      "attrs": { // attributes of event.
        "filter": "is between",
        "name": "amount",
        "value": "10,100", //range to be passed as comma seperated values 
        "type": "numeric"
      }
    }
  ]
// multiple conversion goal
"conversionGoals": [
    {
      "name": "amount 1",
      "eventName": "AddedTocart",
      "attrs": {
        "filter": "is between",
        "name": "amount",
        "value": "10,100",
        "type": "numeric"
      }
    },
    {
      "name": "product 1",
      "eventName": "geet16oct",
      "attrs": {
        "filter": "starts with",
        "name": "category",
        "value": "electronics",
        "type": "string"
      }
    }
  ]

advanceSettings

// sample advanced settings

"advancedSettings": {
    "ttl": { // if not passed, all platforms will have ttl of 36 hours.
      "ANDROID": 12,
      "WEB": 24
    },
    "ignoreFC": "true",
    "countFC": "true",
    "sendAtHighPriority": "true",
    "pushAmp+"       : "true",
    "preCacheSegment": "true",
    "campaignThrottleTime" : 5,
    "useJinjaPersonalization" : "true" ,
    "ignoreMinimumDelay"      : "false"
    
  }

defaultAction

"defaultAction": { // Default action when user click on notifications. 
  "type": "navigation",
  "value": "", // Value of the screen name on which re-direction should happen.
  "kvPairs" :{ // additional key value pairs to be passed while sending notification.
                       "key1" : "value1",
                        "Key2" : "value2"
             } //optional 
},

"defaultAction": { // Default action when user click on notifications. 
  "type": "richlanding",
  "value": "" ,// Rich landing url, which is a web (http/https) url.
  "kvPairs" :{ // additional key value pairs to be passed while sending notification.
                       "key1" : "value1",
                        "Key2" : "value2"
             } //optional 
},

"defaultAction": { // Default action when user click on notifications. 
  "type": "deeplinking",
  "value": "", // Deep-linking URI
  "kvPairs" :{ // additional key value pairs to be passed while sending notification.
                       "key1" : "value1",
                        "Key2" : "value2"
             } //optional 
},

additionalActions

"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
        },
        {
          "type": "snooze", // action type
          "value": 5, // in hours i.e. snooze after 5 hours
          "name": "snooze button", // action name, displayed on notification
          "iconURL": "abc" // icon url
        },
        {
          "type": "share", // action type
          "value": "xyz", // text to share
          "name": "share button", // action name, displayed on notification
          "iconURL": "abc" // icon url
        }
      ]

Here are the sample payloads across different platforms (Android, iOS, Windows & Web)

"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, Coupen and Sound. One single notifcations can support all combinations of these three types of rich content.
        {
          "type": "image",
          "value": "http://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
      "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 coupen 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.
  }
}
"WINDOWS": {
  "message": "Message", // message
  "title": "Message Title", // title
  "richContent": [ // rich content
    {
      "type": "coupon",
      "value": "12345" // This value of the coupen will be copied when user click the notification.
    }
  ],
  "defaultAction ": { // default action
    "type": "richlanding",
    "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"
     }
  }
}

Sample API payload ( complete) to target different platforms.

{
  "appId": "MAZW5N1IMMSH5H67C3T9KBHK",
  "campaignName": "Test Push", // Name of the campaign.
  "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": "http://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
    },
    "ignoreFC": "false",
    "sendAtHighPriority": "true"
  }
}
{
  "appId": "MAZW5N1IMMSH5H67C3T9KBHB",
  "campaignName": "Test Push", // Name of the campaign.
  "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"
  }
}
{
  "appId": "MAZW5N1IMMSH5H67C3T9KBHB",
  "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": "http://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": "MAZW5N1IMMSH5H67C3T9KBHB",
  "campaignName": "Test Push",// Name of the campaign.
  "signature": "d7d28929ba474edf293b7c892efe22ec0e426ab1ba242b50c96f3126b9285385",
  "requestType": "push",// Type of request (push/status)
  "targetPlatform": [
    "WINDOWS"
  ],
  "targetAudience": "All Users",
  "payload": {
    "WINDOWS": {
      "message": "Windows Message",
      "title": "Windows Message Title",
      "richContent": [
        {
          "type": "coupon",
          "value": "1234"
        }
      ],
      "defaultAction ": {
        "type": "richlanding",
        "value": "https://www.google.co.in/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8"
      }
    }
  },
  "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",
    "sendAtHighPriority": "true"
  }
}
{
  "appId": "MAZW5N1IMMSH5H67C3T9KBHB",
  "campaignName": "Test Push",// Name of the campaign.
  "signature": "d7d28929ba474edf293b7c892efe22ec0e426ab1ba242b50c96f3126b9285385",
  "requestType": "push",// Type of request (push/status)
  "targetPlatform": [
    "ANDROID",
    "IOS",
    "WINDOWS",
    "WEB"
  ],
  "targetAudience": "All Users",
  "payload": {
    "ANDROID": {
      "message": "Android Message",
      "title": "Android Message Title",
      "Summary": "summary",
      "richContent": [
        {
          "type": "image",
          "value": "http://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"
        }
      ]
    },
    "WINDOWS": {
      "message": "Windows Message",
      "title": "Windows Message Title",
      "richContent": [
        {
          "type": "coupon",
          "value": "1234"
        }
      ],
      "defaultAction ": {
        "type": "richlanding",
        "value": "https://www.google.co.in/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8"
      }
    },
    "WEB": {
      "message": "Web Message",
      "title": "Web Message Title",
      "redirectURL": "http://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,
      "WEB": 24
    },
    "ignoreFC": "false",
    "sendAtHighPriority": "true"
  }
}

Sample payload (complete) for different targeting options

{
  "appId": "MAZW5N1IMMSH5H67C3T9KBHK",
  "campaignName": "Test Push",
  "signature": "d7d28929ba474edf293b7c892efe22ec0e426ab1ba242b50c96f3126b9285385",
  "requestType": "push",
  "targetPlatform": [
    "ANDROID",
    "IOS",
    "WINDOWS",
    "WEB"
  ],
  "targetAudience": "User",
  "targetUserAttributes": {
    "attribute": "MOE_GAID",
    "comparisonParameter": "is",
    "attributeValue": "094506ef-acaa-4970-89c3-b22da572cdc2"
  },
  "payload": {
    "ANDROID": {
      "message": "gp 7th nov",
      "title": "7th nov",
      "richContent": [
        {
          "type": "image",
          "value": "http://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"
        }
      ]
    },
    "WINDOWS": {
      "message": "7th [[Email]]",
      "title": "Test Case segment5",
      "richContent": [
        {
          "type": "coupon",
          "value": "ANDROIDCOUPEN"
        }
      ],
      "defaultAction ": {
        "type": "richlanding",
        "value": "https://www.google.co.in/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8"
      }
    },
    "WEB": {
      "message": "Test Case WEB",
      "title": "Test Case WEB",
      "redirectURL": "http://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,
      "WEB": 24
    },
    "ignoreFC": "false",
    "sendAtHighPriority": "true"
  }
}
{
  "appId": "MAZW5N1IMMSH5H67C3T9KBHB",
  "campaignName": "Test Case Android new112345",
  "signature": "d7d28929ba474edf293b7c892efe22ec0e426ab1ba242b50c96f3126b9285385",
  "requestType": "push",
  "targetPlatform": [
    "ANDROID",
    "IOS",
    "WINDOWS",
    "WEB"
  ],
  "targetAudience": "Custom Segment",
  "customSegmentName": "Android_TranV2",
  "payload": {
    "ANDROID": {
      "message": "testing txn v2",
      "title": "testing txn v2",
      "Summary":"summary",
      "richContent": [
        {
          "type": "image",
          "value": "http://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"
        }
      ]
    },
    "WINDOWS": {
      "message": "7th [[Email]]",
      "title": "Test Case segment5",
      "richContent": [
        {
          "type": "coupon",
          "value": "ANDROIDCOUPEN"
        }
      ],
      "defaultAction ": {
        "type": "richlanding",
        "value": "https://www.google.co.in/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8"
      }
    },
    "WEB": {
      "message": "Test Case WEB",
      "title": "Test Case WEB",
      "redirectURL": "http://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,
      "WEB": 24
    },
    "ignoreFC": "false",
    "sendAtHighPriority": "true"
  }
}
{
  "appId": "MAZW5N1IMMSH5H67C3T9KBHB",
  "campaignName": "Test Push",
  "signature": "d7d28929ba474edf293b7c892efe22ec0e426ab1ba242b50c96f3126b9285385",
  "requestType": "push",
  "targetPlatform": [
    "ANDROID",
    "IOS",
    "WINDOWS",
    "WEB"
  ],
  "targetAudience": "All Users",
  "payload": {
    "ANDROID": {
      "message": "gp 7th nov",
      "title": "7th nov",
      "richContent": [
        {
          "type": "image",
          "value": "http://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"
        }
      ]
    },
    "WINDOWS": {
      "message": "7th [[Email]]",
      "title": "Test Case segment5",
      "richContent": [
        {
          "type": "coupon",
          "value": "ANDROIDCOUPEN"
        }
      ],
      "defaultAction ": {
        "type": "richlanding",
        "value": "https://www.google.co.in/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8"
      }
    },
    "WEB": {
      "message": "Test Case WEB",
      "title": "Test Case WEB",
      "redirectURL": "http://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,
      "WEB": 24
    },
    "ignoreFC": "false",
    "sendAtHighPriority": "true"
  }
}

Sample 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": "", 
}

Reponse Codes

Response Code

Description

200

Success responses have http status code 200.

Success and Failure Responses codes returned was HTTP status code 200 in the previous version of Push API.

400

Failure responses have HTTP status code 400

Payload error (Deprecated)

Available in the response body.

Updated 15 days ago

Push APIs


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.