View Push Broadcasts
This endpoint lists all notifications associated with the site that have a sent
status. The response is in JSON format.
GET
https://api.pushengage.com/apiv1/notifications
Request Parameters
Parameter Name | Type | Required | Description |
---|---|---|---|
status | String | No | Define the notification status, which can be sent , scheduled , or draft . Use sent to retrieve notifications that have been sent, scheduled to retrieve notifications that are scheduled, and draft to retrieve draft notifications. If this parameter is not provided, all notifications will be retrieved. |
notification_id | String | No | Represents the unique ID of the notification, generated upon its creation. |
limit | Integer | No | Specifies the maximum number of notifications to display in the results. The minimum value is 1. |
offset | Integer | No | Specifies the starting index for displaying notifications in the results. The minimum value is 0. |
start_date | Date | No | Specifies the start date to retrieve the sent notifications. Must be in the format YYYY-MM-DD. |
end_date | Date | No | Specifies the end date to retrieve sent notifications. The range considers notifications sent from the provided start_date up to and including this end_date. Must be in the format YYYY-MM-DD. |
Response Object
Property Name | Type | Required | Description |
---|---|---|---|
notifications | Notification[] | Yes | Represents the notifications object. Further details can be found in the notifications object section. |
success | Boolean | Yes | Indicates whether the push response was successful. Possible values are true or false . |
count | Integer | Yes | Represents the total number of notifications returned in the response. |
message | String | No | Provided in case of a failure, it specifies the reason for the failure. |
Notification Object
Property Name | Type | Description |
---|---|---|
notification_id | Integer | Unique identifier for the notification. |
notification_title | String | Title of the notification. |
notification_message | String | Message content of the notification. |
notification_url | String | Landing URL associated with the notification. |
notification_image | String | Image displayed within the notification. |
notification_big_image | String | Large image associated with the notification. |
created_time | String | Timestamp indicating when the notification was created. |
sent_time | String | Timestamp indicating when the notification was sent. |
notification_expiry | Integer | The expiry duration of the notification is in seconds. |
notification_criteria | String | List of criteria used to identify the user for the notification. |
Statistics | Statistics | Represents the statistics object. Further details are in the Statistics Object section. |
notification_source | String | Source from which the notification originates. |
multi_element_title1 | String | Title for the first interactive button in the notification. |
multi_element_url1 | String | URL associated with the first interactive button. |
multi_element_image1 | String | Image associated with the first interactive button. |
multi_element_title2 | String | Title for the second interactive button in the notification. |
multi_element_url2 | String | URL associated with the second interactive button. |
multi_element_image2 | String | Image associated with the second interactive button. |
Statistics Object
Property Name | Type | Description |
---|---|---|
sent_count | Integer | Number of subscribers who successfully received the notification. |
failed_count | Integer | Number of subscribers for whom the notification sending failed. |
read_count | Integer | Number of subscribers who read the notification. |
click_count | Integer | Number of subscribers who clicked on the notification. |
Example of All Notifications
Request
- cURL
- PHP
curl -X GET -H "api_key: <your_pushengage_api_key>" "https://api.pushengage.com/apiv1/notifications"
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.pushengage.com/apiv1/notifications",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_POSTFIELDS => "",
CURLOPT_HTTPHEADER => array(
"api_key: <your_pushengage_api_key>",
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
?>
Response
- 200 OK
- 401 Unauthorized
{
"success": true,
"count": 2,
"notifications": [
{
"notification_id": "123456",
"notification_title": "this is title of notification",
"notification_message": "this is message of notification",
"notification_url": "http://www.example.com",
"notification_image": "your_image_path/image.png",
"notification_big_image": "your_big_image_path/big_image.png",
"created_time": "<notification_creation_time>",
"sent_time": "<notification_sent_time>",
"notification_expiry": "<sec>",
"notification_criteria":"[{"filter_type":"include_countries","countries":["XXXX"]},{"filter_type":"include_states","states":["XXXX"]},{"filter_type":"include_cities","cities":["XXXX"]},{"filter_type":"include_device_types","devices":["XXXX"]},{"filter_type":"include_browsers","browsers":["XXXX"]}]",
"statistics": {
"sent_count": "145",
"failed_count": "0",
"read_count": "145",
"click_count": "145"
}
"notification_source": "XXXX"
},
{
"notification_id": "123457",
"notification_title": "this is title of notification1",
"notification_message": "this is message of notification1",
"notification_url": "http://www.example.com",
"notification_image": "your_image_path/image.jpg",
"notification_big_image": "your_big_image_path/big_image.png",
"created_time": "<notification_creation_time>",
"sent_time": "<notification_sent_time>",
"notification_expiry": "<sec>",
"notification_criteria":"[{"filter_type":"include_countries","countries":["XXXX"]},{"filter_type":"include_states","states":["XXXX"]},{"filter_type":"include_cities","cities":["XXXX"]},{"filter_type":"include_device_types","devices":["XXXX"]},{"filter_type":"include_browsers","browsers":["XXXX"]}]",
"statistics": {
"sent_count": "195",
"failed_count": "0",
"read_count": "195",
"click_count": "195"
}
"notification_source": "XXXX"
}
],
}
{
"success": false,
"message": "API KEY Invalid"
}
Example of Sent Notifications
Retrieving sent notifications requires setting the query parameter status
to sent
.
Request
- cURL
- PHP
curl -X GET -H "api_key: <your_pushengage_api_key>" "https://api.pushengage.com/apiv1/notifications?status=sent"
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.pushengage.com/apiv1/notifications?status=sent",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_POSTFIELDS => "",
CURLOPT_HTTPHEADER => array(
"api_key: <your_pushengage_api_key>",
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
?>
Response
- 200 OK
- 401 Unauthorized
{
"success": true,
"count": 2,
"notifications": [
{
"notification_id": "123456",
"notification_title": "this is title of notification",
"notification_message": "this is message of notification",
"notification_url": "http://www.example.com",
"notification_image": "your_image_path/image.png",
"notification_big_image": "your_big_image_path/big_image.png",
"created_time": "<notification_creation_time>",
"sent_time": "<notification_sent_time>",
"notification_expiry": "<sec>",
"notification_criteria":"[{"filter_type":"include_countries","countries":["XXXX"]},{"filter_type":"include_states","states":["XXXX"]},{"filter_type":"include_cities","cities":["XXXX"]},{"filter_type":"include_device_types","devices":["XXXX"]},{"filter_type":"include_browsers","browsers":["XXXX"]}]",
"statistics": {
"sent_count": "145",
"failed_count": "0",
"read_count": "145",
"click_count": "145"
}
"notification_source": "XXXX"
},
{
"notification_id": "123457",
"notification_title": "this is title of notification1",
"notification_message": "this is message of notification1",
"notification_url": "http://www.example.com",
"notification_image": "your_image_path/image.jpg",
"notification_big_image": "your_big_image_path/big_image.png",
"created_time": "<notification_creation_time>",
"sent_time": "<notification_sent_time>",
"notification_expiry": "<sec>",
"notification_criteria":"[{"filter_type":"include_countries","countries":["XXXX"]},{"filter_type":"include_states","states":["XXXX"]},{"filter_type":"include_cities","cities":["XXXX"]},{"filter_type":"include_device_types","devices":["XXXX"]},{"filter_type":"include_browsers","browsers":["XXXX"]}]",
"statistics": {
"sent_count": "195",
"failed_count": "0",
"read_count": "195",
"click_count": "195"
}
"notification_source": "XXXX"
}
],
}
{
"success": false,
"message": "API KEY Invalid"
}
Example of Scheduled Push Broadcast
Retrieving scheduled notifications requires setting the query parameter status
to scheduled
.
Request
- cURL
- PHP
curl -X GET -H "api_key: <your_pushengage_api_key>;" "https://api.pushengage.com/apiv1/notifications?status=scheduled"
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.pushengage.com/apiv1/notifications?status=scheduled",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_POSTFIELDS => "",
CURLOPT_HTTPHEADER => array(
"api_key: <your_pushengage_api_key>;",
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
?>
Response
- 200 OK
- 401 Unauthorized
{
"success": true,
"count": 2,
"notifications": [
{
"notification_id": "1234567",
"notification_title": "this is title of notification",
"notification_message": "this is message of notification",
"notification_url": "http://www.example.com",
"notification_image": "your_image_path/image.png",
"notification_big_image": "your_big_image_path/big_image.png",
"created_time": "<notification_creation_time>",
"valid_from": "<notification_scheduled_time>",
"notification_expiry": "<sec>",
"notification_criteria":"[{"filter_type":"include_countries","countries":["XXXX"]},{"filter_type":"include_states","states":["XXXX"]},{"filter_type":"include_cities","cities":["XXXX"]},{"filter_type":"include_device_types","devices":["XXXX"]},{"filter_type":"include_browsers","browsers":["XXXX"]}]",
"notification_source": "XXXX"
},
{
"notification_id": "1234568",
"notification_title": "this is title of notification1",
"notification_message": "this is message of notification1",
"notification_url": "http://www.example.com",
"notification_image": "your_image_path/image.jpg",
"notification_big_image": "your_big_image_path/big_image.png",
"created_time": "<notification_creation_time>",
"valid_from": "<notification_scheduled_time>",
"notification_expiry": "<sec>",
"notification_criteria":"[{"filter_type":"include_countries","countries":["XXXX"]},{"filter_type":"include_states","states":["XXXX"]},{"filter_type":"include_cities","cities":["XXXX"]},{"filter_type":"include_device_types","devices":["XXXX"]},{"filter_type":"include_browsers","browsers":["XXXX"]}]",
"notification_source": "XXXX"
}
]
}
{
"success": false,
"message": "API KEY Invalid"
}
Example of Draft Notifications
Retrieving draft notifications requires setting the query parameter status
to draft
.
Request
- cURL
- PHP
curl -X GET -H "api_key: <your_pushengage_api_key>" "https://api.pushengage.com/apiv1/notifications?status=draft"
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.pushengage.com/apiv1/notifications?status=draft",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_POSTFIELDS => "",
CURLOPT_HTTPHEADER => array(
"api_key: <your_pushengage_api_key>",
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
?>
Response
- 200 OK
- 401 Unauthorized
{
"notifications": [
{
"notification_id": "123451",
"notification_title": "this is title of notification",
"notification_message": "this is message of notification",
"notification_url": "http://www.example.com",
"notification_image": "your_image_path/image.png",
"notification_big_image": "your_big_image_path/big_image.png",
"created_time": "<notification_creation_time>",
"notification_expiry": "<sec>",
"notification_criteria":"[{"filter_type":"include_countries","countries":["XXXX"]},{"filter_type":"include_states","states":["XXXX"]},{"filter_type":"include_cities","cities":["XXXX"]},{"filter_type":"include_device_types","devices":["XXXX"]},{"filter_type":"include_browsers","browsers":["XXXX"]}]",
"notification_source": "XXXX"
},
{
"notification_id": "123452",
"notification_title": "this is title of notification1",
"notification_message": "this is message of notification1",
"notification_url": "http://www.example.com",
"notification_image": "your_image_path/image.jpg",
"notification_big_image": "your_big_image_path/big_image.png",
"created_time": "<notification_creation_time>",
"valid_from": "<notification_scheduled_time>",
"notification_expiry": "<sec>",
"notification_criteria":"[{"filter_type":"include_countries","countries":["XXXX"]},{"filter_type":"include_states","states":["XXXX"]},{"filter_type":"include_cities","cities":["XXXX"]},{"filter_type":"include_device_types","devices":["XXXX"]},{"filter_type":"include_browsers","browsers":["XXXX"]}]",
"notification_source": "XXXX"
}
],
"success": true,
"count": 2
}
{
"success": false,
"message": "API KEY Invalid"
}