Devices

Top level endpoint

Usage

Expected headers, roles and authorization

Name Required Values Type Description
CONTENT-TYPE Y application/json String Used to alert the rest service to the presence of a json body

Get a device

GET HTTPS /v1/devices/{id}
Name Required Values Description
AUTHORIZATION Y Bearer {token} Used to attach access token for API call

Path Parameters

Name Description Type
id Unique device identifier String

Response payload

Device

Response Status Code

Code Description Body
200 OK Returns a Device identified by id

Add a device

PUT HTTPS /v1/devices

Header

Name Required Values Description
AUTHORIZATION Y Bearer {token} Used to attach access token for API call

Body fields

Name Required Description Type
id Y Unique device identifier String
platform Y Device platform (android, ios, windows8, windows7) String
pushToken N Token given by the push provider (GCM, APNS, WMS or WPNS) String
channels N List of channels the device is tuned to (test, production) list
groups N Groups the device is subscribed to. (e.g breakingNews) list

Request JSON

{
   "id":"68753A44-4D6F-1226-9D60-0050E4C11167",
   "pushToken":"e6TSUN4MPKw:APAPVHqjQgmuXDrDIO5IgfNLSFkm0BAiUuSpzB1",
   "platform":"android",
   "channels":[
      "test",
      "production"
   ],
   "groups":[
      "breakingNews"
   ]
}

Response Status Code

Code Description Body
202 Accepted No body

Update a device

PUT HTTPS /v1/devices/{id}

Header

Name Required Values Description
AUTHORIZATION Y Bearer {token} Used to attach access token for API call

Path Parameters

Name Description Type
id Unique device identifier String

Body fields

Name Required Description Type
platform Y Device platform (android, ios, windows8, windows7, appletv, roku, xbox, ps4) String
pushToken Y Token given by the push provider (GCM, APNS, WMS or WPNS) String

Request JSON

{
   "pushToken":"e6TSUN4MPKw:APA91bHPzDtRhOMT66b0vmmetMhCDbiS0GfyMu31ABIxrBxLkD5R3ozuZeysoCIRMqZphpArIWAsd__yDIgl-JghB80CGMXUypToh4IvPVHqjQgmuXDrDIO5IgfNLSFkm0BAiUuSpzB1",
   "platform":"android"
}

Response Status Code

Code Description Body
202 Accepted No body

Get all Roles for the given device

GET HTTPS /v1/devices/{deviceId}/roles

Header

Name Required Values Description
AUTHORIZATION Y Bearer {token} Used to attach access token for API call

Path Parameters

Name Description Type
deviceId Unique device identifier String

Response payload

{
    "roles":[
        {
           "name":"FAN",
           "domain":"ALL",
           "mutable":false
        }
    ]
}

Response Status Code

Code Description Body
200 OK Returns list of Roles for the given device

Add a role for a given device

This will add a single role to this device's list of roles

PUT HTTPS /v1/devices/{deviceId}/roles

Header

Name Required Values Description
AUTHORIZATION Y Bearer {token} Used to attach access token for API call

Path Parameters

Name Description Type
deviceId Unique device identifier String

Request JSON

{
   "roleName":"FAN"
}

Response Status Code

Code Description Body
202 Accepted No body

Remove a role for a given device

This will remove a single role from this device's list of roles

DELETE HTTPS /v1/devices/{deviceId}/roles

Header

Name Required Values Description
AUTHORIZATION Y Bearer {token} Used to attach access token for API call

Path Parameters

Name Description Type
deviceId Unique device identifier String

Body

Name Required Values Description
CONTENT-TYPE Y application/json Used to alert the rest service to the presence of a json body

Body fields

Name Description Type
roleName Role's name String

Request JSON

{
    "roleName":"FAN"
}

Response Status Code

Code Description Body
202 Accepted No body