Documentation

Device Info API


Get device info, presence, undelivered notifications, and more with this powerful API.

API Endpoint


GET https://api.pushy.me/devices/TOKEN?api_key=SECRET_API_KEY

Make sure to replace SECRET_API_KEY with your app's Secret API Key listed in the Dashboard.

Note: This is a backend API endpoint. Never expose your application's Secret API Key in your client code.

Query String Parameters

Key Description Type
TOKEN The device token, as persisted in the Store Device Tokens phase. A string
API Response

Successful Response Example

{
  "device": {
    "date": 1445207358,
    "platform": "android"
  },
  "subscriptions": [
    "news",
    "media"
  ],
  "presence": {
    "online": true,
    "last_active": {
      "date": 1464006925,
      "seconds_ago": 215
    }
  },
  "pending_notifications": [
    {
      "id": "5742fe0407c3674e226892f9",
      "date": 1464008196,
      "payload": {
        "message": "Hello World!"
      },
      "expiration": 1466600196
    }
  ]
}

Failure Response Example

{"error":"We could not find a device with that token linked to your account."}
API Response Objects

Key Description Type
device Metadata about the device (see below). An object
presence Information about the device's presence and last communication (see below). An object
subscriptions An array of topics the device is subscribed to. A string[] array
pending_notifications Pending notifications that have not yet been delivered to the device (see below). An object[] array

device

Key Description Type
date The device's registration date (unix timestamp). An integer
platform The device platform. A string

presence

Key Description Type
online The device's current connectivity status. A boolean
last_active.date The device's last communication date (unix timestamp). An integer
last_active.seconds_ago The device's last communication, in seconds ago. An integer

pending_notifications

Key Description Type
id The push notification's unique ID. A boolean
date The creation date of the push notification (unix timestamp). An integer
payload The push notification payload data. An object
expiration The push notification expiration date (unix timestamp). An integer