Devices
List Devices
GET /v2/devices
Parameter | Description |
---|---|
attributes | Specifies which attributes to retrieve. Can include values like 'serial', 'number', 'carrier', 'service_provider', and 'batch'. If null, retrieves all information. |
includes | Specifies related entities to include in the query. Contains arrays for 'device' and 'enterprise', each with its own set of possible values, such as 'name', 'imei', 'code' for the 'device' array, and 'name', 'cnpj' for the 'enterprise' array. |
filters | Specifies filters for various fields such as 'chips.serial', 'chips.number', 'chips.carrier', 'chips.service_provider', 'chips.batch', 'device.name', 'device.imei', 'device.code', 'enterprise.name', 'enterprise.cnpj'. Each filter field supports conditions like 'eq', 'neq', 'ilk', 'ew', 'sw'. |
search | Specifies the search query with a maximum length of 100 characters. |
limit | Specifies the maximum number of results to return. Must be a number between 1 and 100. |
page | Specifies the page number for paginated results. Must be a number greater than or equal to 0. |
count | Indicates whether to include the total count of results in the response. |
sort | Specifies sorting criteria for 'number' and 'serial' fields. Values can be -1 (descending order) or 1 (ascending order). |
Responses
Status | Meaning | Description |
---|---|---|
200 | OK | Default Response |
400 | Bad Request | Bad Request |
This operation does not require authentication
Create Devices
POST /v2/devices
Payload
{
"body": {
"data": [
{
"attributes": {
"name": "Device 1",
"imei": "1234567890123456789012345",
"batch": "ABC123",
"code": "XYZ789"
},
"relationships": {
"chip": {
"type": "chip",
"id": "abc123456789xyz"
},
"enterprise": {
"type": "enterprise",
"id": "xyz987654321abc"
},
"vehicle": {
"type": "vehicle",
"id": "123abc456def789"
},
"type": {
"type": "type",
"id": "456def789123abc"
}
}
},
{
"attributes": {
"name": "Device 2",
"imei": "9876543210987654321098765"
},
"relationships": {
"chip": {
"type": "chip",
"id": "def456789123abc"
}
}
}
]
}
}
Field | Description | Required |
---|---|---|
data | Array of data objects representing devices. | true |
attributes | Object containing device attributes. | true |
- name | String named after device name, with the maximum length of 21 characters. | true |
- imei | String named after device IMEI, with the maximum length of 25 characters, must consist of numbers only. | true |
- batch | String named after device batch, with the maximum length of 50 characters. | false |
- code | String named after device casode, with the maximum length of 20 characters. | false |
relationships | Object containing relationships with other entities. | false |
- chip | Object representing relationship with a chip. | false |
-- type | String named after the type of relationship, must be 'chip'. | true |
-- id | String named after the ID of the chip, must consist of 15 alphanumeric characters. | true |
- enterprise | Object representing relationship with an enterprise. | false |
-- type | String named after the type of relationship, must be 'enterprise'. | true |
-- id | String named after the ID of the enterprise, must consist of 15 alphanumeric characters. | true |
- vehicle | Object representing relationship with a vehicle. | false |
-- type | String named after the type of relationship, must be 'vehicle'. | true |
-- id | String named after the ID of the vehicle, must consist of 15 alphanumeric characters. | true |
- type | Object representing relationship with a type. | false |
-- type | String named after the type of relationship, must be 'type'. | true |
-- id | String named after the ID of the type, must consist of 15 alphanumeric characters. | true |
Responses
Status | Meaning | Description |
---|---|---|
200 | OK | Default Response |
400 | Bad Request | One of 'Bad Request', 'Device(s) Already Exists', 'Duplicated `names` Was Listed', 'Resource Already Exists' or 'Device(S) And Chip(S) Do Not Belong To Same Enterprise' |
This operation does not require authentication
Delete Devices
DELETE /v2/devices
Payload
{
"body": {
"data": [
{
"type": "devices",
"id": "abc123456789xyz"
},
{
"type": "devices",
"id": "def456789123abc"
}
]
}
}
Field | Description | Required |
---|---|---|
data | Array of data objects representing devices. | |
type | String named after the type of the data object, must be 'devices'. | true |
id | String named after the ID of the device, must consist of 15 alphanumeric characters. | true |
Responses
Status | Meaning | Description |
---|---|---|
200 | OK | Default Response |
400 | Bad Request | One of 'Bad Request' or 'Device(s) Belong to Softruck' |
401 | Unauthorized | Unauthorized |
404 | Not Found | Not Found |
This operation does not require authentication
Show Device
GET /v2/devices/{id}
Field | Description |
---|---|
query | Object containing query parameters. |
- attributes | Array of attributes to retrieve. It can contain values such as 'name', 'imei', 'batch', 'created_at', 'updated_at', 'code'. |
- includes | Object specifying which related entities to include in the query. |
-- chip | Array of attributes related to the chip, including 'serial', 'number', 'service_provider'. |
-- last_gps | Array of attributes related to the last GPS data, including 'last_connection_time', 'last_gps_time'. |
-- enterprise | Array of attributes related to the enterprise, including 'name', 'cnpj'. |
-- vehicle | Array of attributes related to the vehicle, including 'plate', 'vin', 'code'. |
-- type | Array of attributes related to the device type, including 'alias', 'brand_alias', 'inputs_count', 'outputs_count'. |
Responses
Status | Meaning | Description |
---|---|---|
200 | OK | Default Response |
400 | Bad Request | One of 'Bad Request' or 'Conflicted Device Found. Device A Name Equal Device B Imei' |
401 | Unauthorized | Unauthorized |
404 | Not Found | Not Found |
This operation does not require authentication
Update Device
PATCH /v2/devices/{id}
Payload
{
"body": {
"data": {
"attributes": {
"name": "ExampleName",
"imei": "1234567890123456789012345",
"batch": "ExampleBatch",
"code": "ExampleCode"
},
"relationships": {
"chip": {
"type": "chip",
"id": "abc123456789012"
},
"enterprise": {
"type": "enterprise",
"id": "def456789012345"
},
"vehicle": {
"type": "vehicle",
"id": "ghi789012345678"
},
"type": {
"type": "type",
"id": "jkl901234567890"
}
}
}
}
}
Field | Description | Required |
---|---|---|
data | Array of data objects representing devices. | true |
attributes | Object containing device attributes. | true |
- name | String named after device name, with the maximum length of 21 characters. | true |
- imei | String named after device IMEI, with the maximum length of 25 characters, must consist of numbers only. | true |
- batch | String named after device batch, with the maximum length of 50 characters. | false |
- code | String named after device casode, with the maximum length of 20 characters. | false |
relationships | Object containing relationships with other entities. | false |
- chip | Object representing relationship with a chip. | false |
-- type | String named after the type of relationship, must be 'chip'. | true |
-- id | String named after the ID of the chip, must consist of 15 alphanumeric characters. | true |
- enterprise | Object representing relationship with an enterprise. | false |
-- type | String named after the type of relationship, must be 'enterprise'. | true |
-- id | String named after the ID of the enterprise, must consist of 15 alphanumeric characters. | true |
- vehicle | Object representing relationship with a vehicle. | false |
-- type | String named after the type of relationship, must be 'vehicle'. | true |
-- id | String named after the ID of the vehicle, must consist of 15 alphanumeric characters. | true |
- type | Object representing relationship with a type. | false |
-- type | String named after the type of relationship, must be 'type'. | true |
-- id | String named after the ID of the type, must consist of 15 alphanumeric characters. | true |
Responses
Status | Meaning | Description |
---|---|---|
200 | OK | Default Response |
400 | Bad Request | One of 'Bad Request', 'Cannot Update Enterprise Of Associated Device(S)', 'Devices New Enterprise Does Not Belong To Same Owner', 'Cannot Update Device(s)', 'Device(S) And Vehicle(S) Do Not Belong To Same Enterprise' or 'Device(S) And Chip(S) Do Not Belong To Same Enterprise' |
401 | Unauthorized | Unauthorized |
404 | Not Found | Not Found |
This operation does not require authentication
Udpate {situation} Devices
PATCH /v2/devices/{id}/status/{situation}
Parameters
{
"params": {
"id": "ABC1234567890DEF",
"situation": "activation"
}
}
Field | Description | Required |
---|---|---|
id | String containing the ID, must follow the alphanumeric pattern and have a length of 15 characters. | true |
situation | String indicating the situation, must be either 'activation' or 'deactivation'. | true |
Responses
Status | Meaning | Description |
---|---|---|
200 | OK | Default Response |
This operation does not require authentication