HTTP GET with authorisation - Printable Version +- Logic Machine Forum (https://forum.logicmachine.net) +-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1) +--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8) +--- Thread: HTTP GET with authorisation (/showthread.php?tid=444) |
HTTP GET with authorisation - buuuudzik - 29.10.2016 Hello, I want integrate with Traccer server. This server give the JSON when I log in and brows such address: http://demo.traccar.org/api/positions/ But for LM communication I must have some authorisation. What should I add to this script? Code: -- load required modules Code: * arg: 1 Login is an email so it has '@'. RE: HTTP GET with authorisation - admin - 31.10.2016 200 status means that requests work correctly, you just have to get the response like this: Code: -- load required modules RE: HTTP GET with authorisation - buuuudzik - 31.10.2016 It works perfectly RE: HTTP GET with authorisation - Domoticatorino - 04.11.2016 Hi Buuuuudzik, the first code is saved as user script? What about the second script? How is it managed? Thanks. Do you use it for geofencis? Because it seems Traccar does not support geofencis. Thank you for your help. Regards. RE: HTTP GET with authorisation - buuuudzik - 04.11.2016 (04.11.2016, 17:27)Domoticatorino Wrote: Hi Buuuuudzik, Traccar has 2 applications: - server (you can use demo server or you can install server on your pc) or you can use LM as a server for clients, - clients (iOS, Android etc.) (you can set interval for sending data to server) This is the example respond from the server: * string: [{"id":123141121,"attributes":{"battery":"0","ip":"37.47.0.6","distance":0.0,"totalDistance":4.865613311E7},"deviceId":34294,"type":null,"protocol":"osmand","serverTime":null,"deviceTime":"2016-10-30T08:05:35.000+0000","fixTime":"2016-10-30T08:05:35.000+0000","outdated":false,"valid":true,"latitude":50.98288,"longitude":23.170059,"altitude":185.619,"speed":0.0,"course":0.0,"address":null}] You have this data from server and for example you can use it for detecting how far some person is from home etc. For Geofencing you must use additionally some other server which converts latitude and longtitude into e.g. city. RE: HTTP GET with authorisation - Domoticatorino - 05.11.2016 Thank you. But what is the procedure to install the server on LM? Please consider that I am using Homelynk by Schneider. Thank you? RE: HTTP GET with authorisation - edgars - 15.11.2016 Here is a ready example for Geolocalization with LogicMachine based on Traccar service: http://openrb.com/geolocalization-with-lm-based-on-traccar-service Thanks to buuuudzik for this nice step-by-step guide! RE: HTTP GET with authorisation - Domoticatorino - 06.12.2016 Hi Edgards, Does it work with iPhone only? RE: HTTP GET with authorisation - buuuudzik - 07.12.2016 No, it works on iphone and android and on a lot of professional gps trackers. Look here for information about mobile clients: https://www.traccar.org/client/ List of GPS tracking devices and applications supported by Traccar server: https://www.traccar.org/devices/ RE: HTTP GET with authorisation - gjniewenhuijse - 07.12.2016 battery drain is very high on iphones |