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:
|