What's not working exactly? The request looks good, assuming the ids are correct.
I recorded a video explaining the issue in detail. At the beginning, I show that for some devices, the driver's name is displayed correctly, while for others, it does not appear, even after selecting the option to show the driver in the pop-up.
Next, I perform three requests:
After that, I check and confirm that the update did not take effect as expected. At the end of the video, I demonstrate that the driver is still not displayed, even after the device updates its location.
You can watch the video here: https://youtu.be/vG_j5rSd61s.
Based on the video it seems like you misunderstand what linking driver to a device does. It just means that certain driver is authorized to drive certain vehicle. To be able to see it in the popup your device needs to report driver id.
Got it! What is the Traccar endpoint and body I can use to report this driver on the device?
Your device has to do it. What device are you using?
I am using a J16 tracker ( GT06 protocol ) and want to integrate it with my website. The idea is for the driver to access the site, enter their identification and the device code, and have this information automatically sent to the tracker, updating the assigned driver.
My website is ready, but I’m stuck on how to communicate with the tracker to register the driver.
Does your device even support this functionality? Have you checked with your device vendor?
I believe so, but the main goal is to set this via API in Traccar. The idea is for the driver to access a website ( without any direct connection to the device ) to assign themselves, instead of using RFID readers or IButtons.
Then you should probably just use processing.useLinkedDriver
:
I'm trying to assign a driver to a device using the Traccar API, but the request is not working as expected. I’d like to confirm if my request is correct or if there's a different approach I should take.
Request I'm Using:
Questions:
Is this the correct endpoint for assigning a driver to a device?
Are there any prerequisites, such as specific permissions or configurations, needed for this request to work?
If this is not the correct method, what is the proper API request to link a driver to a device?
I appreciate any help! Thanks in advance.