Progress will discontinue Telerik Platform on May 10th, 2018. Learn more

Reading Device Registrations

Reading Device Registrations

You can read information about currently registered devices. For instance you can read the full list of registered devices, read a filtered list, or request a single device only.

The registration object is detailed in Table of Registration Object Fields.

Read by ID

You can use the Id returned by the registration endpoint to read the device's registration object that contains the HardwareId among other data.

Request:
    GET https://api.everlive.com/v1/your-app-id/Push/Devices/<DeviceId>

Headers:
        Authorization: Masterkey your-master-key

Response:
    Status: 200 OK
    Content-Type: application/json
var deviceId = '<your-device-id>';
$.ajax({
    type: "GET",
    url: 'https://api.everlive.com/v1/your-app-id/Push/Devices/' + deviceId,
    headers: {
         "Authorization": "Masterkey your-master-key"
    },
    success: function(data){
        alert(JSON.stringify(data));
    },
    error: function(error){
        alert(JSON.stringify(error));
    }
});

Read by Hardware ID

You can use the device's hardware ID (encodedHardwareId) to retrieve its registration object from the backend. Note that you must URL-encode the hardware ID string before sending it.

A useful application of the read operation is checking if a device has already been registered for push notifications. The response object's Result field contains information about the device if the device has already been registered. Otherwise the field is null.

Request:
    GET https://api.everlive.com/v1/your-app-id/Push/Devices/HardwareId/<encodedHardwareId>

Response:
    Status: 200 OK
    Content-Type: application/json
var encodedHardwareId = encodeURIComponent(<your-hardware-id>);
$.ajax({
    type: "GET",
    url: 'https://api.everlive.com/v1/your-app-id/Push/Devices/HardwareId/' + encodedHardwareId,
    success: function(data){
        alert(JSON.stringify(data));
    },
    error: function(error){
        alert(JSON.stringify(error));
    }
});

Read All

Use the following GET request to get the list of all registered devices:

Request:
    GET https://api.everlive.com/v1/your-app-id/Push/Devices
Headers:
    Authorization: Masterkey your-master-key

Response:
    Status: 200 OK
    Content-Type: application/json
$.ajax({
    type: "GET",
    url: 'https://api.everlive.com/v1/your-app-id/Push/Devices',
    headers: {
        "Authorization": "Masterkey your-master-key"
    },
    success: function(data){
        alert(JSON.stringify(data));
    },
    error: function(error){
        alert(JSON.stringify(error));
    }
});

Read by Filter

You can filter down the full list of devices based on various criteria such as built-in or custom device registration option. The next example, for instance, filters by PlatformType:

Request:
    GET https://api.everlive.com/v1/your-app-id/Push/Devices
Headers:
    Authorization: Masterkey your-master-key
    X-Everlive-Filter: {
        "PlatformType": 4 // all iOS Devices
    }

Response:
    Status: 200 OK
    Content-Type: application/json
$.ajax({
    type: "GET",
    url: 'https://api.everlive.com/v1/your-app-id/Push/Devices',
    headers: {
        "Authorization": "Masterkey your-master-key",
        "X-Everlive-Filter": JSON.stringify({
            "PlatformType": 4 // all iOS Devices
        })
    },
    success: function(data){
        alert(JSON.stringify(data));
    },
    error: function(error){
        alert(JSON.stringify(error));
    }
});

See Also


Start a free trial Request a demo
Contact us: +1-888-365-2779
sales@telerik.com
Copyright © 2016-2017, Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.