Драйвер API v2

Основним призначенням Driver API v2 є виведення інформації про водія. Цей API має два типи запитів – один для конкретного драйвера і один для всіх драйверів.

Запит на певний драйвер

GET /drivers/{driverId}?version=2&api_key=<...>
HOST: api.fm-track.com
Content-Type: application/json;charset=UTF-8

Наступні параметри є обов’язковими для цього запиту:

ParameterTypeDescription
driverIdStringDriver identifier
versionStringVersion of the API
api_keyStringUser 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"
        }
    ]
}

Примітка
Параметри без значень повертають “нульове” значення.

Параметри реакції описані в наступній таблиці:

ParameterTypeArrayDescriptionUnits
idStringDriver identifierText
first_nameStringThe driver’s first nameText
last_nameStringThe driver’s last nameText
addressStringThe driver's addressText
phoneStringThe driver's telephone numberText
identifiersArrayContainer for identification codes
identifierStringidentifiersIdentification codeText
typeStringidentifiersIdentification 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

Цей запит має наступні параметри:

ParameterTypeDescriptionRequired
versionStringVersion of the APIYes
api_keyStringUser identification keyYes
limitNumberHow many drivers should be included in the response
Default value: 100
Maximum value: 1000
No
continuation_tokenNumberNo
identifier_typeStringIdentification type, used to get specific driver data
Possible values:
DLT
TACHOGRAPH
WIRELESS
IBUTTON
No
identifierStringIdentification code, used to get specific driver dataNo

Приклад відповіді наведено нижче:

{
"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"
        }
    ]
    },
...
]
}

Примітка
Параметри без значень повертають “нульове” значення.

ParameterTypeArrayDescriptionUnits
countNumberHow many records are included in the response
continuation_tokenNumberDisplays from which record the data is shown if the record limit was reached
itemsArrayContainer for all drivers
idStringitemsDriver identifierText
first_nameStringitemsThe driver’s first nameText
last_nameStringitemsThe driver’s last nameText
addressStringitemsThe driver's addressText
phoneStringitemsThe driver's telephone numberText
identifiersArrayitemsContainer for identification codes
identifierStringidentifiersIdentification codeText
typeStringidentifiersIdentification code type
Possible values:
DLT
TACHOGRAPH
WIRELESS
IBUTTON
Text