Sorry i do not speak french, i use ggogle translate for reading all the question and anwers
For dsm 7.0 you need the did also did
did + sid to login
for login in succefully use did and sid on dsm 7.0
get did +sid
local url = "http://"..self:getVariable("Ip Address")..":"..self:getVariable("Port").."/webapi/auth.cgi?api=SYNO.API.Auth&version=3&method=login&account="..self:getVariable("Username").."&passwd="..self:getVariable("Password").."&format=cookie'"
[17.07.2021] [00:23:02] [DEBUG] [QUICKAPP69]: {"data":{"did":"4bQC0a6TjavIr8tltUIRFk4gDWam50OrEBRwFe9A09sONyfvMcbRhO0Qn1Va_CxFjBh7PI9tK8w1p557RuoJ9w","sid":"uyYAWDjcpI1qSycfU-3rt7xf48hspucxB37_5Ut84OwByNHK-03Pnx3IQpccqg40hTKwc937VKfQpkIT8zbY8Y"},"success":true}
example for shutdown synlogy with did and sid
"http://"..self:getVariable("Ip Address")..":"..self:getVariable("Port").."/webapi//entry.cgi?api=SYNO.Core.System&version=1&method=shutdown&_did="..tostring
(b).."&_sid="..tostring(c)
and if you need a wake up lan in the app instead of using separate app
function QuickApp:synOn()
--
--00:32:32:32:0a:0f example
mac1 = string.char(0x00,0x32,0x32,0x32,0x0a,0x0f) --put mac adress here
for i=1,4 do
mac1 = mac1..mac1
end
mac2 = string.char(0xff,0xff,0xff,0xff,0xff,0xff)..string.char(0xff,0xff,0xff,0xff,0xff,0xff)..string.char(0xff,0xff,0xff,0xff,0xff,0xff)..string.char(0xff,0xff,0xff,0xff,0xff,0xff)..string.char(0xff,0xff,0xff,0xff,0xff,0xff)..string.char(0xff,0xff,0xff,0xff,0xff,0xff)..mac1---Magic packet needs broadcast MAC in front to wake up
self.udp = net.UDPSocket({
broadcast = true,
timeout = 3000
})
self.udp:sendTo(mac2, self:getVariable("Broadcast adres"), 9, {
success = function()
self:trace("OK send magic package")
-- self:receiveData()
-- self.udp:close()
if success == success then
self:updateView("label2", "text", "Wake on Lan package send")
end
-- self:receiveData()
end,
error = function(error)
print('Error:', error)
if error == error then
self:updateView("label2", "text", "Error")
end
end
})
-- self.udp:close()
end
see full code on my github repo https://github.com/techbliss/Fiabaro-Synology-switch