×

Create driver

This API allows you to add a new driver to the system or update an existing driver’s information. You can specify the full name, iButton code, contact information, driver’s license number, and a list of objects the driver has access to.

How to get data

Method

 GET

Request address

To get the data, use the address: https://<server_address>/api/api.php?

Request parameters

  • cmd=drivers_add — command to add or update a driver
  • name — driver’s full name
  • code — driver’s iButton code (required)
  • description — driver description (optional)
  • phone — driver’s phone number (optional)
  • license — driver’s license number (optional)
  • email — driver’s email address
  • access — comma-separated list of object IDs (agent_id) the driver is allowed to access
  • node — node number where the command should be executed
If a driver with the specified parameters already exists, the API will update their data. If not, a new driver will be created.

Example request

https://<server_address>/api/api.php?cmd=drivers_add&name=NewDriverName&code=123456&description=DESCR&phone=122212343&license=rrr3335552&email=new@email.com&access=1122,3344&node=1
Response
{
  "code": 0,
  "data": {
     "id": 16990,
     "name": "NewDriverName",
     "code": "123456",
     "description": "DESCR",
     "phone": "122212343",
     "license": "rrr3335552",
     "email": "new@email.com",
     "access": [1122, 3344]
  }
}
In response to the API request, the following is returned:
  • id — unique driver ID
  • name — full name of the driver
  • code — iButton code of the driver
  • description — driver description
  • phone — phone number
  • license — driver’s license number
  • email — email address
  • access — list of object IDs the driver has access to