Devices represent mobile client apps running on iOS, Android or Windows Mobile devices.

Devices are uniquely identified within an account by their “Unit ID”. This is configured on the device when the client software is installed on the device.

Device GET actions return a JSON description of the device, including the last time is was used. The last used time is updated when the device submits a session to the server.

Example JSON object:

{
    "id" : 1234,
    "name" : "my device",
    "unit_id" : "DEVICE01"
    "last_used": "2013-11-27 11:23:45",
    "last_used_timestamp": 1385515425,
}

GET /api/v1/devices
List devices in the user's account.

List devices in the user’s account. Lists all devices, or those linked to a specific project if using the project path.

Examples

{
  "status" : "success",
  "result" : [
    {
    "id" : 1234,
    "name" : "my device",
    "unit_id" : "DEVICE01"
    "last_used": "2013-11-27 11:23:45",
    "last_used_timestamp": 1385515425,
    },
    {
    "id" : 2345,
    "name" : "my other device",
    "unit_id" : "DEVICE02"
    "last_used": "2013-11-26 11:23:45",
    "last_used_timestamp": 1385429025,
    },
  ]
}

Params

Param name Description
project_id
required

The ID of the project. Required for the projects linked devices count api call

Validations:

  • Must be a Integer


GET /api/v1/devices/:id
Get the details for a device.

Get the name and unit id for a device. The device is identified by its ID, which is an unique identifier for the device within the system. The ID can be found in the device list.

There should be little need to use this call directly, since all of the data it returns is also included in the GET /api/v1/devices device list action.

Examples

{
  "status" : "success",
  "result" : {
    "name" : "my device",
    "unit_id" : "DEVICE01"
    "name": "John's Device",
    "last_used": "2017-12-12T02:06:57.000Z",
    "last_used_timestamp": "2017-12-12T02:06:57.000Z",
    "platform": "iOS",
    "platform_version": "8.1.2",
    "platform_version_value": 8102,
    "device_model": "iPhone",
    "device_system": "iPhone OS",
    "app_version": "Mobile Data Anywhere 1.1.35/1000"
  }
}

GET /api/v1/devices/count
Return the count of devices in the user's account

Returns the count of devices in the user’s account.

Examples

{
  "status" : "success",
  "result" : 2
}

Params

Param name Description
project_id
required

The ID of the project. Required for the projects linked devices count api call

Validations:

  • Must be a Integer


POST /api/v1/devices
Create a new device in this account

This api call creates a new device in the database, if your subscription has any available device allocations.

This api call accepts the following content-types:

  • application/json : The request body is interpreted as a JSON document.
  • multipart/form-data : The request is interpreted as a standard web form post.
  • application/x-www-form-urlencoded: The request is interpretted as a form post.

The request is expected to contain a structured document as follows:

JSON example for content-type application/json:

{
  "device":{
    "unit_id" : "Device 005",
    "name" : "John's Device",
  }
}

For a form post with content-type multipart/form-data:

device[unit_id]=Device 005
device[name]=John's Device

A successful call will return a JSON response with the new device data in the result.

{
  "status": "success",
  "message": "success",
  "result": {
    "id": 33,
    "unit_id": "Device 005",
    "name": "John's Device",
    "last_used": "2017-12-12T02:06:57.000Z",
    "last_used_timestamp": "2017-12-12T02:06:57.000Z",
    "platform": "iOS",
    "platform_version": "8.1.2",
    "platform_version_value": 8102,
    "device_model": "iPhone",
    "device_system": "iPhone OS",
    "app_version": "Mobile Data Anywhere 1.1.35/1000"
  }
}

If your account’s subscription does not have any available devices you will receive an error:

{
  "status": "bad_request",
  "message": "Validation failed: Unit has already been taken"
}

Params

Param name Description
unit_id
required

The Unit ID for this device. Unit IDs must be unique within a user’s account.

Validations:

  • Must be a String

name
required

A display name that can be associated with the device. Used for display purposes only.

Validations:

  • Must be a String


PUT /api/v1/device/:id
Update a device in this account

Params

Param name Description
unit_id
required

The Unit ID for this device. Unit IDs must be unique within a user’s account.

Validations:

  • Must be a String

name
required

A display name that can be associated with the device. Used for display purposes only.

Validations:

  • Must be a String


DELETE /api/v1/devices/:id
Remove a device from this account


GET /api/v1/devices/:device_id/projects
Return a list of projects linked to this device.

Return a list of projects linked to this device.

Examples

{
  "status": "success",
  "message": "success",
  "result": [
      {
          "id": 1,
          "name": "Courier",
          "escaped_name": "courier",
          "uid": 123123123,
          "filename": "Courier.ppc"
      },
      {
          "id": 2,
          "name": "Breathalyser",
          "escaped_name": "breathalyser",
          "uid": 123123124,
          "filename": "Breathalyser.ppc"
      },
  ]
}

POST /api/v1/devices/:device_id/projects/link
Link one of more projects to a device


DELETE /api/v1/devices/:device_id/projects/unlink
Unlink one or more projects from a device.


POST /api/v1/devices/:id/link_language_translation
Link one language translation to a device


POST /api/v1/devices/:id/unlink_language_translation
Unlink the current language translation from a device


GET /api/v1/devices/:device_id/projects/count
Return a count of projects linked to this device.

Return a count of projects linked to this device.

Examples

{
  "status": "success",
  "message": "success",
  {
      "status": "success",
      "message": "success",
      "result": 2
  }
}

POST /api/v1/devices/:id/connect
Attempt to connect device via api


POST /api/v1/devices/:id/disconnect
Attempt to disconnect device via api


POST /api/v1/devices/:id/manifest
Retrieve device manifest for http connecction