create new device from custom web interface

kevcar918 years ago

Hello everyone,
I am trying to register a new device from my own web interface (made in laravel); The problem itself is that when trying to see the new device from the native interface of traccar this does not appear attached to the client, unless you restart the service of traccr or doing the relationship from the native interface.

I appreciate any help.

PD: Thanks Aton for this great GPS system.

Malkit Singh8 years ago

Reason :
When you are creating this new device using API (you might be using admin credentials) and that api for creating new device associates new device with the user key provided with service.

Solution :
Here is how you should do it,

  1. Create new user (using admin credentials in api)
  2. You can create new device using newly created user or admin user.
  3. (this step is required if you are creating new device using admin credentials) link newly created device to the user id created in step one.
Anton Tananaev8 years ago

As Malkit pointed out, you have to link device to the user. There is an API for everything:

https://www.traccar.org/traccar-api/