Blocking or unblocking vehicles
This API allows you to lock or unlock vehicles based on the parameters agent_id, imei, or account_id. Depending on the status provided, the vehicle will either be locked or activated. Locking or unlocking can be performed using identifiers such as the agent, IMEI, or contract number.
How to get data
Request address
To get data, use the following address: https://<server_address>/backend/api.php?
Method
POST
Request parameters
Required:
• cmd=setvehblock — command to lock or unlock the vehicle
-
node — the number of the node where the command should be executed
• status — lock status. Values:
— 0 — locked
— 1 — active (unlocked)
One of these parameters must be specified:
• agentid — agent identifier
• imei — IMEI number of the device
• accountid — contract number
Example requests
Lock vehicle by IMEI:
https://<server_address>/backend/api.php?cmd=setvehblock&status=0&imei=1231231231&node=1
|
Unlock vehicle by agentid:
https://<server_address>/backend/api.php?cmd=setvehblock&status=1&agentid=2914&node=1
|
Response
If the vehicle is successfully locked or unlocked, you will receive the following response:
{
"code": 0,
"data": [
{
"agentid": 2914,
"status": 1
}
],
"msg": "OK"
}
|
The response to the API request will include:
• code — response code. Value:
— 0 — operation successful
— other possible values: errors like 400 or 500 if issues occurred.
• data — data about the lock/unlock operation
• agentid — agent identifier for whom the status was changed
• status — vehicle status:
— 0 — locked
— 1 — active (unlocked)
• msg — message indicating the result of the operation