Device Methods

The device methods are used to get info about the devices using your application. 

  • List: Query existing devices registered as using the app and get a list of results
  • Info: Get info on a single device

 

List

Used to get a list of the devices using your application. All devices may be returned or a list of devices of a certain type if criteria are provided.

URL

api/external/list/device

Parameters

ParameterDescription
apptoken Your App token
order Order the list in either ascending or descending order based on any of the attributes e.g. “order”: ["id ASC", "create_time" ] or "order": ["id DESC", "create_time" ]
select Select what attributes to return e.g. "select": ["device_id", "device_model"]
condition Filter the returned devices based on some criteria e.g. "condition": [ ["create_time", ">" , 1420559153] ]
limit Used with offset for pagination e.g. "limit": 50, "offset": 0 returns a max of 50 devices starting at position 0
offset Used with limit for pagination e.g. "limit": 50, "offset": 0 returns a max of 50 devices starting at position 0

Example

List all devices associated with your App.

curl -X POST -d '{"apptoken":"YOUR_APPTOKEN"}' https://external-api.xtremepush.com/api/external/list/device

List all device that were first registered on the platform on or after 00:00 GMT 1 Jan 2015 (using Unix time 1420070400).

curl -X POST -d '{"apptoken":"YOUR_APPTOKEN",  "condition": [["create_time", ">=", "1420070400"]] }' https://external-api.xtremepush.com/api/external/list/device

Use pagination to get the most recently created device. Achieved by setting order to be descending (defaults to create time) and grabbing the top device using offset and limit.

curl -X POST -d '{"apptoken":"YOUR_APPTOKEN", "order": "id DESC", "offset":0, "limit":1 }' https://external-api.xtremepush.com/api/external/list/device

JSON response for a single device, an iOS device.

{
    "code": 200,
    "success": true,
    "data": [
        {
            "id": DEVICE_ID,
            "create_time": 1420589115,
            "deactivate_time": null,
            "open_time": 1420589115,
            "token": "f40b0df2aa78349918ae1f837275c9233f524bd09ac18fb3cc174e6e80a134ca",
            "active": 1,
            "addressable": 1,
            "type": "ios",
            "environment": "production",
            "device_id": "9CEFBF8C-9C9F-4242-ADE5-8942FC67806E",
            "device_type": "iPhone",
            "device_model": "iPhone5,2",
            "device_model_name": "iPhone 5",
            "device_os": "8.1.2",
            "name": "Test Device"
            "timezone": "Europe/Dublin",
            "country": "IE",
            "language": "en",
            "carrier_name": "Vodafone",
            "app_version": "1.1",
            "lib_version": "i22022015",
            "external_id": null
        }
    ]
}

 

Info

Used to get info on a single device.

URL

api/external/info/device

Parameters

ParameterDescription
apptoken Your App Token
id The id of the device you are looking for
select Select what attributes to return e.g. "select": ["id", "device_model"]

Example

Get all info on the device.

curl -X POST -d '{"apptoken":"YOUR_APPTOKEN", "id": DEVICE_ID}' https://external-api.xtremepush.com/api/external/info/device

JSON response with info for a requested device.

{
    "code": 200,
    "success": true,
    "model": {
        "id": DEVICE_ID,
        ...
    }
}

 

Have more questions? Submit a request

0 Comments

Article is closed for comments.