View the details of multiple notifications

🚧

Requires Authentication Key

Requires your OneSignal App's REST API Key, available in Keys & IDs.

❗️

API Notification Deletion

OneSignal periodically deletes records of API notifications older than 30 days.

If you would like to export all notification data to CSV, you can do this through our dashboard using a Paid Plan.

Path Parameters

ParameterTypeDescription
app_idStringRequired The app ID that you want to view notifications from
limitStringHow many notifications to return. Max is 50. Default is 50
offsetIntegerPage offset. Default is 0. Results are sorted by queued_at in descending order. queued_at is a representation of the time that the notification was queued at.
kindIntegerKind of notifications returned. Default (not set) is all notification types.
Dashboard only is 0.
API only is 1.
Automated only is 3.

Example Code - View notifications

curl --include \
     --header "Authorization: Basic YOUR_REST_API_KEY" \
     "https://onesignal.com/api/v1/notifications?app_id=YOUR_APP_ID"
<?PHP
$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://onesignal.com/api/v1/notifications?app_id=3cb5beaa-e6ca-5932-aad9-fdabaa3b83ce&limit=50&offset=0",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => array(
    "authorization: Basic ONESIGNAL_APP_REST_API_KEY_HERE",
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

echo $response;
?>
import requests
import json

header = {"Content-Type": "application/json; charset=utf-8",
          "Authorization": "Basic YOUR_ONESIGNAL_REST_API_KEY"}

req = requests.get("https://onesignal.com/api/v1/notifications?app_id=YOUR_APP_ID&offset=0", headers=header)
 
print(req.status_code, req.reason)

Result Format - View notifications

📘

Data Definitions

Endpoint returns same fields as under the View Notification endpoint above. More details in that section.

Common parameters:
"successful" = Number of notifications delivered to the Google/Apple/Windows servers.
"converted" = Number of devices who have clicked/tapped the notification.
"received" = Number of devices that confirmed receiving the notification aka Confirmed Deliveries.

Due to large amount of data returned, omitted lines indicated with ...

{
    "total_count": 553,
    "offset": 0,
    "limit": 1,
    "notifications": [
        {
            ...
            "app_id": "3beb3078-e0f1-4629-af17-fde833b9f716",
            ...
            "chrome_web_icon": "https://img.onesignal.com/t/73b9b966-f19e-4410-8b5d-51ebdef4652e.png",
            ...
            "contents": {
                "en": "Come by and check out our new Jordan's!!! (Shoes) 🎃🙊👻"
            },
            "converted": 0,
            "data": {
                "your_data_key": "your_data_value"
            },
            ...,
            "errored": 1,
            "excluded_segments": [
                "3 Days Inactive"
            ],
            "failed": 0,
            ...
            "headings": {
                "en": "Thomas' Greatest Site in the World!! 😜😁"
            },
            "id": "e664a747-324c-406a-bafb-ab51db71c960",
            ...
            "included_segments": [
                "all"
            ],
            ...
            "queued_at": 1557946677,
            "remaining": 0,
            "send_after": 1557946620,
            "completed_at": 1557946677,
            "successful": 386,
            ...
            "url": "https://mysite.com",
            ...
            "platform_delivery_stats": {
                "edge_web_push": {
                    "successful": 2,
                    "failed": 0,
                    "errored": 0,
                    "converted": 2,
                    "received": 2

                },
                "chrome_web_push": {
                    "successful": 26,
                    "failed": 0,
                    "errored": 0,
                    "converted": 26,
                    "received": 26
                },
                "firefox_web_push": {
                    "successful": 1,
                    "failed": 0,
                    "errored": 0,
                    "converted": 1,
                    "received": 1
                },
                "android": {
                    "successful": 198,
                    "errored": 1,
                    "failed": 0,
                    "converted": 198,
                    "received": 198
                },
                "safari_web_push": {
                    "successful": 3,
                    "failed": 0,
                    "errored": 0,
                    "converted": 3,
                    "received": 3
                },
                "ios": {
                    "successful": 2,
                    "errored": 3,
                    "failed": 0,
                    "converted": 2,
                    "received": 2
                }
            },
            "ios_attachments": {
                "id": "https://img.onesignal.com/n/44843933-68d4-450c-af5c-5e5c1a9d946e.jpg"
            }
        }
    ]
}
Language