This API creates and sends a push notification campaign. You can use this API to create campaigns (targeting all users or a group of users) to send notifications, target a single user using a unique user attribute, and personalize payload for each user.
The complete configuration for the push campaign.
This is the Workspace ID of your MoEngage account that must be passed with the request. You can find it in the MoEngage dashboard at Settings > Account > APIs > Workspace ID (earlier app id). MoEngage recommends that you test API integration in the Test Environment. The App ID for TEST ACCOUNT is suffixed with _DEBUG.
This field denotes the campaign name. The campaign name should be unique for All Users and Custom Segment campaigns. Note:
5This field denotes the signature that is required to verify whether the client is authorized to make the API call. For more information, refer to Generate Authentication Signature.
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.
ANDROID, IOS, WEB This field denotes the target segment for the campaign. Supported values are:
All Users, Custom Segment, User This field helps decide when the campaign should be sent.
ASAP
// send campaign asap
"campaignDelivery": {
"type": "soon"
}Schedule Later
"campaignDelivery": {
"type": "later",
"date": "11/07/2016",
"time": "04:33 PM"
}Recurring Campaigns
"campaignDelivery": {
"type": "periodic",
"endDate": "11/07/2016",
"time": "04:55 PM",
"timezone": "Asia/Calcutta",
"repeatAfter": "1" // campaign will be recurring sent after every 1 day.
}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,
“campaignTags“ : [“Transactional“, “Accounts“]The value of this key is used to indicate the intention of an API request. The default value is push.
Required if targetAudience is 'Custom Segment'.
This object contains the target user attribute details. Note:
This object contains the conversion goals details. This field denotes the event attribute filters. It contains the following elements:
Single Conversion Goal
"conversionGoals": [
{
"name": "Added To Cart",
"eventName": "AddedTocart",
"attrs": {
"name": "product_sku",
"filter": "is",
"value": "10089712",
"type": "string"
}
}
]Multiple Conversion Goals
"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
{
"name": "Added To Cart",
"eventName": "AddedTocart"
}With String Event Attribute Filter
With "is" operator:
{
"name": "Added To Cart",
"eventName": "AddedTocart",
"attrs": {
"name": "product_sku",
"filter": "is",
"value": "10089712",
"type": "string"
}
}With "is not" operator:
{
"name": "Added To Cart",
"eventName": "AddedTocart",
"attrs": {
"name": "product_sku",
"filter": "is not",
"value": "10089712",
"type": "string"
}
}With "contains" operator:
{
"name": "Added To Cart",
"eventName": "AddedTocart",
"attrs": {
"name": "product_sku",
"filter": "contains",
"value": "10089712",
"type": "string"
}
}With "does not contain" operator:
{
"name": "Added To Cart",
"eventName": "AddedTocart",
"attrs": {
"name": "product_sku",
"filter": "does not contain",
"value": "10089712",
"type": "string"
}
}With "starts with" operator:
{
"name": "Added To Cart",
"eventName": "AddedTocart",
"attrs": {
"name": "product_sku",
"filter": "starts with",
"value": "10089712",
"type": "string"
}
}With "does not start with" operator:
{
"name": "Added To Cart",
"eventName": "AddedTocart",
"attrs": {
"name": "product_sku",
"filter": "does not start with",
"value": "10089712",
"type": "string"
}
}With "ends with" operator:
{
"name": "Added To Cart",
"eventName": "AddedTocart",
"attrs": {
"name": "product_sku",
"filter": "ends with",
"value": "10089712",
"type": "string"
}
}With "does not end with" operator:
{
"name": "Added To Cart",
"eventName": "AddedTocart",
"attrs": {
"name": "product_sku",
"filter": "does not end with",
"value": "10089712",
"type": "string"
}
}With "in the following" operator:
{
"name": "Added To Cart",
"eventName": "AddedTocart",
"attrs": {
"name": "product_sku",
"filter": "in the following",
"value": ["10089711", "10089712", "10089713"],
"type": "string"
}
}With "not in the following" operator:
{
"name": "Added To Cart",
"eventName": "AddedTocart",
"attrs": {
"name": "product_sku",
"filter": "not in the following",
"value": ["10089711", "10089712", "10089713"],
"type": "string"
}
}With "exists" operator:
{
"name": "Added To Cart",
"eventName": "AddedTocart",
"attrs": {
"name": "product_sku",
"filter": "exists",
"type": "string"
}
}With "does not exist" operator:
{
"name": "Added To Cart",
"eventName": "AddedTocart",
"attrs": {
"name": "product_sku",
"filter": "does not exist",
"type": "string"
}
}With Numeric/Double Event Attribute Filter
With "is equal to" operator:
{
"name": "Added To Cart",
"eventName": "AddedTocart",
"attrs": {
"name": "product_price",
"filter": "is equal to",
"value": 999,
"type": "numeric"
}
}With "is not equal to" operator:
{
"name": "Added To Cart",
"eventName": "AddedTocart",
"attrs": {
"name": "product_price",
"filter": "is not equal to",
"value": 999,
"type": "numeric"
}
}With "is between" operator:
{
"name": "Added To Cart",
"eventName": "AddedTocart",
"attrs": {
"name": "product_price",
"filter": "is between",
"value": "899,999",
"type": "numeric"
}
}With "is not between" operator:
{
"name": "Added To Cart",
"eventName": "AddedTocart",
"attrs": {
"name": "product_price",
"filter": "is not between",
"value": "899,999",
"type": "numeric"
}
}With "is greater than" operator:
{
"name": "Added To Cart",
"eventName": "AddedTocart",
"attrs": {
"name": "product_price",
"filter": "is greater than",
"value": 999,
"type": "numeric"
}
}With "is less than" operator:
{
"name": "Added To Cart",
"eventName": "AddedTocart",
"attrs": {
"name": "product_price",
"filter": "is less than",
"value": 999,
"type": "numeric"
}
}With "exists" operator:
{
"name": "Added To Cart",
"eventName": "AddedTocart",
"attrs": {
"name": "product_price",
"filter": "exists",
"type": "numeric"
}
}With "does not exist" operator:
{
"name": "Added To Cart",
"eventName": "AddedTocart",
"attrs": {
"name": "product_price",
"filter": "does not exist",
"type": "numeric"
}
}5This object contains information about advanced settings. For more information, refer to Advanced Settings.
Request received. The status in the response body indicates whether it was successfully processed or failed. Possible failures include: