View the devices sent a message

This method will return all devices that were sent the given notification_id of an Email or Push Notification if used within 7 days of the date sent. After 7 days of the sending date, the message history data will be unavailable.

After a successful response is received, the destination url may be polled until the file becomes available. Most exports are done in ~1-3 minutes, so setting a poll interval of 10 seconds should be adequate.

For use cases that are not meant to be consumed by a script, an email will be sent to the supplied email address.

📘

Email Notification History

The Notification History API does not currently support "Opens" as a parameter.

🚧

Requirements

  1. A OneSignal Professional or Enterprise Plan.
  2. Turn on Send History via OneSignal API in Settings -> Analytics. Cannot get data before this was turned on.
  3. Must be called within 7 days after sending the message.
  4. Messages targeting under 1000 recipients will not have "sent" events recorded, but will show "clicked" events.
  5. Requires your OneSignal App's REST API Key, available in Keys & IDs.

🚧

403 Error Responses

You can test if it is complete by making a GET request to the csv_file_url value. This file may take time to generate depending on how many device records are being pulled. If the file is not ready, a 403 error will be returned. In which case, you set setup a retry to pull again after some time has passed. Otherwise the file itself will be returned.

Sample Response File

player_id,timestamp
2c4fac95-7dfb-4113-9347-aba3a92ff557,1628189160
68f5cf73-b20a-4de9-b6ee-79a863b8e7d8,1628187816
Language