API Documentation inconsistencies

memesaregooda year ago

Users

An API endpoint is described as one returning a list of users, and it does it only when there's no parameters passed. When you pass a userId, it returns nothing:

GET https://demo.traccar.org/api/users?userId=1 // [ ]

The docs also don't mention that if you pass a userId as a path parameter, the endpoint will actually return the required user data (applies for Create and Update endpoints too):

GET https://demo.traccar.org/api/users/1 // {"id":1, ...}

The documentation also doesn't describe the login and disableReports keys, however they are returned by the Traccar server when interacting with the users and session endpoints.

Devices

Same as User: the docs don't tell you that you can request device information by passing the id as a path parameter:

GET https://demo.traccar.org/api/devices/1 // {"id":1, ...}

The expirationTime field is missing from the response samples as well, however is returned by the Traccar Server.

Groups

Same as User and Device: the docs don't tell you that you can request group information by passing the id as a path parameter:

GET https://demo.traccar.org/api/groups/1 // {"id":1, ...}

Permissions

Missing fields maintenanceId and commandId, however those are used in group, device and user connections. Can only be the second parameter.

I'm pretty sure the documentation wasn't properly updated after one of the releases. Things happen. I'll be reporting more of those as soon as I find them.

P.S. what is users' login field used for?

Anton Tananaeva year ago

Feel free to send pull requests for the API documentation.

memesaregooda year ago

Where to? I don't see the docs folder in the repository.

memesaregooda year ago

Oh, that's a Swagger. Alright.

What is users' login field used for?

Anton Tananaeva year ago

Login is used for LDAP only, as far as I remember.