API: Dispatch commands to device

Inth6 months ago

Hi Everyone,
I need to test sending the custom commands to GPS using the API (custom commands from UI work fine). However, I have a problem because this error is returned every time:

400 Bad Request
Command access denied - SecurityException (PermissionsService:220 < CommandResource:112 < ... < OverrideFilter:50 < ...)

Below, I am sending a screenshot of the tool I am testing the API with. What am I doing wrong?

Untitled.png

Anton Tananaev6 months ago

Why is the deviceId = 0?

Inth6 months ago

I have tested on different devices, and later, by mistake, I entered 0. When I change this ID to another one, I still get the same error.

Anton Tananaev6 months ago

And what is the id 2?

Inth6 months ago

The id 2 is a custom command stored on the Traccar server, and id 3 is one of the devices.
Am I doing it wrong?

Anton Tananaev6 months ago

Looks correct. If it you still get the same error, it means you don't have access to the saved command.