API za upravljačke programe v2

Glavna svrha Driver API v2 je prikaz informacija o vozaču. Ovaj API ima dvije vrste zahtjeva – jedan za određeni vozač i jedan za sve vozače.

Zahtjev za određenog vozača

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

Sljedeći parametri su obavezni za ovaj zahtjev:

ParameterTypeDescription
driverIdStringDriver identifier
versionStringVersion of the API
api_keyStringUser identification key

Primjer odgovora prikazan je u nastavku:

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

Bilješka
Parametri bez vrijednosti vraćaju vrijednost „null”.

Parametri odgovora opisani su u sljedećoj tablici:

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

Zahtjev za sve vozače

GET /drivers?version=2&api_key=<...>&limit=<...>&continuation_token=<...>&identifier_type=<...>&identifier=<...>
HOST: api.fm-track.com
Content-Type: application/json;charset=UTF-8

Ovaj zahtjev ima sljedeće parametre:

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

Primjer odgovora prikazan je u nastavku:

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

Bilješka
Parametri bez vrijednosti vraćaju vrijednost „null”.

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