Analytics of Scheduled Push Notifications#

Getting Started#

Introduction

This endpoint is used to list all notification created by users with status "later". It includes response objects notifications, success and count. Notifications object include property, namely are id, title, message, URL, image, sent time and statistics object. Statistics object include property, namely are sent count, failed count, read count and click count.

Request URL

https://api.pushengage.com/apiv1/notifications

Method

GET

Request Parameters

Required Parameters

There is no required parameters.

Optional Parameters

Parameter Name Parameter Type Description
status String This defines the notification status, such as sent, scheduled or, draft. In this case, status, value is always "scheduled".
notification_id String This is the unique id of notification, that is generated when notification is created.
limit Integer To denote the limit of notifications display as a result. The minimum value is 1.
offset Integer To denote the starting index of limit display as a result. The minimum value is 0.

Response Objects

Required Object

Property Name Property Type Description
notifications Array of Object To denote name of notifications object. Get more detail in notifications object section.
success Boolean To denote whether push response succeeded or not. Values can be 'true' or 'false'.
count Integer To denote the number of notifications display as a result.

Notifications Object#

Notifications object include property, namely are notification_id, notification_title, notification_message, notification_url, notification_image, sent_time and statistics object.

Property name Property Type Description
notification_id Integer To denote id of notification. Value is always unique.
notification_title String To denote the title of the notification.
notification_message String To denote message of notification.
notification_url String To denote landing url of notification.
notification_image String To denote image display in notification.
sent_time String To denote sent time of notification.
statistics Object To denote name of statistics object. Get more detail in Statistics Object section.

Statistics Object#

Statistics object include property, namely are sent_count, failed_count, read_count and click_count. In this case sent_count, failed_count, read_count and click_count value is always "0".

Property name Property Type Description
sent_count Integer To denote the number of subscribers to whom notification was sent successfully.
failed_count Integer To denote the number of subscribers to whom notification was sent failed.
read_count Integer To denote number of subscribers to whom read notification successfully.
click_count Integer To denote the number of subscribers to whom clicked on the notification.

Optional Object

Property name Property Type Description
message String Present in case of failure. Used to denote reason of failure.

Getting a List of Scheduled Push Messages#

This endpoint is used to list all notifications with status as "scheduled". This endpoint requires single parameter status.

Example#

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>",
        "cache-control: no-cache"
      ),
    ));

    $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": "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",
      "sent_time": "<notification_scheduled_date_time>",
      "statistics": {
        "sent_count": "0",
        "failed_count": "0",
        "read_count": "0",
        "click_count": "0"
      }
    },
    {
      "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",
      "sent_time": "<notification_scheduled_date_time>",
      "statistics": {
        "sent_count": "0",
        "failed_count": "0",
        "read_count": "0",
        "click_count": "0"
      }
    }
    ],
  "success": true,
  "count": 2
}
{
  "success": false,
  "message": "API KEY Invalid"
}

Getting a Single Scheduled Push Message#

This endpoint is used to get single notifications with status as "scheduled". This endpoint requires these parameters, status and notification_id.

Example#

Request

  • cURL
  • PHP
curl -X GET 
-H "api_key: <your_pushengage_api_key>" 
"https://api.pushengage.com/apiv1/notifications?status=scheduled&notification_id=1234567"
<?php

    $curl = curl_init();

    curl_setopt_array($curl, array(
      CURLOPT_URL => "https://api.pushengage.com/apiv1/notifications?status=scheduled&notification_id=1234567",
      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>",
        "cache-control: no-cache"
      ),
    ));

    $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
  • 400 Bad Request
{
  "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",
      "sent_time": "<notification_scheduled_date_time>",
      "statistics": {
        "sent_count": "0",
        "failed_count": "0",
        "read_count": "0",
        "click_count": "0"
      }
    }
  ],
  "success": true,
  "count": 1
}
{
  "success": false,
  "message": "API KEY Invalid"
}
{
  "success": false,
  "message": "Invalid Input"
}

Getting a List of Scheduled Push Messages with Limit#

This endpoint is used to list limited notifications with status as "scheduled". This endpoint requires these parameters, status and limit.

Example#

Request

  • cURL
  • PHP
curl -X GET 
-H "api_key: <your_pushengage_api_key>" 
"https://api.pushengage.com/apiv1/notifications?status=scheduled&limit=2"
<?php

    $curl = curl_init();

    curl_setopt_array($curl, array(
      CURLOPT_URL => "https://api.pushengage.com/apiv1/notifications?status=scheduled&limit=2",
      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>",
        "cache-control: no-cache"
      ),
    ));

    $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": "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",
      "sent_time": "<notification_scheduled_date_time>",
      "statistics": {
        "sent_count": "0",
        "failed_count": "0",
        "read_count": "0",
        "click_count": "0"
      }
    },
    {
      "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",
      "sent_time": "<notification_scheduled_date_time>",
      "statistics": {
        "sent_count": "0",
        "failed_count": "0",
        "read_count": "0",
        "click_count": "0"
      }
    }
    ],
  "success": true,
  "count": 2
}
{
  "success": false,
  "message": "API KEY Invalid"
}

Getting a List of Scheduled Push Messages with Offset#

This endpoint is used to list limited notifications from specified index with status as "scheduled". This endpoint requires these parameters, status, limit and offset.

Example#

Request

  • cURL
  • PHP
curl -X GET 
-H "api_key: <your_pushengage_api_key>" 
"https://api.pushengage.com/apiv1/notifications?status=scheduled&offset=1&limit=1"
<?php

    $curl = curl_init();

    curl_setopt_array($curl, array(
      CURLOPT_URL => "https://api.pushengage.com/apiv1/notifications?status=scheduled&offset=1&limit=1",
      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>",
        "cache-control: no-cache"
      ),
    ));

    $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": "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",
      "sent_time": "<notification_scheduled_date_time>",
      "statistics": {
        "sent_count": "0",
        "failed_count": "0",
        "read_count": "0",
        "click_count": "0"
      }
    }
  ],
  "success": true,
  "count": 1
}
{
  "success": false,
  "message": "API KEY Invalid"
}