For the complete documentation index, see llms.txt. This page is also available as Markdown.

Counters

Odometer and engine-hour counters on a tracker, and the values they hold.

A counter accumulates a quantity for a tracker over its lifetime, such as distance travelled or engine running time. Unlike a sensor reading, which reports what is true now, a counter carries a running total that can be corrected when it drifts from the vehicle's own instrument.

Counters split into two things, and the operations follow that split. The counter itself is the entity and its multiplier, read and changed with counter/read and counter/update. Its value is separate, read and set through counter/value. For a worked example, see how to retrieve sensor and counter data.

API actions

Counter entities live under /tracker/counter, and their values under /tracker/counter/value. One call, get_counters, sits at the tracker root instead.


Read a counter

post
/tracker/counter/read

Get one of a tracker's counters, meaning the entity and its multiplier rather than its current value. Use counter/value/get for the value. Available to demo accounts.

Authorizations
AuthorizationstringRequired

Either a user session hash or an API key, with the "NVX " prefix, for example "NVX 22eac1c27af4be7b9d04da2ce1af111b". Obtain a session hash from the userAuth operation, or create an API key from the API keys operations. A small number of operations accept a session hash only and reject an API key with error code 4; each says so in its description.

Body
tracker_idintegerRequired

ID of the tracker, also known as the object ID. Must belong to the current account and not be blocked.

Example: 123456
typestring · enumRequired

Which counter to act on.

Example: odometerPossible values:
Responses
200

The counter

application/json
successbooleanRead-onlyOptional

true if request finished successfully.

Example: true
post/tracker/counter/read
POST /v2/tracker/counter/read HTTP/1.1
Host: api.eu.navixy.com
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 39

{
  "tracker_id": 123456,
  "type": "odometer"
}
{
  "success": true,
  "value": {
    "id": 111,
    "type": "odometer",
    "multiplier": 1
  }
}

Errors

These errors come in addition to the general error codes:

  • 204 - No tracker with this ID belongs to the account.

  • 208 - The tracker exists but is blocked, normally because its tariff ended.

  • 219 - The tracker is a clone.


Update a counter

post
/tracker/counter/update

Change a counter's multiplier, and for the odometer the sensor it reads from.

sensor_id applies only when type is odometer, and must be null otherwise. The sensor must be a metering sensor belonging to this same tracker; every one of those conditions is reported as error 7.

Requires the tracker_update right.

Authorizations
AuthorizationstringRequired

Either a user session hash or an API key, with the "NVX " prefix, for example "NVX 22eac1c27af4be7b9d04da2ce1af111b". Obtain a session hash from the userAuth operation, or create an API key from the API keys operations. A small number of operations accept a session hash only and reject an API key with error code 4; each says so in its description.

Body
tracker_idintegerRequired

ID of the tracker, also known as the object ID. Must belong to the current account and not be blocked.

Example: 123456
typestring · enumRequired

Which counter to act on.

Example: odometerPossible values:
multipliernumberRequired

New multiplier for the counter.

Example: 1.34
sensor_idinteger · nullableOptional

Sensor to use as the odometer source. Must be null unless type is odometer.

Example: 123
Responses
200

The counter was updated

application/json
successbooleanRead-onlyOptional

true if request finished successfully.

Example: true
post/tracker/counter/update
POST /v2/tracker/counter/update HTTP/1.1
Host: api.eu.navixy.com
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 73

{
  "tracker_id": 123456,
  "type": "odometer",
  "multiplier": 1.34,
  "sensor_id": 123
}
{
  "success": true
}

Errors

These errors come in addition to the general error codes:

  • 7 - sensor_id was given for a counter whose type is not odometer, or the sensor is not a metering sensor, or it belongs to another tracker.

  • 8 - The queue service could not accept the change, retry later.

  • 204 - No tracker with this ID belongs to the account.

  • 208 - The tracker exists but is blocked, normally because its tariff ended.

  • 219 - The tracker is a clone.


Read all counter values

post
/tracker/get_counters

Get the last value of every counter on a tracker. Available to demo accounts.

Note the path: this one sits at the tracker root, not under tracker/counter.

Authorizations
AuthorizationstringRequired

Either a user session hash or an API key, with the "NVX " prefix, for example "NVX 22eac1c27af4be7b9d04da2ce1af111b". Obtain a session hash from the userAuth operation, or create an API key from the API keys operations. A small number of operations accept a session hash only and reject an API key with error code 4; each says so in its description.

Body
tracker_idintegerRequired

ID of the tracker, also known as the object ID. Must belong to the current account and not be blocked.

Example: 123456
Responses
200

The counter values

application/json
successbooleanRead-onlyOptional

true if request finished successfully.

Example: true
user_timestringOptional

Current time in the account timezone.

post/tracker/get_counters
POST /v2/tracker/get_counters HTTP/1.1
Host: api.eu.navixy.com
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 21

{
  "tracker_id": 123456
}
{
  "success": true,
  "user_time": "text",
  "list": [
    {
      "type": "odometer",
      "value": 100500.1,
      "update_time": "2014-03-06 13:57:00"
    }
  ]
}

Errors

These errors come in addition to the general error codes:

  • 204 - No tracker with this ID belongs to the account.

  • 208 - The tracker exists but is blocked, normally because its tariff ended.


Read one counter value

post
/tracker/counter/value/get

Get the current value of one counter. Available to demo accounts.

Error 204 covers three different situations: no such tracker, no such counter, and a counter that exists but has no values yet. Use counter/value/set to create a counter and give it a first value.

Authorizations
AuthorizationstringRequired

Either a user session hash or an API key, with the "NVX " prefix, for example "NVX 22eac1c27af4be7b9d04da2ce1af111b". Obtain a session hash from the userAuth operation, or create an API key from the API keys operations. A small number of operations accept a session hash only and reject an API key with error code 4; each says so in its description.

Body
tracker_idintegerRequired

ID of the tracker, also known as the object ID. Must belong to the current account and not be blocked.

Example: 123456
typestring · enumRequired

Which counter to act on.

Example: odometerPossible values:
Responses
200

The counter value

application/json
successbooleanRead-onlyOptional

true if request finished successfully.

Example: true
valuenumberOptional

The current value.

Example: 18.9
post/tracker/counter/value/get
POST /v2/tracker/counter/value/get HTTP/1.1
Host: api.eu.navixy.com
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 39

{
  "tracker_id": 123456,
  "type": "odometer"
}
{
  "success": true,
  "value": 18.9
}

Errors

These errors come in addition to the general error codes:

  • 204 - No tracker with this ID belongs to the account.

  • 208 - The tracker exists but is blocked, normally because its tariff ended.


Read one counter across several trackers

post
/tracker/counter/value/list

Get the current value of the same counter on many trackers. Available to demo accounts.

Authorizations
AuthorizationstringRequired

Either a user session hash or an API key, with the "NVX " prefix, for example "NVX 22eac1c27af4be7b9d04da2ce1af111b". Obtain a session hash from the userAuth operation, or create an API key from the API keys operations. A small number of operations accept a session hash only and reject an API key with error code 4; each says so in its description.

Body
trackersinteger[]Required

Tracker IDs.

Example: [123456,234567]
typestring · enumRequired

Which counter to act on.

Example: odometerPossible values:
Responses
200

The counter values

application/json
successbooleanRead-onlyOptional

true if request finished successfully.

Example: true
post/tracker/counter/value/list
POST /v2/tracker/counter/value/list HTTP/1.1
Host: api.eu.navixy.com
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 46

{
  "trackers": [
    123456,
    234567
  ],
  "type": "odometer"
}
{
  "success": true,
  "value": {
    "ANY_ADDITIONAL_PROPERTY": 1
  }
}

Errors

These errors come in addition to the general error codes:

  • 204 - One of the counters does not exist or has no values yet.

  • 217 - The list names trackers that do not exist or are blocked.


Set a counter value

post
/tracker/counter/value/set

Set a counter's value, creating the counter if it does not exist yet. This is the call that seeds a counter so value/get stops answering error 204.

Requires the tracker_update right.

Authorizations
AuthorizationstringRequired

Either a user session hash or an API key, with the "NVX " prefix, for example "NVX 22eac1c27af4be7b9d04da2ce1af111b". Obtain a session hash from the userAuth operation, or create an API key from the API keys operations. A small number of operations accept a session hash only and reject an API key with error code 4; each says so in its description.

Body
tracker_idintegerRequired

ID of the tracker, also known as the object ID. Must belong to the current account and not be blocked.

Example: 123456
typestring · enumRequired

Which counter to act on.

Example: odometerPossible values:
valuenumberRequired

New value for the counter.

Example: 233.21
Responses
200

The value was set

application/json
successbooleanRead-onlyOptional

true if request finished successfully.

Example: true
post/tracker/counter/value/set
POST /v2/tracker/counter/value/set HTTP/1.1
Host: api.eu.navixy.com
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 54

{
  "tracker_id": 123456,
  "type": "odometer",
  "value": 233.21
}
{
  "success": true
}

Errors

These errors come in addition to the general error codes:

  • 8 - The queue service could not accept the change, retry later.

  • 204 - No tracker with this ID belongs to the account.

  • 208 - The tracker exists but is blocked, normally because its tariff ended.

  • 219 - The tracker is a clone.


Read counter history

post
/tracker/counter/data/read

Get a counter's recorded values over a period. Available to demo accounts.

The period cannot exceed 31 days, and from must precede to; both are reported as error 7 rather than as the more general error 211.

Authorizations
AuthorizationstringRequired

Either a user session hash or an API key, with the "NVX " prefix, for example "NVX 22eac1c27af4be7b9d04da2ce1af111b". Obtain a session hash from the userAuth operation, or create an API key from the API keys operations. A small number of operations accept a session hash only and reject an API key with error code 4; each says so in its description.

Body
tracker_idintegerRequired

ID of the tracker, also known as the object ID. Must belong to the current account and not be blocked.

Example: 123456
typestring · enumRequired

Which counter to act on.

Example: odometerPossible values:
fromstringRequired

Start of the period.

Example: 2021-02-25 12:21:17
tostringRequired

End of the period. At most 31 days after from.

Example: 2021-03-25 12:21:17
Responses
200

The counter history

application/json
successbooleanRead-onlyOptional

true if request finished successfully.

Example: true
post/tracker/counter/data/read
POST /v2/tracker/counter/data/read HTTP/1.1
Host: api.eu.navixy.com
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 95

{
  "tracker_id": 123456,
  "type": "odometer",
  "from": "2021-02-25 12:21:17",
  "to": "2021-03-25 12:21:17"
}
{
  "success": true,
  "list": [
    {
      "value": 3835.52,
      "update_time": "2021-02-01 02:52:55"
    }
  ]
}

Errors

These errors come in addition to the general error codes:

  • 7 - from is after to, or the period exceeds 31 days. Reported as error 7 rather than the more general error 211.

  • 204 - No such tracker or counter.

  • 208 - The tracker exists but is blocked, normally because its tariff ended.

  • 211 - The period is longer than the Navixy platform allows.

Last updated

Was this helpful?