Fleet setup

Attributes

Computed attributes management

Fetch a list of Attributes

GET
https://demo.traccar.org/api/attributes/computed

Without params, it returns a list of Attributes the user has access to

Parameters

allbooleanquery

Can only be used by admins or managers to fetch all entities

userIdintegerquery

Standard users can use this only with their own userId

deviceIdintegerquery

Standard users can use this only with _deviceId_s, they have access to

groupIdintegerquery

Standard users can use this only with _groupId_s, they have access to

refreshbooleanquery
limitintegerquery

Limit the number of returned results

offsetintegerquery

Offset for pagination

keywordstringquery

Search keyword filter

Response

OK

Response fields application/json
Show child attributes
idinteger<int64>

Unique computed attribute identifier

descriptionstring

Human readable name of the attribute

attributestring

Attribute name used in expressions

expressionstring

Expression that defines how the attribute is calculated

typestring

String|Number|Boolean

401Unauthorized

Unauthorized

Authorization

BasicAuthhttp (basic)
ApiKeyhttp (bearer)

Create an Attribute

POST
https://demo.traccar.org/api/attributes/computed

Body

application/json
idinteger<int64>

Unique computed attribute identifier

descriptionstring

Human readable name of the attribute

attributestring

Attribute name used in expressions

expressionstring

Expression that defines how the attribute is calculated

typestring

String|Number|Boolean

Response

OK

Response fields application/json
idinteger<int64>

Unique computed attribute identifier

descriptionstring

Human readable name of the attribute

attributestring

Attribute name used in expressions

expressionstring

Expression that defines how the attribute is calculated

typestring

String|Number|Boolean

400Bad Request

Bad request

401Unauthorized

Unauthorized

Authorization

BasicAuthhttp (basic)
ApiKeyhttp (bearer)

Evaluate a Computed Attribute against the latest Device Position

POST
https://demo.traccar.org/api/attributes/computed/test

Admin only. Returns the computed value without persisting the attribute.

Body

application/json
idinteger<int64>

Unique computed attribute identifier

descriptionstring

Human readable name of the attribute

attributestring

Attribute name used in expressions

expressionstring

Expression that defines how the attribute is calculated

typestring

String|Number|Boolean

Parameters

deviceIdintegerrequiredquery

Response

200OKnumber | boolean | string

OK

Response fields application/json
One of
number
boolean
string
204No Content

Computation produced no value

400Bad Request

Bad request

401Unauthorized

Unauthorized

Authorization

BasicAuthhttp (basic)
ApiKeyhttp (bearer)

Fetch an Attribute

GET
https://demo.traccar.org/api/attributes/computed/{id}

Parameters

idintegerrequiredpath

Response

OK

Response fields application/json
idinteger<int64>

Unique computed attribute identifier

descriptionstring

Human readable name of the attribute

attributestring

Attribute name used in expressions

expressionstring

Expression that defines how the attribute is calculated

typestring

String|Number|Boolean

401Unauthorized

Unauthorized

404Not Found

Not found

Authorization

BasicAuthhttp (basic)
ApiKeyhttp (bearer)

Update an Attribute

PUT
https://demo.traccar.org/api/attributes/computed/{id}

Body

application/json
idinteger<int64>

Unique computed attribute identifier

descriptionstring

Human readable name of the attribute

attributestring

Attribute name used in expressions

expressionstring

Expression that defines how the attribute is calculated

typestring

String|Number|Boolean

Parameters

idintegerrequiredpath

Response

OK

Response fields application/json
idinteger<int64>

Unique computed attribute identifier

descriptionstring

Human readable name of the attribute

attributestring

Attribute name used in expressions

expressionstring

Expression that defines how the attribute is calculated

typestring

String|Number|Boolean

400Bad Request

Bad request

401Unauthorized

Unauthorized

Authorization

BasicAuthhttp (basic)
ApiKeyhttp (bearer)

Delete an Attribute

DELETE
https://demo.traccar.org/api/attributes/computed/{id}

Parameters

idintegerrequiredpath

Response

204No Content

No Content

401Unauthorized

Unauthorized

Authorization

BasicAuthhttp (basic)
ApiKeyhttp (bearer)