Check Subscriber with Hash#

Getting Started#

Introduction

The subscriber is a user that subscribes to your website and gets notification. This endpoint is used to check if subscriber is active or not. This includes response object success which returns true or false.

Request URL

  https://api.pushengage.com/apiv1/subscribers/check

Method

  POST

Request Parameters

Required Parameters

Parameter Name Parameter Type Description
subscriber_hash String This is the unique id for subscriber, that is generated when subscriber subscribes to your website and store in our database.

Response Objects

Required Object

Property Name Property Type Description
success Boolean To denote whether push request succeeded or not. Values can be 'true' or 'false'.

Optional Object

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

Check Subscriber with Hash#

This endpoint is used to check if subscriber is active or not to your website.

Example#

Request

  • cURL
  • PHP
curl -X POST 
-H "api_key: <your_pushengage_api_key>" 
-H "Content-Type: application/x-www-form-urlencoded" 
-d 'subscriber_hash=ety67HgTYgKl8' 
"https://api.pushengage.com/apiv1/subscribers/check"
<?php

    $curl = curl_init();
    curl_setopt_array($curl, array(
      CURLOPT_URL => "https://api.pushengage.com/apiv1/subscribers/check",
      CURLOPT_RETURNTRANSFER => true,
      CURLOPT_ENCODING => "",
      CURLOPT_MAXREDIRS => 10,
      CURLOPT_TIMEOUT => 30,
      CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
      CURLOPT_CUSTOMREQUEST => "POST",
      CURLOPT_POSTFIELDS => "subscriber_hash=ety67HgTYgKl8",
      CURLOPT_HTTPHEADER => array(
        "api_key: <your_pushengage_api_key>",
        "cache-control: no-cache",
        "content-type: application/x-www-form-urlencoded"
      ),
    ));

    $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
{
  "success": true
}
{
  "success": false,
  "message": "API KEY Invalid"
}
{
  "success": false,
  "message": "No Active Subcribers Found for the given subscriber_hash"
}