Wooxy API v.3.0

Get Web Push Status

The Get Message Statistics method allows you to get detailed information about a specific Web push notification message by its unique identifier.

Important! The maximum number of Web push notifications that can be checked per request is 100.

Important! For each Web push notification, a maximum of 100 events that the contact has performed with the Web push notification are collected.

Request

POST
https://api.wooxy.com/v3/web-push/info

IMPORTANT: Do not send more than 10 concurrent API requests.

Body Example

                                        {
  "ids": [
     "YOUR_PUSH_ID_1",
     "YOUR_PUSH_ID_2",
     "YOUR_PUSH_ID_3"
  ]
}
                                    

Parameters

Title Type Default Description

ids

required
array

List of messageId numbers. You can include only 100 IDs in one request.

Response

                                        {
  "notifications":[
     {
         "id":"YOUR_PUSH_ID_1",
         "status":"delivered",
         "to":{
             "name":"userName",
             "email":"user@example.com"
         },
         "title":"PUSH_TITLE",
         "text":"PUSH_CONTENT_TEXT",
         "link":"https:\/\/FINAL_DESTINATION_URL\/",
         "image":"http:\/\/ICON_IMAGE_URL\/",
         "bigImage": "",
         "buttons": [
               {
                    "title": "YOUR_TITLE",
                     "url": "YOUR_LINK"
               }
           ],
         "events":[
            {
               "event":"viewed",
               "datetime":"YYYY-MM-DD h:i:s"
            },
            {
               "event":"delivered",
               "datetime":"YYYY-MM-DD h:i:s"
            },
            {
               "event":"dismissed",
               "datetime":"YYYY-MM-DD h:i:s"
            }
          ]
      }
   ],
   "result":true
}
                                    

Parameters

Title Type Description

result

boolean

The sending status of the recipient:

  • true: The message is accepted and queued;
  • false: The message is rejected.

notifications.id

string

The message unique identification number in the Wooxy system.

notifications.status

string

The message unique identification number in the Wooxy system:

  • delivered: The notification was delivered;
  • undelivered: The notification wasn’t delivered, invalid token;
  • expired: The notification wasn’t shown due to TTL (Time to live).

notifications.to

object

An array of recipient information.

notifications.to.name

string

The optional display name of the recipient.

notifications.to.email

string

The email address of the recipient.

notifications.title

string

The Push notification title.

notifications.text

string

Web Push content text you want to send.

notifications.link

string

Link to the page where subscribers will get when they click on the push.

notifications.image

string

Icon which subscribers will see when they get the notification.

notifications.events

array

Push statistics includes detailed information on each push notification in the account.

notifications.events.event

string

It shows the action that the contact has taken with the push notification:

  • viewed: The status is assigned as soon as the user views the notification;
  • delivered: The notification was delivered;
  • dismissed: The status is assigned every time this message has been closed by the user;
  • click: The status is assigned every time URLs in this notification have been clicked by the user;
  • expired: The notification wasn’t shown due to TTL (Time to live);
  • undelivered: The notification wasn’t delivered, invalid token.

notifications.events.datetime

string

It shows the moment in time when the contact has taken an action with the push notification.

notifications.buttons

array

Object array is the parameter that allows you to add a button to your web push notifications.
 

notifications.buttons.title

string

The title for button name.

notifications.buttons.url

string

The link to the page where subscribers will get when they click on the link.

notifications.richImage

string

Allows you to add a link to your banner for web push notifications.

Method Errors

                                        {
   "result": false,
   "errors": [
      "Error description text"
   ]
}
                                    
Error

“Argument ids must be an array of strings”

“Argument ids can not be empty”

“Each id must be a non-empty string”

“Ids count must be less or equal 100”

“Invalid authorization token!”

“Internal server error”

“Bad Request”

“no matches found for access token {accessToken}”

user {id} not enabled”

“no data found for key {userId}”

“access token check failed for key\/secret $key\/$accessToken”

“Argument {argument} required”

Code Examples

PHP
                $accessToken = "YOUR_API_KEY";
$url = 'https://api.wooxy.com/v3/web-push/info';
$body = json_encode([
    'ids' => [
       'YOUR_PUSH_ID_1',
       'YOUR_PUSH_ID_2',
       'YOUR_PUSH_ID_3'
    ],
]);

/**
 * Request Example
 */
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
//curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt($ch, CURLOPT_INFILESIZE, null);
curl_setopt($ch, CURLOPT_POSTFIELDS, $body);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    "Access-Token: $accessToken",
    'Content-Type: application/json',
    'Content-Length: ' . strlen($body),
]);

$result = curl_exec($ch);
if ($result === false) {
    echo 'cURL error:' . curl_error($ch) . PHP_EOL;
} else {
    echo strval($result) . PHP_EOL;
}
curl_close($ch);