App Push Notification Trigger API

CEE's App Push Notification Trigger API provides a faster, non-UI dependent way to trigger notifications to your app users. This guide will help you how to get started with the implementation of this API.

Quick summary of what you can do with this API :

  • Call this API when you want to trigger the app push notification to your app users.
  • Define push notification parameters directly in the requests such as primary key (user identifier), push token, app id, notification title, subtitle, message, your own internal unique identifier for the message, and so on.
  • On successfully calling this API, you will get an HTTP 200 response.
  • Get real-time reports of delivered, failed data to your webhook endpoint.
  • Get downloadable CSV of day-wise summary and user-level detailed log level report from the CEE dashboard.

📘

Important

This feature is currently works with Netcore SDK v2 series. Reach out to your account manager or drop an email to [email protected] to enable this feature.

You must integrate CEE App SDK in your app if you want to send push notifications via API.

API Types

URL Schema: pntrigger.netcore.co.in/pn-trigger-trans

EndpointRequest TypeWhat it Does?
pntrigger.netcore.co.in/pn-trigger-transPOSTSend the notification request to the server

Header:

KeyValueDescription
Authorizationx-api-keyYou can get this API_KEY from CEE panel.

Go to Assets > API Triggers and then copy the API Key.
Content-Typeapplication/json

Parameters:

ParameterDescriptionData TypeRequired
primary_keyThis is the user identifier and has to the same identifier which is set on CEE panel as Primary KeyStringYes
tokenThis is the FCM/APNS token of the userStringYes
titleTitle of push notificationStringYes
subtitleSubtitle field for the push notificationStringYes
messageMessage body for the push notificationString
click_urlDeeplink/URL target which should be used for redirection after user clicks on the push notificationString
time_to_liveTime to live value for FCM & APNSIntegerYes,
pntypeThis should have value "Simple" for simple text push notificationsString

Pass hardcoded value as Simple
Yes
tagYou can pass tags to categorize your message for analysis purposeStringNo
appIDCEE App IDs can be passed as an array. You can get these IDs from CEE Assets section.ArrayNo
client_unique_identifierYou can pass your own internal unique identifier for the push notification request. This unique identifier will be shared back in the reportingStringNo

Request Body:

  1. Below is a sample request body if you want to send a notification to a specific primary key of the user. In this case, CEE will identify the push tokens of this user for specified app IDs and send the notification to the recent 5 tokens.
{
  "primary_key": "user_identifier",
  "appid": [
    "6045ce4d7e31abe06aa34a2299a7e4fc","5045ce4d7e31abe06aa34a2299a7e4fc"
  ],
  "client_unique_identifier": "UID-111",
  "title": "This is a title",
  "subtitle": "This is a Subtitle.",
  "message": "This is a message ",
  "tag": "EarlyBirdDiscount",
  "time_to_live": 57777,
  "click_url": "https://myurl.com",
  "pn_type": "Simple"
}’
  1. Below is a sample request body if you want to send a notification directly to push tokens.
    Response:
{
 "token": [ "eYz1RE6xSd-DRil6gFxnVf:APA91bHESu1mYH6SVXD6FG5a_3zIxSHfpo4pIdW6vKMn8xBdyJr1MSLdiMu_iWKLMZIwqsFJ0kxQRInEcF792P-pTCejfResETJTFulMrA7akDAkVfRMhjEBh5x51IUs14w8VYKXz1hr],
 "title": "This is a title",
  "subtitle": "This is a Subtitle",
  "click_url": "http://placeimg.com/640/48",
  "time_to_live": 161219,
  "pntype": "Simple",
  "tag": "EarlyBirdDiscount",
  "client_unique_identifier": "UID-111",
  "message": "This is a message",
  "appID": [
    "c15582394701f98576910342106660de"  ]
}'
{
    "request_id": "387ae3c0-1044-456e-9c8a-848c28478f8a" 
}

Error Handling:
1: Incorrect API Key
Response: Forbidden
Status: 403 Forbidden

2: Token or Primary Key Missing
Response:'primary_key' OR 'token', are missing, Please send Mandatory Parameters
Status: 400 Bad Request

3: Message or Tittle key Missing
Response:'message' OR 'title', are missing, Please send Mandatory Parameters
Status: 400 Bad Request

4: Click_url Key Missing
Response : 'click_url', are missing, Please send Mandatory Parameters
Status : 400 Bad Request

5: Incorrect Json Data
Response: Json Parsing Failed
Status : 400 Bad Request

6: Limit Exceeded
Response: Limit Exceeded
Status : 429 Too Many Requests