Try leaving accept header empty.
Empty is the same of application/json
I use gpx+xml for obtain gpx
For GPX you need to provide device id, from and to values.
i have just try but the problem is the same
curl "https://track.mysite.it/api/positions" -H "authorization: Basic myAuth" -H "accept: application/gpx+xml" -H "from: 2019-03-21T08:00:00Z" -H "to: 2019-03-21T13:00:00Z" -H "deviceid: myDeviceId"
NullPointerException (PositionResource:90 < ...)
I think you should read documentation a little bit more.
ok, I'll read the documentation again.
thank you
SOLVED
thanks for the help and work you've done. sorry for the newbie question.
curl "https://track.mysite.it/api/positions?deviceid=myDeviceId&from=2019-03-21T08:00:00Z&to=2019-03-21T13:00:00Z" -H "authorization: Basic myAuth" -H "accept: application/gpx+xml"
Hello !
When I type your last command in Windows command line I receive a connection refused error.
Maybe it works only in a full php or python script.
Can someone provide the code he uses to download a gpx file ? I will replace url, deviceid, from and to download my file.
The following code is written in Python and could do this.
https://github.com/zhaofeng-shu33/traccar_gps/tree/067c0807e5e26446e81fd3687928432d7902f676
I'm trying the comand indicated by Mirko M. two years ago, with the "accept: application/gpx+xml" header:
curl "http://my.server.org:8072/api/positions?deviceId=3&from=2021-04-07T00:00:00.000Z&to=2021-12-31T23:59:59.000Z" -H "authorization: Basic myAuthorization" -H "accept: application/gpx+xml"
but I get the error:
HTTP 406 Not Acceptable - NotAcceptableException (...)
If I send the command using header "accept: application/json" the command executes correctly (returning json format), so the call is correctly formatted and the connection is correct, but I can't get the GPX format.
Is still supported the "application/gpx+xml" format to get a GPX file? What am I missing?
What version are you using? It has been removed recently.
I'm using traccar as a Home Assistant Add-on. The traccar version is v4.12.
Also tried https://demo3.traccar.org/ with the same result. I don't know wich version is installed in the demo server.
If this functionality has been removed, is there any way to export gpx or similar format?
You can export in JSON via API.
Hi,
I recive this error:
when i execute this:
this works:
can someone help me?
thanks!