-
Notifications
You must be signed in to change notification settings - Fork 145
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updating Devices Through API #753
Comments
This request is working using the GWT RPC protocol. It transfers data in special compact format. You should not be using such format when you are working with the RESTful API. You should post your messages in JSON instead. Find examples here: http://traccar.litvak.su/features/rest-api.html |
It looks correct. What do you get in response to this request? Which fields are not updated? |
Thats the thing. I didn't get any response at all other then the "200 ok" I am trying to update the device name |
where is says "name" : iris |
I see. What do you have on the "Response" tab? |
it didn't return anything at all |
Well, I am out of ideas. It should return you the updated device profile in JSON format. I will try to reproduce it myself later. |
any luck? |
It does not work for me either. I have found a bug in the code. Will try to fix it in nearest future. |
I have fixed issue in code. Also I have a workaround for current version. The root cause is incorrect deserialisation of Here is an example request I have been sending to my demo site, which works:
Please note the format of "iconType" : "DEFAULT" And in response: "iconType" : {
"OFFLINE" : {
"width" : 21,
"height" : 25,
"urls" : [ "img/marker-white.png", "img/marker-green.png" ]
},
"LATEST" : {
"width" : 21,
"height" : 25,
"urls" : [ "img/marker.png", "img/marker-green.png" ]
}
} This format of request will work in both new and current versions. In newer version there will be a new field called "iconType" : {
"type" : "DEFAULT",
"OFFLINE" : {
"width" : 21,
"height" : 25,
"urls" : [ "img/marker-white.png", "img/marker-green.png" ]
},
"LATEST" : {
"width" : 21,
"height" : 25,
"urls" : [ "img/marker.png", "img/marker-green.png" ]
}
} All responses will contain the Hope this helps. |
Awesome! Let me give it a shot! |
Im getting 500 errors when i send |
You should check |
wrapper.log is just throwing empty email field warnings. I haven't tried tried cURL.... I'm posting with ajax and javascript. |
Then you should have some text in reply for the 500 error. I guess your request is incorrect. |
Hey Vitalidze!
quick issue! Im trying to update my devices through AJAX and Javascript. When I update through the web UI it sends off this header:
7|0|17|http://MyServer:8082/traccar/|48ACB3167486C154BB2793684679C460|org.traccar.web.client.model.DataService|updateDevice|org.traccar.web.shared.model.Device/1329600652|chinese device|org.traccar.web.shared.model.Group/3338357041|Test|90EE90|DEDEDE|F3F500|FF0000|org.traccar.web.shared.model.DeviceIconMode/752598484|org.traccar.web.shared.model.DeviceIconType/3813480130|java.util.ArrayList/4159755760|irisE|4109137594|1|2|3|4|1|5|5|0|0|6|7|0|0|E|8|0|9|10|11|10|12|13|0|1|14|0|E|0|0|15|0|60|16|0|0|0|0|15|0|1|1|1|0|0|300|17|0|
So I have been sending POST request to: "traccar/rest/updateDevice" and I get back a "200 ok" response but nothing is updated. Any help?
The text was updated successfully, but these errors were encountered: