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
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 |
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:
|
notifications.id |
string |
The message unique identification number in the Wooxy system. |
notifications.status |
string |
The message unique identification number in the Wooxy system:
|
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:
|
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
$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);