Alpha Only: This service is subject to change
This service is a work in progress. It is currently subject to change or removal without notice.
Devices
The Devices service manages a user's devices native applications built on Spark® API run on, allowing features such as push notifications.
Supported Roles
Role | Reads | Writes | Notes |
---|---|---|---|
IDX | No | No | |
Public | No | No | |
VOW | Yes | Yes | |
Portal | Yes | Yes | |
Private | Yes | Yes |
More information about roles may be found here.
Available Services
All Devices
/<API Version>/devices
HTTP Method | Description | Conditional | Notes |
---|---|---|---|
GET | Returns a list of devices registered for the current user | No | |
POST | Registers a device for the current user | No | |
PUT | Returns HTTP 405 (Method Not Allowed) | No | Not implemented |
DELETE | Returns HTTP 405 (Method Not Allowed) | No | Not implemented |
GET Request
Parameters:
- None
GET Response
{
"D": {
"Results": [{
"Id": "20100000000000000000000000",
"ResourceUri": "/vX/devices/20100000000000000000000001",
"OwnerId": "20100000000000000000000001",
"DeviceToken": "a7d5f801637a582a89313de96edd7fe8",
"Platform": "IOS",
"Active": true,
"ModificationTimestamp": "2012-01-11T09:50:18-05:00",
"Notifications": {
"NewsFeedEvents": ["New", "PriceChange"]
}
}]
}
}
POST Request
Request body:
{
"D": {
"DeviceToken": "a7d5f801637a582a89313de96edd7fe8",
"Platform": "IOS",
"Active": true,
"Notifications": {
"NewsFeedEvents": ["Pending"]
}
}
}
POST Response
The standard success/fail response is returned.
Individual Devices
/<API Version>/devices/<Device.Id>
HTTP Method | Description | Conditional | Notes |
---|---|---|---|
GET | Returns a specific device | No | |
POST | Returns HTTP 405 (Method Not Allowed) | No | Not implemented |
PUT | Updates a device for the current user | No | |
DELETE | Removes a registered device | No |
GET Request
Parameters:
- None
GET Response
See the GET request section for for the devices service.
PUT Request
Request body:
{
"D": {
"Notifications": {
"NewsFeedEvents": ["PriceChange"]
}
}
}
PUT Response
The standard success/fail response is returned.
DELETE Request
Parameters:
- None
DELETE Response
The standard success/fail response is returned.
Devices Description
Attribute | Data Type | Writeable | Required | Description |
---|---|---|---|---|
ResourceUri |
Character | No | No | The URI to a particular device. |
Id |
Character | No | No | The unique id for the device. |
Active |
Character | Yes | No | If false , the device will not receive any push notifications for the current user.Only one record per DeviceToken for all users (not just the current user) can be Active . When set to true on create or update, all other records for the same DeviceToken will be updated to false . When unspecified while creating a the first record for a DeviceToken , Active will default to true . Otherwise, the default is false . |
DeviceToken |
Character | Yes | Yes | The unique token registered for this device. Used when sending push notifications. |
Platform |
Character | Yes | Yes | The device's platform. Currently IOS and Android are supported. |
ModificationTimestamp |
Timestamp | No | No | The date and time when the device record was last modified. |
Notifications |
JSON Object | Yes | No | The types of resources and events the device will receive push notifications for. |
NewsFeedEvents |
CharacterList | Yes | No | The list of News Feed Events the device will receive push notifications for. If null , the device will be subscribed to all events. If [] , the device is subscribed to no events. See our explanation of instant news feed notifications for more information. |
Expansions
None.