Send command to lock or unlock a vehicle
PUT/vehicles/:registration/central-locking
This function requires a specific fitment by Cartrack. You can remotely lock or unlock the vehicle by sending the commands "UNLOCK", "UNLOCK_0", "LOCK". A device is installed in your vehicle and reproduces the keyfob signals.
- "UNLOCK": this command turns on the keyfob in the car and uses it to send the unlock command. The doors can now be opened. The keyfob stays powered up, the user can turn on the engine.
- "UNLOCK_0": this command turns on the keyfob in the car and uses it to send a different set of unlock command. The doors can now be opened. However, the keyfob will be immediately powered down, the user won't be able to turn on the engine.
- "LOCK": this command turns on the keyfob in the vehicle and it uses it to send a lock command. The doors are now locked. The keyfob is powered down immediately after, the engine can't be turned on.
Not all vehicles and devices are compatible with this function.
To prevent duplicate commands, the same command cannot be sent to the same vehicle while a previous one is still being processed (up to 30 seconds). In that case the API responds with an HTTP 409 error and a Retry-After header indicating the number of seconds to wait before retrying.
A 200 response means the instruction was queued for the terminal. A vehicle that is not on your account, or that has no active contract on a hardware type this API supports, answers 404. When the instruction could not be sent at all, because the vehicle has no terminal on its active contract or the terminal cannot currently be reached, the API answers 422 and nothing reaches the vehicle.
On a vehicle connected through its manufacturer (OEM) rather than a Cartrack device, the command is sent to the manufacturer instead: "LOCK" locks the doors, and "UNLOCK" and "UNLOCK_0" both unlock them. A 200 then means the manufacturer accepted the command, with the message "Instruction has been sent to the OEM vehicle.", and no 409 applies. When the manufacturer cannot carry out the command for this vehicle, for example a make it does not support or a vehicle with no VIN on record, the API answers 422 and a retry will not succeed. When the manufacturer could not be reached or failed to process the command, the API answers 502 and the command can be retried.
Request
Responses
- 200
- 400
- 401
- 403
- 404
- 409
- 422
- 429
- 500
- 502
- 503
Successful operation
The request body is declared as JSON but cannot be parsed, or is not a JSON object or array. Nothing was processed.
Unauthorized access. Authentication is required.
Access is forbidden. The user does not have permission to access this resource, or the account is not currently active.
The requested resource was not found.
A command of the same type was recently sent to this vehicle and is still being processed. Wait for the number of seconds indicated in the Retry-After header before sending the command again.
Response Headers
The number of seconds to wait before the command can be sent again.
Validation failed for the input parameters.
Too Many Requests - the endpoint's rate limit has been exceeded. Retry after the number of seconds in the Retry-After header.
Response Headers
Seconds to wait before retrying. The same value as X-RateLimit-Retry-After-Seconds when that wait is non-negative. If the computed wait is negative, Retry-After is floored at 0.
Unix timestamp of the next earliest successful request.
Seconds until the next earliest successful request.
Internal server error.
The vehicle is connected through its manufacturer (OEM), and the manufacturer could not be reached or failed to process the command. The command can be retried.
Service temporarily unavailable. The request did not complete and can be retried after the number of seconds in the Retry-After header, when one is sent.
Response Headers
Seconds to wait before retrying. Sent with db_busy and db_pool_timeout.