App Push Notification Campaign API
Netcore’s App Push Notification Campaign API will be an easy non-UI dependent way to create app push notification campaigns. This document will help you with the details of the API signature that we are planning.
Quick summary of what you can do with this App push campaign API :
- You can call this API when you want to create a broadcast app push notification campaign.
- Define campaign parameters directly in the requests such as campaign details, audience details, push notification template details, scheduling conditions.
- You get an option to save such a campaign as draft or schedule it directly for execution as well.
- Such draft campaigns can be viewed on the Netcore panel, tested and modified manually if needed.
API details:
API endpoint -
US : https://api.netcoresmartech.com/v3/campaign/create
IND: https://apiin.netcoresmartech.com/v3/campaign/create
EU : https://goapiv3.eu-north-1.eu.netcoresmartech.com/v3/campaign/create
Method -
POST
Content-Type -
application/json
Sample Request for the Body
{
"apikey" : "xxxxxxxxxxxx",
"clientid" : 10223,
"channel" : "apn",
"campaign_id": 123
"campaign_name" : "Discount offer campaign",
"campaign_status" : "send now",
"app_ids" : ["2913736a33c6531c790d1eb89170ac41","34e068d040fab64d4bd71548ba4a1fca"],
"tags" : ["offer", "discount"],
"conversion_revenue_details" : {
"revenue_event_name": "Add To Cart",
"revenue_event_param": "product.price",
"conversion_rules": [
{
"cond": "gt",
"payload": "product.prid",
"datatype": "int",
"value": "2000"
}
]
},
"contact_details" : {
"is_all_user_campaign" : true,
"list_ids" : [],
"segment_ids" : [],
"udt_id" : 12,
"suppression_list_ids" : [],
"suppression_segment_ids" : []
},
"template_id" : 2,
"enable_frequency_capping" : false,
"time_to_live_value": "2022-12-05T17:32:43Z",
"campaign_cutoff_time" : "",
"campaign_schedule_date" : "2022-12-14T12:04:43Z"
}
API Body Payload Details:
Key name | Description | Data type | Is required? |
---|---|---|---|
apikey | This is the API key . You can get API key from your Netcore panel by going to Profile > User profile section. | String | Yes |
clientid | This is the client id of your Netcore panel. | Integer | Yes |
channel | This is the communication channel name. For app push notifications - use “apn” as channel name in lower case. | String | Yes |
campaign_id | Here you can specify campaign id if you want to update existing draft campaign. Please ensure provided campaign id exists on your Netcore panel and is in "draft" state | Integer | Yes only if you want to update existing draft campaign. |
campaign_name | This is the name of the campaign. E.g. Special discount campaign. Allowed characters are 0-9 a-z A-Z - _ & @. Maximum character limit is 100. | String | Yes |
campaign_status | This defines the status of the campaign after successful API call. Possible values are two: “draft” or “send now” or "send later" “draft” value will keep the campaign in draft status. “send now” value will schedule the campaign immediately. "send later" value will schedule the campaign as per the specified schedule date & time | String | Yes |
app_ids | Here you can specify app ids to which APN campaign needs to be sent. You can also share more than one app id here. | Array of strings | Yes |
tags | These are tags added for the APN campaign. E.g. “Offer” . You can add upto 5 tags with 15 characters and allowed characters are 0-9 a-z A-Z - _ & @ | Array | Optional |
conversion_revenue_details | These are set of conditions for tracking conversion from the given APN campaign | Array | Optional |
revenue_event_name | This is the event name (activity name) which you want to add as conversion event. E.g. transaction success | String | Optional |
revenue_event_param | This is the specific parameter from specified revenue event that refers to the revenue value.E.g. “Price” | String | Optional |
"conversion_rules": [ { "cond": "gt", "payload": "product.prid", "datatype": "int", "value": "2000" } ] | This is array of one or more conversion rule where you can set conditions based on key-operator-value. You can add upto 5 rules here. payload key refers to the payload parameter of the above revenue event. datatype refers to the datatype of this payload of event. In value key, you can provide respective value In cond key, you can specify operator for the conversion rule. For integer/float, you can use below operators : "eq": "Equal to", "ne": "Not equal to", "gt": "Greater than", "lt": "Less than", "bw": "Between", "oo": "One of", For string, you can use below operators: "eq": "Equal to", "ne": "Not equal to", "oo": "One of", "co": "Contains", "bew": "Begins with", | Array | Optional |
"contact_details" : { "is_all_user_campaign" : true, "list_ids" : [], "segment_ids" : [], "udt_id" : 12, "suppression_list_ids" : [], "suppression_segment_ids" : [] }, | This section specifies the target audience condition. Is_all_user_campaign - refers whether this is all user campaign or not. list_ids, segment_ids take array of ids if this is not an all user campaign. udt_id requires id of the UDT. this is to be used when you want to target campaign to User data table suppression_list_ids , suppression_segment_ids are ids of the list/segment which you want to suppress for this campaign | is_all_user_campaing = boolean list_ids, segment_ids,suppression_list_ids , suppression_segment_ids accept array of numbers udt_id accepts number | Yes |
template_id | This is the ID of the APN template created on the Netcore panel. E.g. 322 | Integer | Yes |
enable_frequency_capping | This key defines whether you want to enable frequency capping for this particular APN campaign or not. Use true to enable frequency capping. Use false to keep frequency capping disabled | Boolean | Yes |
time_to_live_value | this value is required that denotes the specific date and time. E.g. "2022-10-29T08:32:43Z" Please ensure it is greater than current date and time and with in next 28 days. | Date | Either time_to_live_value or campaign_cutoff_time is mandatory |
campaign_cutoff_time | his campaign_cutoff_time value is required. Notifications are not submitted to FCM gateway after this cut-off time. In such cases, TTL is sent as 0 seconds by default. Please ensure it is greater than current date and time. E.g. "2022-10-29T08:32:43Z | Date | Either time_to_live_value or campaign_cutoff_time is mandatory |
campaign_schedule_time | This is the campaign schedule date. If campaign_status = “draft”, this will simply populate the schedule date and time for the campaign. If campaign_status = “send now”, this value needs to be blank as campaign will be scheduled immediately If campaign_status = “send later”, this value will be mandatory and campaign will be executed at this specified date and time. | Date | Optional for campaign_status = draft Needs to be blank for campaign_status = send now Mandatory for campaign_status = send later |
API Response code and description:
Response Code | Description |
---|---|
200 | Campaign created successfully with campaign id 123 |
204 | Request body is empty |
400 | Bad request |
401 | Unauthorized request |
500 | Internal server error. Please try again |
611 | Please provide valid app id |
612 | Please provide valid channel name |
613 | Please provide valid campaign name. Allowed characters are 0-9 a-z A-Z - _ & @. Maximum character limit is 100 |
614 | Please provide valid campaign status. Possible values are draft, send now, send later |
621 | Invalid list ID. Please ensure that provided list ID exists on your Netcore panel |
622 | Invalid segment ID. Please ensure that provided segment ID exists on your Netcore panel |
623 | Invalid suppression list ID. Please ensure that provided suppression list ID exists on your Netcore panel |
624 | Invalid suppression segment ID. Please ensure that provided suppression segment ID exists on your Netcore panel |
625 | Invalid UDT ID. Please ensure that provided UDT ID exists on your Netcore panel |
626 | Please provide audience criteria. Select either all users or specific segment, list or UDT. |
627 | UDT feature is not enabled. Please enable UDT feature for your Netcore panel. |
631 | Invalid template id. Please ensure that provided template ID exists on your Netcore panel |
641 | Please provide valid schedule date. Please ensure it is greater than current date and time. |
642 | Please provide valid TTL (Time to live). Please ensure it is greater than current date and time and with in next 28 days. |
643 | Please provide valid cut-off time. Please ensure it is greater than current date and time. |
644 | Both TTL and Cut-off time values can't be set for a campaign. Please remove one of them |
645 | Since best effort is not enabled for the account, cutoff time is not accepted. Please configure best effort first |
651 | Draft campaign id provided is not valid. Please ensure provided campaign id exists on your Netcore panel and is in "Draft" state |
661 | Invalid revenue parameter for conversion event |
662 | Invalid conversion event specified |
663 | The revenue parameter specified for the conversion event is incorrect |
664 | For the mentioned conversion event, we couldn't find any payload mentioned under conversion rule block |
665 | For the mentioned conversion event, we couldn't find the specified payload parameter mentioned under conversion rule block |
666 | Value specified under conversion rule block cannot be blank |
667 | Data type for the specified payload parameter is incorrect |
668 | Condition for the specified payload parameter is incorrect |
669 | Conversion revenue without conversion event is not allowed |
670 | Conversion rules without conversion event is not allowed |
680 | Schedule date should be empty if campaign status is send now |
681 | Please provide valid tags. You can add upto 5 tags with 15 characters and allowed characters are 0-9 a-z A-Z - _ & @ |
Updated 12 months ago