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

API Body Payload Details:

Key nameDescriptionData typeIs required?
apikeyThis is the API key . You can get API key from your Netcore panel by going to Profile > User profile section.StringYes
clientidThis is the client id of your Netcore panel.IntegerYes
channelThis is the communication channel name. For app push notifications - use “apn” as channel name in lower case.StringYes
campaign_idHere 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
IntegerYes only if you want to update existing draft campaign.
campaign_nameThis 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.
StringYes
campaign_statusThis 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
StringYes
app_idsHere 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 stringsYes
tagsThese 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 - _ & @
ArrayOptional
conversion_revenue_detailsThese are set of conditions for tracking conversion from the given APN campaignArrayOptional
revenue_event_nameThis is the event name (activity name) which you want to add as conversion event. E.g. transaction successStringOptional
revenue_event_paramThis is the specific parameter from specified revenue event that refers to the revenue value.E.g. “Price”StringOptional
"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",
ArrayOptional
"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_idThis is the ID of the APN template created on the Netcore panel. E.g. 322IntegerConditional - either only Tempalte ID or only Inline_template should be present. Both being absent or both being present will throw error
enable_frequency_cappingThis 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
BooleanYes
time_to_live_valuethis 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.
DateEither time_to_live_value or campaign_cutoff_time is mandatory
campaign_cutoff_timeCampaign_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
DateEither time_to_live_value or campaign_cutoff_time is mandatory
campaign_schedule_dateThis 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.
DateOptional for campaign_status = draft

Needs to be blank for campaign_status = send now

Mandatory for campaign_status = send later
inline_template.titleInline 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.descriptionInline 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_pageInline 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.urlInline 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 CodeDescription
200Campaign created successfully with campaign id 123
204Request body is empty
400Bad request
401Unauthorized request
500Internal server error. Please try again
611Please provide valid app id
612Please provide valid channel name
613Please provide valid campaign name. Allowed characters are 0-9 a-z A-Z - _ & @. Maximum character limit is 100
614Please provide valid campaign status. Possible values are draft, send now, send later
621Invalid list ID. Please ensure that provided list ID exists on your Netcore panel
622Invalid segment ID. Please ensure that provided segment ID exists on your Netcore panel
623Invalid suppression list ID. Please ensure that provided suppression list ID exists on your Netcore panel
624Invalid suppression segment ID. Please ensure that provided suppression segment ID exists on your Netcore panel
625Invalid UDT ID. Please ensure that provided UDT ID exists on your Netcore panel
626Please provide audience criteria. Select either all users or specific segment, list or UDT.
627UDT feature is not enabled. Please enable UDT feature for your Netcore panel.
631Invalid template id. Please ensure that provided template ID exists on your Netcore panel
641Please provide valid schedule date. Please ensure it is greater than current date and time.
642Please provide valid TTL (Time to live). Please ensure it is greater than current date and time and with in next 28 days.
643Please provide valid cut-off time. Please ensure it is greater than current date and time.
644Both TTL and Cut-off time values can't be set for a campaign. Please remove one of them
645Since best effort is not enabled for the account, cutoff time is not accepted. Please configure best effort first
651Draft campaign id provided is not valid. Please ensure provided campaign id exists on your Netcore panel and is in "Draft" state
652Panel frequency capping is off, but a campaign with the panel flag enabled is being sent. Please adjust the frequency capping settings
661Invalid revenue parameter for conversion event
662Invalid conversion event specified
663The revenue parameter specified for the conversion event is incorrect
664For the mentioned conversion event, we couldn't find any payload mentioned under conversion rule block
665For the mentioned conversion event, we couldn't find the specified payload parameter mentioned under conversion rule block
666Value specified under conversion rule block cannot be blank
667Data type for the specified payload parameter is incorrect
668Condition for the specified payload parameter is incorrect
669Conversion revenue without conversion event is not allowed
670Conversion rules without conversion event is not allowed
680Schedule date should be empty if campaign status is send now
681Please provide valid tags. You can add upto 5 tags with 15 characters and allowed characters are 0-9 a-z A-Z - _ & @
683Landing page cannot be empty - Allowed values are url, home or deeplink
684Landing page can be either home, url, or deeplink only
685At least one of Title or Description is mandatory (under inline content section)
686When title length exceeds 100 characters
687Description 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"
691Deeplink URL length exceeds 1000 characters
692Invalid URL format. Include "http://" or "https://" at the beginning of the URL.
693URL length exceeds 1000 characters
694Title should not contain new line character
695Please provide either a template_id or inline_template details, but not both