bind_unit_driver

The bind_unit_driver function is used to assign drivers to units or to separate them from units.

Copied!
svc=resource/bind_unit_driver&params={"resourceId":<long>,
				      				  "unitId":<long>,
				      				  "driverId":<long>,
				      				  "time":<uint>,
				      				  "mode":<bool>
									  }

Parameters

NameDescription
resourceIdResource ID.
unitIdUnit ID.
driverId

Driver ID.

timeTime (0 — current time).
mode

Modes:

  • 1/true — assign;
  • 0/false — separate.

Returned result

If the request is successful, an empty JSON is returned.

Copied!
{ }

If not, an error code is returned. Possible error codes:

CodeDescription
7Failed to fetch the resource with the desired ACL (ADF_ACL_AVL_RES_EDIT_DRIVERS) or failed to fetch the unit with the desired ACL (ADF_ACL_ITEM_VIEW).
6Failed to assign the driver.
4

Failed to fetch the driver with the desired driverId or wrong input parameters.

Request examples

Sent request for assigning a driver:

Copied!
svc=resource/bind_unit_driver&params={"resourceId":930849,"driverId":2,"time":0,"unitId":24675341,"mode":1}

Returned result:

Copied!
{ }

Sent request for separating a driver:

Copied!
svc=resource/bind_unit_driver&params={"resourceId":930849,"driverId":2,"time":0,"unitId":24675341,"mode":0}

Returned result:

Copied!
{ }

Assign driver on Feb 07 2022 07:07:00:

Copied!
svc=resource/bind_unit_driver&params={"resourceId":930849, "driverId":17, "time":1644217620, "unitId":22361100, "mode":1}

Returned result:

Copied!
{ }

Separate driver on Feb 07 2022 09:08:00:

Copied!
svc=resource/bind_unit_driver&params={"resourceId":930849,"driverId":17,"time":1644224880,"unitId":22361100,"mode":0}

Returned result:

Copied!
{ }

You also can merge these two requests into one using core/batch:

Copied!
svc=core/batch&params={"params":[{"svc":"resource/bind_unit_driver","params":{"resourceId":930849,"driverId":17,"time":1644217620,"unitId":22361100,"mode":true}},{"svc":"resource/bind_unit_driver","params":{"resourceId":930849,"driverId":17,"time":1644224880,"unitId":22361100,"mode":false}}],"flags":0}

For the returned result, see the response section for the batch function.

Download PDF file
Download Word document

See also