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,
}
List devices in the user’s account. Lists all devices, or those linked to a specific project if using the project path.
{ "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, }, ] }
Param name | Description |
---|---|
project_id required |
The ID of the project. Required for the projects linked devices count api call Validations:
|
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.
{ "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" } }
Returns the count of devices in the user’s account.
{ "status" : "success", "result" : 2 }
Param name | Description |
---|---|
project_id required |
The ID of the project. Required for the projects linked devices count api call Validations:
|
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:
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"
}
Param name | Description |
---|---|
unit_id required |
The Unit ID for this device. Unit IDs must be unique within a user’s account. Validations:
|
name required |
A display name that can be associated with the device. Used for display purposes only. Validations:
|
Param name | Description |
---|---|
unit_id required |
The Unit ID for this device. Unit IDs must be unique within a user’s account. Validations:
|
name required |
A display name that can be associated with the device. Used for display purposes only. Validations:
|
Return a list of projects linked to this device.
{ "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" }, ] }
Link one or more projects to a device.
The project_id
parameter can be: * a Project ID to link a single project. * an array of Project ID’s to unlink multiple projects.
{ "status": "success", "message": "success", "result": [ PROJECT_ID_1, PROJECT_ID_2 ] }
Param name | Description |
---|---|
device_id required |
The device’s Id or device Unit ID. Validations:
|
project_id required |
The project id or array of project ids. Validations:
|
Unlink one or more projects from a device.
The project_id
parameter can be: * a Project ID to unlink a single project. * an array of Project ID’s to unlink multiple projects. * a string of “all” to unlink all projects from the device.
{ "status": "success", "message": "success", "result": [ PROJECT_ID_1, PROJECT_ID_2 ] }
Param name | Description |
---|---|
device_id required |
The device’s Id or device Unit ID. Validations:
|
project_id optional |
The project id of the project to unlink or an array of project ids to be unlinked from the device or a string, “all”, to unlinke all projects from the device. Validations:
|
{ "status": "success", "message": "success", "result": "linked" }
Param name | Description |
---|---|
id required |
The device’s Id or device Unit ID. Validations:
|
language_translation_id required |
The language translation id. Validations:
|
{ "status": "success", "message": "success", "result": "unlinked" }
Param name | Description |
---|---|
id required |
The device’s Id or device Unit ID. Validations:
|
Return a count of projects linked to this device.
{ "status": "success", "message": "success", { "status": "success", "message": "success", "result": 2 } }