Основним призначенням Driver API v2 є виведення інформації про водія. Цей API має два типи запитів – один для конкретного драйвера і один для всіх драйверів.
Запит на певний драйвер
GET /drivers/{driverId}?version=2&api_key=<...>
HOST: api.fm-track.com
Content-Type: application/json;charset=UTF-8
Наступні параметри є обов’язковими для цього запиту:
| Parameter | Type | Description |
|---|---|---|
| driverId | String | Driver identifier |
| version | String | Version of the API |
| api_key | String | User identification key |
Приклад відповіді наведено нижче:
{
"id": "ABC123",
"first_name": "Driver",
"last_name": null,
"address": "Lithuania, Vilnius",
"phone": "+3700000000",
"identifiers": [
{
"identifier": "343234323432342",
"type": "DLT"
},
{
"identifier": "123456789",
"type": "TACHOGRAPH"
},
{
"identifier": "3AC64785D2FF",
"type": "WIRELESS"
},
{
"identifier": "123456789",
"type": "IBUTTON"
}
]
}
Примітка
Параметри без значень повертають “нульове” значення.
Параметри реакції описані в наступній таблиці:
| Parameter | Type | Array | Description | Units |
|---|---|---|---|---|
| id | String | Driver identifier | Text | |
| first_name | String | The driver’s first name | Text | |
| last_name | String | The driver’s last name | Text | |
| address | String | The driver's address | Text | |
| phone | String | The driver's telephone number | Text | |
| identifiers | Array | Container for identification codes | ||
| identifier | String | identifiers | Identification code | Text |
| type | String | identifiers | Identification code type Possible values: DLT TACHOGRAPH WIRELESS IBUTTON | Text |
Прохання до всіх водіїв
GET /drivers?version=2&api_key=<...>&limit=<...>&continuation_token=<...>&identifier_type=<...>&identifier=<...> HOST: api.fm-track.com Content-Type: application/json;charset=UTF-8
Цей запит має наступні параметри:
| Parameter | Type | Description | Required |
|---|---|---|---|
| version | String | Version of the API | Yes |
| api_key | String | User identification key | Yes |
| limit | Number | How many drivers should be included in the response Default value: 100 Maximum value: 1000 | No |
| continuation_token | Number | No | |
| identifier_type | String | Identification type, used to get specific driver data Possible values: DLT TACHOGRAPH WIRELESS IBUTTON | No |
| identifier | String | Identification code, used to get specific driver data | No |
Приклад відповіді наведено нижче:
{
"count": 100,
"continuation_token": 123,
"items": [
{
"id": "ABC123",
"first_name": "Driver",
"last_name": null,
"address": "Lithuania, Vilnius",
"phone": "+3700000000",
"identifiers": [
{
"identifier": "343234323432342",
"type": "DLT"
},
{
"identifier": "123456789",
"type": "TACHOGRAPH"
},
{
"identifier": "3AC64785D2FF",
"type": "WIRELESS"
},
{
"identifier": "123456789",
"type": "IBUTTON"
}
]
},
...
]
}
Примітка
Параметри без значень повертають “нульове” значення.
| Parameter | Type | Array | Description | Units |
|---|---|---|---|---|
| count | Number | How many records are included in the response | ||
| continuation_token | Number | Displays from which record the data is shown if the record limit was reached | ||
| items | Array | Container for all drivers | ||
| id | String | items | Driver identifier | Text |
| first_name | String | items | The driver’s first name | Text |
| last_name | String | items | The driver’s last name | Text |
| address | String | items | The driver's address | Text |
| phone | String | items | The driver's telephone number | Text |
| identifiers | Array | items | Container for identification codes | |
| identifier | String | identifiers | Identification code | Text |
| type | String | identifiers | Identification code type Possible values: DLT TACHOGRAPH WIRELESS IBUTTON | Text |