20.10.2020, 12:13
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:
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)