vitalidze / traccar-web

Traccar Web UI mod
http://traccar.litvak.su/
152 stars 145 forks source link

Data service methods #769

Open WalrusHat opened 8 years ago

WalrusHat commented 8 years ago

How do I call this method in dataservice.java?

void saveDeviceShare(Device device, Map<User, Boolean> share);

I found that it is requesting from /traccar/dataservice but when I tried to send an array of the parameters to /traccar/dataservice I got a 500 error. Is there a specific way to call this method? if so how?

I had the same question for this method for drives and stops: List getReports();

WalrusHat commented 8 years ago

mmk I figured it out! Just in-case no one knows how:

I found by POST'ing to url: /traccar/rest/saveDeviceShare works like a charm!

Im working on figuring out how to unshare the devices now.

vitalidze commented 8 years ago

To "unshare" devices you need to post request with a map that does not contain desired user.

As for getReports() method there is no way to call it currently.

WalrusHat commented 8 years ago

Thank for all the help Vitalidze! I'm donating to your link!