Associations Devices
Create Vehicles Associations Devices
POST /v2/vehicles/associations/devices
Payload
{
"body": {
"data": [
{
"device_id": "abc123def456ghi",
"vehicle_id": "jkl789mno012pqr",
"is_main_device": true
}
]
}
}
Field | Description | Required |
---|---|---|
data | Array containing objects representing device associations. | true |
device_id | String named after the ID of the device, validated using a regex for alphanumeric characters with length 15. | true |
vehicle_id | String named after the ID of the vehicle, validated using a regex for alphanumeric characters with length 15. | true |
is_main_device | Boolean indicating whether the device is the main device for the vehicle. | true |
Responses
Status | Meaning | Description |
---|---|---|
200 | OK | Default Response |
400 | Bad Request | One of 'Device(s) Already Associated With Another Vehicle', 'Vehicle Already Has Main Device' or 'Vehicle And Device Are in Different Enterprises' |
404 | Not Found | One of 'Vehicle Not Found' or 'Device Not Found' |
This operation does not require authentication
Delete Vehicles Associations Devices
DELETE /v2/vehicles/associations/devices
Payload
{
"body": {
"data": [
{
"type": "device_association",
"id": "abc123def456ghi"
}
]
}
}
Field | Description | Required |
---|---|---|
data | Array containing objects representing device associations. Each object must have a type and an id. | |
type | String that specifies the type of association, which must be equal to 'device_association'. | true |
id | String specifying the ID of the association, must consist of 15 alphanumeric characters. | true |
Responses
Status | Meaning | Description |
---|---|---|
200 | OK | Default Response |
400 | Bad Request | One Vehicle-Device Association Must Be Main |
404 | Not Found | Association Not Found |
This operation does not require authentication
List Vehicles Associations Devices
GET /v2/vehicles/{vehicle_id}/associations/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
Update Vehicles Associations Devices
PATCH /v2/vehicles/{vehicle_id}/associations/devices/{association_id}
Parameters
{
"params": {
"vehicle_id": "abc123DEF456GHI",
"association_id": "JKL789mno012PQR"
}
}
Field | Description | Required |
---|---|---|
vehicle_id | String named after the ID of the vehicle, composed of 15 alphanumeric characters. | true |
association_id | String named after the ID of the association, composed of 15 alphanumeric characters. | true |
Payload
{
"body": {
"data": {
"attributes": {
"is_main_device": true
}
}
}
}
Field | Description | Required |
---|---|---|
data | Object containing the attributes of the data. | true |
attributes | Object containing specific attributes of the data. | |
- is_main_device | Boolean indicating whether the device is the main one. | false |
Responses
Status | Meaning | Description |
---|---|---|
200 | OK | Default Response |
400 | Bad Request | One Vehicle-Device Association Must Be Main |
404 | Not Found | Association Not Found |
This operation does not require authentication