Devices (GET)

Retrieves metadata for the list of devices that accessed this project.

Roles

Users in the following roles are authorized to perform this operation:

  • worklightadmin
  • worklightdeployer
  • worklightmonitor
  • worklightoperator

Method

GET

Path

/management-apis/1.0/runtimes/runtime-name/devices

Example

https://www.example.com/worklightadmin/management-apis/1.0/runtimes/myruntime/devices?locale=de_DE&offset=0&orderBy=uid&pageSize=100&query=Jeremy

Path Parameters

runtime-name
The name of the runtime. This is the context root of the runtime web application, without the leading slash.

Query Parameters

Query parameters are optional.

locale
The locale used for error messages.
offset
The offset from the beginning of the list if only a part of the list (a page) should be returned.
orderBy
The sort mode. By default, the elements are sorted in increasing order. If the sort mode starts with - (minus sign), the elements are sorted in decreasing order. Possible sort modes are: uid, friendlyName, deviceModel, deviceEnvironment, status, lastAccessed. The default sort mode is: uid.
pageSize
The number of elements if only a part of the list (a page) should be returned. The default value is 100.
query
A device friendly name or a user to search for.

Produces

application/json, application/xml, text/xml

Response

The metadata of the devices that accessed this project.

JSON Example

{
  "items" : [
    {
      "applicationDeviceAssociations" : [
        {
          "appName" : "myapplication",
          "deviceId" : "12345-6789",
          "deviceStatus" : "LOST",
          "status" : "ENABLED",
        },
        ...
      ],
      "deviceEnvironment" : "android",
      "deviceModel" : "Nexus 7",
      "deviceOs" : "4.4",
      "friendlyName" : "Jeremy's Personal Phone",
      "id" : "12345-6789",
      "lastAccessed" : "2014-05-13T00:18:36.979Z",
      "status" : "LOST",
      "uid" : "Jeremy",
    },
    ...
  ],
  "pageSize" : 100,
  "productVersion" : "7.0.0",
  "startIndex" : 0,
  "totalListSize" : 33,
}

XML Example

<?xml version="1.0" encoding="UTF-8"?>
<devices
  pageSize="100"
  productVersion="7.0.0"
  startIndex="0"
  totalListSize="33">
  <items>
    <item
      deviceEnvironment="android"
      deviceModel="Nexus 7"
      deviceOs="4.4"
      friendlyName="Jeremy's Personal Phone"
      id="12345-6789"
      lastAccessed="2014-05-13T00:18:36.979Z"
      status="LOST"
      uid="Jeremy">
      <applicationDeviceAssociations>
        <applicationDeviceAssociation
          appName="myapplication"
          deviceId="12345-6789"
          deviceStatus="LOST"
          status="ENABLED"/>
        ...
      </applicationDeviceAssociations>
    </item>
    ...
  </items>
</devices>

Response Properties

The response has the following properties:

items
The array of device metadata
pageSize
The page size if only a page of devices is returned.
productVersion
The exact product version.
startIndex
The start index in the total list if only a page of devices is returned.
totalListSize
The total number of devices.

The device has the following properties:

applicationDeviceAssociations
The applications on the device.
deviceEnvironment
The platform environment of the app version: iphone, android, ...
deviceModel
The device model.
deviceOs
The device operating system.
friendlyName
The friendly name of the device.
id
The device id.
lastAccessed
The date in ISO 8601 format when the device was last accessed.
status
The status of the device: ACTIVE, LOST, STOLEN, EXPIRED, DISABLED.
uid
The user name of the device.

The device application has the following properties:

appName
The name of the application.
deviceId
The device id.
deviceStatus
The status of the device:ACTIVE, LOST, STOLEN, EXPIRED, DISABLED.
status
The status of the application: ENABLED or DISABLED.

Errors

403
The user is not authorized to call this service.
404
The corresponding runtime is not found or not running.
500
An internal error occurred.