APN Campaign API
Netcore’s App Push Notification Campaign API offers an easy, non-UI way to create app push notification campaigns. This document provides details about the API signature. Refer to this document to retrieve your API key.
Here’s what you can do with the App Push Campaign API:
- Call this API to create a broadcast app push notification campaign.
- Define campaign parameters in your requests, including campaign details, audience, push notification templates, and scheduling.
- Choose to save the campaign as a draft or schedule it directly for execution.
- View, test, and manually modify draft campaigns on the Netcore panel if needed.
API details
Region | API endpoint | Method | Content-Type |
---|---|---|---|
US | https://api.netcoresmartech.com/v3/campaign/create | POST | application/json |
IND | https://apiin.netcoresmartech.com/v3/campaign/create | POST | application/json |
EU | https://goapiv3.eu-north-1.eu.netcoresmartech.com/v3/campaign/create | POST | 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,
"inline_template": {
"title": "first",
"description": "your apn description",
"landing_page": "landing page type - allowed values are home, URL, and deeplink page",
"url": "https://your.url.com/landingpage"
},
"enable_frequency_capping" : false,
"time_to_live_value": "2022-12-05T17:32:43Z",
"campaign_cutoff_time" : "",
"campaign_schedule_date" : "2022-12-14T12:04:43Z"
"app_inbox": "app_inbox_enabled":1,"app_inbox_category":"TestJR","app_inbox_ttl":"2023-09-22T14:18:11Z"
}
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 |
app_inbox | This is required when you want to send your app push notification to the app inbox as well. | Array of strings | |
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 | Conditional - either only Tempalte ID or only Inline_template should be present. Both being absent or both being present will throw error |
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 | 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_date | 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 |
inline_template. Title | Inline template section is when you'd like to pass the contents directly in the request payload rather than using the template ID in the API call. Title is for your APN title | Object type - Paramater data type is as follows title : String Note: Only UTF-8 characters are allowed. (New line is not supported) | Conditional - either only Tempalte ID or only Inline_template should be present. Both being absent or both being present will throw error Inside inline_template section - atleast one of title or description should be present - both being absent will throw error |
inline_template.description | Inline template section is when you'd like to pass the contents directly in the request payload rather than using the template ID in the API call. description - For the APN description | Object type - Paramater data type is as follows Description: String Note: Only UTF-8 characters are allowed | Conditional - either only Tempalte ID or only Inline_template should be present. Both being absent or both being present will throw error Inside inline_template section - atleast one of title or description should be present - both being absent will throw error |
inline_template.landing_page | Inline template section is when you'd like to pass the contents directly in the request payload rather than using the template ID in the API call. Landing Page : Type of landing page of the APN - values could be home, deeplink, or URL | Object type - Paramater data type is as follows landing_page : String | Conditional - either only Tempalte ID or only Inline_template should be present. Both being absent or both being present will throw error Inside inline_template section - landing_page is a mandatory field |
inline_template.url | Inline template section is when you'd like to pass the contents directly in the request payload rather than using the template ID in the API call. url: The value of the landing page | Object type - Paramater data type is as follows url: String | Conditional - either only Tempalte ID or only Inline_template should be present. Both being absent or both being present will throw error If the the value of 'landing_page' is home - then this parameter has to be left blank |
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 |
652 | Panel frequency capping is off, but a campaign with the panel flag enabled is being sent. Please adjust the frequency capping settings |
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 - _ & @ |
683 | Landing page cannot be empty - Allowed values are url, home or deeplink |
684 | Landing page can be either home, url, or deeplink only |
685 | At least one of Title or Description is mandatory (under inline content section) |
686 | When title length exceeds 100 characters |
687 | Description length exceeds 1000 characters |
688 | 'url' value is required for landing page of type "deeplink" |
689 | 'url' vlaue should be empty for landing page of type "home" |
690 | 'url' vlaue should be empty for landing page of type "URL" |
691 | Deeplink URL length exceeds 1000 characters |
692 | Invalid URL format. Include "http://" or "https://" at the beginning of the URL. |
693 | URL length exceeds 1000 characters |
694 | Title should not contain new line character |
695 | Please provide either a template_id or inline_template details, but not both |
Updated 3 months ago