URL link to a Device on the map

Kevin Hartin2 days ago

I have an external PHP process that runs every 5 mins between 6pm and 6am to detect out of hours activities on specific devices. Basically I look for ignitionOn and ignitionOff events and extract the distance travelled from the attributes to determine if it an event to report by email.

The email has a google maps link but I would prefer if there was a link that could take the customer into the server app selecting the particular device so it could be viewed in real time.

Is this at all possible or something that could be done in a future release?

Thanks,
kev

Kevin Hartin2 days ago

I see the share device feature which creates a url like

http://traccar.ws:8082?token=Rz...

but what I need to do is generate the token programatically from outside the Traccar Server app.

Is this possible?

Thanks,
kev

Anton Tananaev2 days ago

It should be possible to generate a token programatically. Web app uses the same API.

Kevin Hartinan hour ago

Anton, is there any further info to generate the token specific to loading the Device in the app?

The information about Access Token on https://www.traccar.org/traccar-api/ is somewhat brief and uninformative. I have tried to send the get request from Postman to http://traccar.ws:8082/api/session?token=USER_TOKEN, using the bearer header as per other working requests, but get a 400 Bad Request response and the following;
-75 - NegativeArraySizeException (CryptoManager:72 < TokenManager:77 < LoginService:81 < SessionResource:81 < ...)

I have scoured the resources and cannot find any reference to creating the token that links directly to the device as per the share device example.

Thanks,
Kev

Kevin Hartinan hour ago

Anton, is there any further info to generate the token specific to loading the Device in the app?

The information about Access Token on https://www.traccar.org/traccar-api/ is somewhat brief and uninformative. I have tried to send the get request from Postman to http://traccar.ws:8082/api/session?token=USER_TOKEN, using the bearer header as per other working requests, but get a 400 Bad Request response and the following;
-75 - NegativeArraySizeException (CryptoManager:72 < TokenManager:77 < LoginService:81 < SessionResource:81 < ...)

I have scoured the resources and cannot find any reference to creating the token that links directly to the device as per the share device example.

Thanks,
Kev