Please make sure you carefully read our API documentation. There's no JSON body. You have to send query parameters.
I am an idiot, thanks!!
I no longer get the error ( get a 204 in return), the ULR seems correctly built:
http://x.x.x.x:8082/api/positions?deviceId=1111&from=2023-04-19T22:00:00Z&to=2023-04-20T22:00:00Z
This should delete all points of device 1111 for today, but they are not deleted. Am I doing something wrong?
Maybe some timezone issue. Have you tried removing longer period?
Yes, same issue, I tried with a full week. I will test further and let you know if I am able to find what the issue could be. Thanks!
You can enable SQL query logging and see what is actually executed.
Hi,
This is what I see in the logs:
2023-04-20 22:47:39 INFO: SELECT * FROM tc_users WHERE email = :email OR login = :login
2023-04-20 22:47:39 INFO: SELECT * FROM tc_users WHERE id = :id
2023-04-20 22:47:39 INFO: DELETE FROM tc_positions WHERE deviceId = :deviceId AND fixTime BETWEEN :from AND :to
Is there a way to see the actual values? Thanks!
I don't think so. Are you sure the device id you're using is correct?
OK I see now my mistake. I wasn't using the device Id but the identifier.
What is the difference between the "identifier", "id" and "device id"?
Thanks for your support!!
External id is called "uniqueId". Everything else is referring in the internal id, which is the index in the table.
OK, it's clear now. Thanks again!
First of all, allow me to thank you for your wonderful work on Traccar!
I am trying to use the delete API (Traccar 5.7) on the /api/positions end point, I get this error:
The body of my DELETE request is
{ "deviceId": "12345", "from": "2023-04-19T22:00:00Z", "to": "2023-04-20T22:00:00Z" }
I tried this request from Node Red and Postman, same error.
Any ideas what I could be doing wrong?
Thanks for your help!
Alex