Trigger Push Notifications API
Send personalized app notifications instantly with the Trigger API.
This API allows you to trigger notifications for your app users faster, non-UI-dependently. It also allows you to engage users by delivering personalized messages straight to their devices based on specific events or actions.
API Capabilities Overview
- Use this API to send 1:1 push notifications to your app users
- The most suitable use cases are transactional communication, such as order updates and transaction-related updates.
- Define push notification parameters directly in the requests, such as the primary key (user identifier), push token, app ID, notification title, subtitle, and message.
- Get real-time reports of delivered, clicked, and failed events on your webhook endpoint.
- This API currently supports only simple text push notifications.
Note
The following features are not supported: Rich media notifications, Push amplification, App inbox, Attribute or event payload-based personalization & bulk messaging capability.
If you have any further questions, contact [email protected]. Refer to this document to retrieve your API key.
HTTP Method
This API uses the POST
method to trigger notifications for your app users.
API Endpoint
The Trigger Push Notifications API is available across multiple regions; below are the base URLs for different regions:
Request Headers
Authentication details are required to access the API. Ensure you include the necessary tokens or credentials in your request headers.
Header Name | Type | Description | Example | Required? |
---|---|---|---|---|
api-key | String | API key for authentication | 41a1de35948f915f64907ced9eed4f00 | Yes |
Content-Type | String | JSON format for your request payload. | application/json | Yes |
Request Body
All necessary parameters should be passed in the request body in JSON format.
Body Parameter | Data Type | Description | Required? |
---|---|---|---|
api-key | string | Add the API key provided to you by Netcore in the request header. | Yes |
data | object | Add all API details within the data object. | Yes |
triggers | array of objects | Configure push notifications within the triggers array. Only one trigger is allowed in this API version. | Yes |
tags | array of strings | Add tags to categorize messages. Tags will appear in CSV and webhook reports. Each tag can be up to 75 characters, with a maximum of 15 tags. | No |
channel | string | Specify the communication channel. For example, apn. | Yes |
channel_config | object | Include channel-specific configurations like app_ids and ttl in this object. | Yes |
app_ids | array of strings | Provide the app IDs for targeted apps. You can get app ids from your Netcore panel. If left blank, notifications will be sent to all apps for the user. | No |
ttl | integer | Set the time-to-live for the notification in seconds. The default is 2419200 (28 days). Acceptable range: 0 to 2419200. | No |
content | object | Include notification details like template_type , landing_page_type , title , and description . | Yes |
template_type | string | Use Simple for basic text push notifications. | Yes |
landing_page_type | string | Use either home, deep link, or URL. | Yes |
landing_page_url | string | Provide redirection deep link or URL here. | No |
title | string | Provide the title of the notification. This field is required if the description is not included. | Yes |
description | string | Provide the body of the notification. This field is required if the title is not included. | Yes |
os | array of objects | Specify the target OS platforms for the push notification. | Yes |
os_name | string | Name of the OS to be targeted. For example, android or ios. | Yes |
audience_details | object | Provide user targeting details such as contact_type , contact_attribute , and attribute_value . | Yes |
contact_type | string | Use identified for known users. | Yes |
contact_attribute | string | Specify the user identifier type. For identified users, use identity. | Yes |
attribute_value | array of strings | Provide the value for the specified contact_attribute . For example, a unique user ID. | Yes |
notify_callback | object | Include webhook configurations and reporting parameters. Ensure that the url field contains a valid URL format, including the scheme, for example, http:// or https://. | No |
callback | array of objects | Specify callback webhook details, including webhook_id and body_params . | No |
webhook_id | string | Get the webhook ID from the Netcore panel for your integration. Only must require webhook_id and body_params . | Yes |
body_params | object | Pass custom key-value pairs. These values will appear in webhook reports and can include unique identifiers. Both keys and values must be strings. | No |
Example Request Body
{
"data": {
"triggers": [
{
"tags": [
"Test"
],
"channel": "apn",
"channel_config": {
"app_ids": [
"124281ef157aa412d44e13b84cd409ad"
],
"ttl": 86400
},
"content": {
"template_type": "Simple",
"landing_page_type": "home",
"landing_page_url": "https://www.google.com",
"title": "Demo Title",
"description": "Demo Message body description",
"os": [
{
"os_name": "android",
"subtitle": "Sample subtitle text"
},
{
"os_name": "ios",
"subtitle": "Sample subtitle text"
}
]
},
"audience_details": {
"contact_type": "identified",
"contact_attribute": "identity",
"attribute_value": [
"[email protected]"
]
}
}
]
},
"notify_callback": {
"callback": [
{
"webhook_id": 26,
"body_params": {
"CustomKey1": "Custom value1"
}
}
]
}
}
Example API Response
{
"request_id": "a7add3e4-2206-49f6-927e-3dfd917b906a",
"code": 200,
"status": "success",
"description": "Your request was accepted successfully. It may take a few minutes to process your request."
}
{
"request_id" : "506611fa-1519-4624-94d2-5b59623de608",
"code" : 400,
"status" : "failed",
"description" : "Validation Failure.",
"errors" : [
{
"field" : "data.triggers[0].ttl",
"message" : "Value must be integer."
}
]
}
Error Codes
Error Code | Description | Suggested Actions |
---|---|---|
200 | Successful response. The app push notification has been sent. | |
400 | Invalid request parameters. |
|
500 | An error occurred on the server side. | |
600 | Campaign creation failed. Missing or invalid request. |
Webhook Response
When your push notification API request is successful, the system will send updates to your specified URL (callback) to inform you about the status of the notifications. There are three types of updates: Delivered, Clicked & Failed.
Delivered
This means the notification was delivered to the device.
{
"your_panel_name": [
{
"webhook_name": "Trigger PN",
"msgid": "0",
"channel": "trigger apn",
"event_params": {
"foreignkey": "[email protected]"
},
"custom_params": {
"nc_request_id": "01944b1b-126f-7114-91e4-793a951775d7",
"nc_delivery_time": "2025-01-09 18:17:32.997",
"trid": "85711-0-367-0-250109181733-CPT",
"status": "delivered",
"reason": "delivered",
"nc_sent_time": "2025-01-09 18:17:33.027",
"tags": [
"Test"
],
"Message Name": "Trigger API Message 123 ",
"nc_request_time": "2025-01-09 18:17:32.980",
"nc_app_id": "d613445e731349ede71fdca5de54d641a",
"token": "ctu4454546543234z:APA91bE9RERdR-kN6ywu3YWrUBkweYQ0LoDCQk45vSWTqvk-Z9MUx-0qSrIB1ADiemslVgB9KC63-i6g-JlPGeIw5RIOC_Mu2Ay0dVC0hX0C_la9lYP3LtE"
},
"journey_name": null
}
]
}
Clicked
This means the user has clicked on the received notification.
{
"your_panel_name": [
{
"webhook_name": "Trigger PN",
"msgid": "0",
"channel": "trigger apn",
"event_params": {
"foreignkey": "[email protected]"
},
"custom_params": {
"nc_request_id": "01944b1c-29a1-789e-a6d0-f5c817010ec8",
"nc_delivery_time": "2025-01-09 18:18:51.881",
"trid": "85711-0-367-0-250109181844-CPT",
"status": "click",
"reason": "click",
"nc_sent_time": "2025-01-09 18:18:44.542",
"tags": [
"Test"
],
"Message Name": "Trigger API Message 123",
"nc_request_time": "2025-01-09 18:18:44.454",
"nc_app_id": "d613445e731349ede71fdca5de54d641a",
"token": "ctu4454546543234z:APA91bE9RERdR-kN6ywu3YWrUBkweYQ0LoDCQk45vSWTqvk-Z9MUx-0qSrIB1ADiemslVgB9KC63-i6g-JlPGeIw5RIOC_Mu2Ay0dVC0hX0C_la9lYP3LtE"
},
"journey_name": null
}
]
}
Failed
This means when a notification fails to deliver for reasons such as token not found, invalid tokens, uninstalled app, or duplicate notifications.
{
"your_panel_name": [
{
"webhook_name": "Trigger PN",
"msgid": "0",
"channel": "trigger apn",
"event_params": {
"foreignkey": "[email protected]"
},
"custom_params": {
"nc_request_id": "01944b13-c8d5-74c6-8968-d0a9144f17fd",
"trid": "85711-0-370-0-250110002017-CPT",
"status": "failed",
"reason": "404 :: NOT_FOUND :: Requested entity was not found.",
"nc_sent_time": "2025-01-09 18:09:35.507",
"tags": [
"Test"
],
"Message Name": "Trigger API Message 123",
"nc_request_time": "2025-01-09 18:09:35.416",
"nc_app_id": "d613445e731349ede71fdca5de54d641a",
"token": "ctu4454546543234z:APA91bE9RERdR-kN6ywu3YWrUBkweYQ0LoDCQk45vSWTqvk-Z9MUx-0qSrIB1ADiemslVgB9KC63-i6g-JlPGeIw5RIOC_Mu2Ay0dVC0hX0C_la9lYP3LtE"
},
"journey_name": null
}
]
}
Webhook Body Parameters
Body Parameter | Data Type | Description | Example |
---|---|---|---|
webhook_name | String | Static webhook name generated by Netcore. | "3920529" |
event_params | JSON Object | Delivery event-related metadata. | {"foreignkey": "3920529"} |
foreignkey | String | Primary key for identifying users. | "3920592925_FEDID" |
custom_params | JSON Object | Trigger-specific custom parameters. | {"key": "value"} |
nc_request_id | String | Request acknowledgment ID (fixed length). | "a7add3e4-2206-49f6-927e-3dfd917b906a" |
nc_request_time | String | Date and time when the API request was received (IST). | "2025-01-02 15:23:45.678" |
nc_sent_time | String | Submission timestamp to Apple/Android gateway. | "2020-04-06 12:43:45.807" |
nc_delivery_time | String | Delivery timestamp received from the gateway. | "2025-01-02 15:23:45.988" |
trid | String | Transaction ID generated at Netcore. | "785340-0-248966-0-210406220855-CPT" |
status | String | Delivery status of the notification. | "delivered", "failed" |
reason | String | Remarks or reasons for the delivery status. | "Duplicate request received" |
token | String | APN device identifier. | "ezZzhHM3SbCJpz0WAZ83-T:APA91bEdkl1KXEMT-1ZzY" |
msg_id | String | Message ID sent as a custom parameter. | "21483361" |
mobile_no | String | Mobile number as a custom parameter. | "919623899862" |
num_retries | String | Number of retries as a custom parameter. | "1" |
vendor_name | String | Vendor name in the request. | "NETCORE" |
vendor_cd | String | Vendor code as a custom parameter. | "NETCORE_PN" |
channel_name | String | Channel name in the API request. | "NETCORE_TRPN" |
deptid | String | Department ID as a custom parameter. | "BT4" |
appid | String | App ID for the notification. | "TCHALRT" |
deliverychannel | String | Delivery channel in the request. | "PN" |
Updated 7 days ago