get_driver_bindings
To receive information about driver assignments and separations during a specified time interval, use the resource/get_driver_bindings method.
Endpoint
svc=resource/get_driver_bindings¶ms={
"resourceId": <long>,
"unitId": <long>,
"driverId": <long>,
"timeFrom": <uint>,
"timeTo": <uint>
}
This method returns a compact list of assignment and separation times with the corresponding unit IDs. Depending on the server configuration, it can use the same driver-assignment event data as the
eventsmethods, but its response remains limited to thetandufields. To retrieve the full event data, use theresource_driversdetector with events/load and events/get. To get the current assignment state, use events/get_last.
The method is a resource-intensive request, so the limit on simultaneous resource-intensive requests during one session applies to it. If the limit is reached, the error 1003 with the
LIMIT api_concurrentreason is returned. For the list of resource-intensive requests, see Limitations.
Parameters
| Parameter | Description |
|---|---|
resourceId |
Resource ID. |
unitId |
Unit ID. Use 0 for all units. |
driverId |
Driver ID. Use 0 for all drivers. |
timeFrom |
The beginning of the interval. |
timeTo |
The end of the interval. |
Response
{
"<text>": [ /* driver ID */
{
"t": <uint>, /* time of assignment/separation */
"u": <long> /* unit ID in case of assignment, 0 in case of separation */
},
...
],
...
}
Error codes
| Error code | Description |
|---|---|
| 4 | Failed to fetch the list of drivers or wrong input parameters. |
| 5 | Events are disabled or are being initialized for the resource. The reason field contains EVENTS_ARE_DISABLED or EVENTS_ARE_INITIALIZING, respectively. In Wialon Local, this error can be returned starting from version 2504. |
| 7 | No Request reports and messages or View drivers access right to the resource; no View object and its basic properties right to the unit; or the resource, unit, driver, or event service is unavailable. |