# Eco Fleet API

The structure of Eco Fleet API is close to the user API, so we highly recommend reading [Backend API: getting started](/docs/navixy-api/user-api/backend-api.md).

The main differences are *request paths*, *authorization system* and *request format*.

## Base URL

Eco Fleet API resides in `eco_fleet` subsection of API URL. So you can determine URL to API calls like this:

* `https://api.eu.navixy.com/eco_fleet` for European Navixy ServerMate platform.
* `https://api.us.navixy.com/eco_fleet` for American Navixy ServerMate platform.

For example, to make a sensor quality API call in European Navixy ServerMate, you should use the URL:

```
{{ extra.eco_fleet_api_example_url }}/trackers/123/sensors/321/quality
```

## Auth

### Authentication

Authentication is handled by [Backend API](/docs/navixy-api/user-api/backend-api.md).

### Authorization

You should pass the session hash you obtained earlier as the `Authorization` HTTP header with `NVX` auth scheme.

Example:

```shell
$ curl -X GET '{{ extra.eco_fleet_api_example_url }}/trackers/123/sensors/321/quality' \
    -H 'Authorization: NVX 5dd33ef0ab37b6aaf2064ecdf50c4cdc'
```

## Response format

The responses are usually in `application/json` content type.\
Consult the API call documentation in question for details.

### Errors

Errors are distinguished by HTTP status code (>= 400) and follow [RFC 7807](https://datatracker.ietf.org/doc/html/rfc7807).

Example:

```json
{
  "type": "errors/default/bad-request",
  "title": "Bad Request",
  "status": 400,
  "detail": "id: must be greater than or equal to 1"
}
```

#### Common error types

* `errors/default/bad-request` - Causes: missing or invalid parameter value.
* `errors/default/unauthorized` - Causes: missing `Authorization` header or credentials are insufficient or expired.

### Date/time formats

According to [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601).

Example: `1999-12-31T23:59:59Z`.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://navixy.com/docs/navixy-api/user-api/eco-fleet-api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
