Cannot use API .../api/position/get

chuxuanhy9 years ago

Hello,

I have gotten my Traccar server run successfully. Others API are working right, except the .../api/position/get, I always received response :

{
"success": false,
"error": "Invalid format: "2015-10-01T20:22:25" is too short"
}

My post data is as following :
.../api/position/get?deviceId=4&from=2015-10-01T20:22:25&to=2015-10-13T20:22:25

Please give my some advice, thanks in advance!

Anton Tananaev9 years ago

You need to use full ISO 8601 format for dates. Try to add .000Z at the end.

chuxuanhy9 years ago

Hi, the API is working now, thank you.

I have another issue with Traccar's website, every time I set lat,lng for default location at first, the map did not show up, javascript console throwed the following error to me :
Uncaught TypeError: Failed to execute 'putImageData' on 'CanvasRenderingContext2D': The provided float value is non-finite.

Please have a look at this!

Anton Tananaev9 years ago

What values did you put as default location?

chuxuanhy9 years ago

I put following values in 3 forms :
Lat:10.798
Lng:106.709
Zoom:12

Anton Tananaev9 years ago

Try to switch latitude and longitude (lat = 106.709, lon = 10.798).

webtechanand8 years ago

Hi chuxuanhy

Can you please let me know which date format exactly worked for you.
I am also stucked in same situation.

An example will be very helpful

Murthy Varanasi5 years ago

when i use the positions api i get a list of values ,how can i just filter lat and long values