MoEngage Docs

Search results for "{{ search.query }}"

No results found for "{{search.query}}". 
View All Results

Push API (V2)

This version of Push API is the extension of our V1 API. You can view the link for the legacy docs.

It can be used to serve following purposes:

1 - Creating 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.

We have also added several new features, as mentioned below, which were not present in V1.

1 - Personalised push message - Message can be personalised using user attributes tracked through MoEngage platform
2 - Multiple conversion Goals - Developers can now add more than 1 conversion goal to their campaigns
3 - Action buttons for Android/iOS apps - Developers can as well add interactive notification actions to their notifications
4 - Support for the Web (Chrome) push - Developers can send Web push as well via this API
5 - Status API - Once a push notification is sent to a user, it's status can be checked later using the Status API.

Following document mentions how to use the API and construct the payloads using it.

API endpoints

API call is a POST method, and the end URL is mentioned below.

https://pushapi.moengage.com/v2/transaction/sendpush

Payload

Request Headers

'Content-Type':'application/json'

Request Body parameters

Parameters necessary for the API call should be passed as a JSON object string in the request body.

appId (Mandatory) : 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 (Mandatory) : 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;

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.

NOTE : API automatically creates campaign with given name. You need not to create campaign from dashboard to use the name.

signature (Mandatory): 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 as per the snapshot below.

AppId = "MAZW51234N1IMMSH5HKBHB_DEBUG" #(Please refer to required parameters section)
CampaignName = "TEST"
ApiSecret = "S3pVzjBF9use" # This is the sample key. Each app has a different secret key
Signature = SHA256(AppId+'|'+ CampaignName+'|'+ ApiSecret).hexdigest()
Generated Signature: 
d22374f405e7d8da03a7772582aedc4010be5e47d5669ad6596803a6bc277ff0

requestType (Optional, default is push) : The value of this key is used to indicate the intention of API request. Value can be:

  • push - to create push campaigns
  • status - to know the status of API request

targetAudience (Mandatory): 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 custome segment name should exactly match to the name of target segment on MoEngage dashboard
  • User - target is just one individual user.

customSegmentName ( Mandatory if Target Audience used above is Custom Segment else optional) : Name of the custom segment as saved/defined on the dashboard

targetUserAttributes ( Mandatory if Target Audience used above is User ): In case the target audience is User, send the following parameters to find the user

  • attribute
  • comparison parameter
  • attribute value
Attribute : It is the name of the unique attribute. We present you these options:
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)

Comparison Parameter : 'is' // currently we support only this as Comparison Parameter

Attribute Value : value of the attribute
// 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 abc@exmaple.com, it will be
"targetAudience": "User",
"targetUserAttributes": 
{
    "attribute": "USER_ATTRIBUTE_USER_EMAIL",
    "comparisonParameter": "is",
    "attributeValue": "abc@example.com"
},

targetPlatform (Mandatory): 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.

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

payload (Mandatory) - Refers to the push message and rich content (image, sound etc.) to be sent to your customers. One has to configure messages separately for the target platforms you want to send to. You need to include payload for at-least one platform in your API request.

Rich Content supported by 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.

"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 (mandatory): used to decide when the campaign should be sent.
All notifications targeted to single user will be sent ASAP.
Scheduling campaign for Later/Periodically will be applied only for segmented or all users campaigns.

// 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 (optional): List of conversion goals. Once set it can't be changed for a specific campaign.

// 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",
        "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"
      }
    }
  ]

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

TTL (optional) - 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 (optional) - "true" or "false".
"true" value - It will bypass Frequency capping set using dashboard and will send the notifications to everyone in the target segment.
"false" value - It will apply 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.

ignoreAndCountFC(optional) - "true" or "false", needed in case of ignoreFC is set to true.
"true" value - in this case, push will be counted in frequency cap count.
"false" value - in this case, push won't be counted in frequency cap count.
This key will not be considered if ignoreFC is set to False

sendAtHighPriority (optional) - "true/false". This is valid 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.

// sample advanced settings

"advancedSettings": {
    "ttl": { // if not passed, all platforms will have ttl of 36 hours.
      "ANDROID": 12,
      "WEB": 24
    },
    "ignoreFC": "true",
  	"ignoreAndCountFC": "true",
    "sendAtHighPriority": "true"
  }

Different deep-linking options for Android/iOS/Windows (app) platform

defaultAction(mandatory for Android & Web, optional for iOS and Windows) - You can define the action when the user clicks on the notification through this.

"defaultAction": { // Default action when user click on notifications. 
  "type": "navigation",
  "value": "" // Value of the screen name on which re-direction should happen.
},

"defaultAction": { // Default action when user click on notifications. 
  "type": "richlanding",
  "value": "" // Rich landing url, which is a web (http/https) url.
},

"defaultAction": { // Default action when user click on notifications. 
  "type": "deeplinking",
  "value": "" // Deep-linking URI
},

Additional Action Buttons

additionalActions (optional) - Additional action buttons allowed for ANDROID are call, snooze, copy, share. Maximum 2 additional action buttons can be used at a time.

"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 
      "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
      "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":"http://app.moengage.com/v3/images/favicon.ico", // URL for the icon to be displayed
  "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": "MAZW5N1IMMSH5H67C3T9KBHB",
  "campaignName": "Test Push", // Name of the campaign.
  "signature": "d7d28929ba474edf293b7c892efe22ec0e426ab1ba242b50c96f3126b9285385",
  "requestType": "push", // Type of request (push/status)
  "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",
      "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",
      "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": "MAZW5N1IMMSH5H67C3T9KBHB",
  "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",
      "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",
      "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",
      "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": ""
}

Status API Payload

Note: Status API can only be used to check status for requests having 'targetAudience' as 'User'.

request payload

{
 "appId": "MAZW5N1IMMSH5H67C3T9KBHB",
 "responseId": "a0427ef7-e432-440e-a0e3-fc0df1714de0", // requestId can be passed as well to get the status of the notification.
 "requestType": "status"
}

response payload

[ // list of notifications with their status w.r.t. requestId or responseId.
  {
    "status": "sent",
    "message": {
      "ANDROID": [ // list of dictionaries, with each token - it's status after hitting respective push ( gcm/apns/wpns) APIs.
        {
 "fIs38lOLEPw:APA91bG97q1T0i3sOrAgl9wlbLVqeVVLiH_yt2NEAQe0aVxk3SheDDO2OVblkFSNnm_yoYP6g7X4dLivqJsaAHqtmI-jcz1Ov-BciHCRN1X5mnapC7YWs6lif0ChQNgCQHuEtgYZV5rZ": {
            "Status": "Success",
            "GCM Message Id": "0:1478781846998321%ddc586c0ac6eb4ab"
          }
        }
      ]
    },
    "requestTime": "11/10/2016 12:44 PM",
    "responseId": "248a8665-9cd1-45c3-82d2-3490ef990446",
    "requestId": ""
  }
]

Push API (V2)