07.01.2021, 23:20
(20.10.2020, 12:13)admin Wrote: Unify API is done via HTTP requests. You need to send one request for login, get a cookie value from it and pass this cookie to any other requests after that.
Here's an example that can be used as a starting point: https://forum.logicmachine.net/showthrea...3#pid18233
The difference is that this example uses standard POST whereas Unify communicates via raw POST / JSON. Like this:
Code:http = require('socket.http')
json = require('json')
login_url = 'https://IP:8443/api/login'
data = json.encode({
username = user,
password = pass,
})
res, err, hdrs = http.request(login_url, data)
log(res, err, hdrs)
Finally got around to get credentials and actually test this out. With the help from your example I managed to fetch a list over active clients. Thank you very much!