31.08.2015, 13:21
Thank you for your reply.
I tried this but it didn't work because as I saw in the API documentation, you have first to login to the synology like this:
GET /webapi/auth.cgi?
api=SYNO.API.Auth&method=Login&version=2&account=USERNAME&passwd=PASSWORD&session=SurveillanceStation&format=sid
or in LUA according to your example, it will be something like this:
Then you have to get the sid that will be returned as a response to the above request (GET) command and use it to all other calls you made like this:
Now in order to insert in the string above the sid response that I would have previously get as data, should I try something like this?:
local request_body = "http://1.2.3.4/webapi/entry.cgi?mailEnable=1_sid=".. data
and then send this?:
data = socket.http.request(request_body)
??
I tried this but it didn't work because as I saw in the API documentation, you have first to login to the synology like this:
GET /webapi/auth.cgi?
api=SYNO.API.Auth&method=Login&version=2&account=USERNAME&passwd=PASSWORD&session=SurveillanceStation&format=sid
or in LUA according to your example, it will be something like this:
Code:
data = socket.http.request('http://1.2.3.4/webapi/auth.cgi?api=SYNO.API.Auth&method=Login&version=2&
account=USERNAME&passwd=PASSWORD&session=SurveillanceStation&format=sid')
Then you have to get the sid that will be returned as a response to the above request (GET) command and use it to all other calls you made like this:
Code:
data = socket.http.request('http://1.2.3.4/webapi/entry.cgi?mailEnable=1_sid=Jn5dZ9aS95wh2')
Now in order to insert in the string above the sid response that I would have previously get as data, should I try something like this?:
local request_body = "http://1.2.3.4/webapi/entry.cgi?mailEnable=1_sid=".. data
and then send this?:
data = socket.http.request(request_body)
??