API ttlock - 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: API ttlock (/showthread.php?tid=5235) |
API ttlock - Jose - 07.02.2024 Hello everyone I'm trying to integrate ttlock locks, but I get a little lost with the POST, GET issue I found a similar script from Husqvarna that I tried to adapt, but I get the nil message. https://forum.logicmachine.net/showthread.php?tid=4824 Code: http = require('socket.http') Has anyone managed to integrate ttlock locks? Thank you very much in advance. RE: API ttlock - admin - 08.02.2024 Use encodepost to correctly create a POST request body: https://forum.logicmachine.net/showthread.php?tid=4286&pid=27711#pid27711 In your example getAccessToken() is not called anywhere. log() must be inside of the getAccessToken() function. Otherwise certain variables like response_body won't be logged because they are local to the function and are not visible outside of it. |