Send commands to a tracker
On this page, we will guide you through the process of sending commands to your trackers.
⚠️ Currently, this feature is exclusively available for trackers registered using Targa.
To get started, you'll need to register a tracker.
Once registered and validated that is connected, you can send commands to it.
We offer commands for lock/unlock doors and block/unblock engine.
Sending these commands to the trackers is a straightforward and intuitive process.
Let's explore some examples:
Lock tracker's doors:
Send a POST request with the command to execute like this:
POST /commands/tracker/<tracker_oid>/send_command?command_name=DOOR_LOCKED
The request answer is status_code:204 if the command was sent successfully.
Once the command was sent, you need to ask the command_status endpoint for the command that you need information of, to know if the tracker executed the command, like this:
GET /commands/tracker/<tracker_oid>/send_command?command_name=DOOR_LOCKED
If the command was executed by the tracker you will have a status_code:200 and body:
{
"msg": "Command Executed",
"data": {
"command_status": true,
"datetime": "2023-10-27T09:08:57.000000+00:00"
}
}
If the tracker did not execute the command you will have a status_code:204
- Unlock tracker's doors: POST /commands/tracker/421dea32-6759-11ee-8c99-0242ac120002/send_command?command_name=DOOR_UNLOCKED
- Lock tracker's engine: POST /commands/tracker/421dea32-6759-11ee-8c99-0242ac120002/send_command?command_name=ENGINE_BLOCK_ON
- Unlock tracker's engine: POST /commands/tracker/421dea32-6759-11ee-8c99-0242ac120002/send_command?command_name=ENGINE_BLOCK_OFF
The response of the endpoint is OK if the command was send correctly.
To know if the tracker executed the command you have to ask the command_status endpoint for the status of the command like this:
Should you have any questions or require further assistance, please don't hesitate to reach out to us at [email protected]
Updated about 1 year ago