Demo server 3 - rest api response 400

Martin5 years ago

Hi,

Calling the api method with basic http authorization on Demo server 3 results in Bad Request 400 response.

The same call on Demo 1 server, with the same login credentials, works well, because I am registered on Demo 1.

When I make the same api call on other two servers, it results in 401 unathorized, because I am not registered on these servers.

What is the API version on Demo server 3? What is wrong?

Thanks
Martin

GET Request: http://demo3.traccar.org/api/positions
User-Agent: Fiddler
Host: demo3.traccar.org
Authorization: Basic base64(username:pw)

Response:

HTTP/1.1 400 Bad Request
Date: Wed, 03 Jun 2020 15:07:30 GMT
Content-Type: application/gpx+xml
access-control-allow-headers: origin, content-type, accept, authorization
access-control-allow-credentials: true
access-control-allow-methods: GET, POST, PUT, DELETE, OPTIONS
access-control-allow-origin: *
Content-Length: 104
Server: Jetty(9.4.26.v20200117)

Manager access required - SecurityException (PermissionsManager:178 < *:308 < PositionResource:89 < ...)
Anton Tananaev5 years ago

Include accept header or try different endpoint.

Martin5 years ago

Works like a charm, thanks.

Accept: application/json

I did not try to alter the headers before, because the call was working on Demo 1(and apparently also on Demo 2 and Demo 4).

Still something must be different on Demo 3 than on other servers, but it works and that's important.