Getting Started with Traccar API Development

chucrut7 months ago

I have recently set up my own Traccar server and am new to using Traccar. I am seeking some guidance on how to properly utilize the Traccar API.

Is the API a standalone file that needs to be installed, or is it a Python script that should be executed continuously? How should I begin working with the API? Additionally, is it necessary to modify and recompile the GitHub source code for development purposes?

I have done some preliminary research and found various snippets of code, but I'm unsure how to proceed from here. Could you please provide some guidance on how to start developing with the Traccar API?

Thank you!

Anton Tananaev7 months ago
chucrut7 months ago

Hello Anton, thank you for the link!

I've reviewed the Traccar API documentation, but I could use some additional guidance to get started. Specifically, do I need to write Python code to interact with the API? If so, where should this Python code be installed or executed? Any pointers on initial setup would be greatly appreciated.

Anton Tananaev7 months ago

It doesn't sound like your question is related to Traccar. Where to install and execute your own Python code is up to you. It has nothing to do with Traccar.

Victor Butler7 months ago

The API works via HTTP request methods - GET, POST, PUT, etc. How you handle the requests and the responses is up to you as Anton mentioned. That depends on the frontend that you'd like to deploy, I guess.

chucrut7 months ago

Thank you for clarifying how the API functions with HTTP request methods.

Regarding the API token, do I need to log in as an administrator on my Traccar website and navigate to the "Settings" section to generate this token?

Anton Tananaev7 months ago

You don't need to an admin. Any user can generate the token. Have you tried it before asking?

chucrut7 months ago

Thank you for the information.

I'm planning to offer GPS tracking services to potential clients and am looking to develop an API that can handle various tasks in the background. I understand that I need to incorporate a token into the Python code to facilitate this. Would a token generated by an administrator be required to access all necessary information for these purposes?

Victor Butler7 months ago

You can authenticate with a token or basicAuth (user and password).
You authenticate the user that is logged, you don't have to always use the admin credentials/token.