Hello all
Maybe someone can help me further. I am trying to edit the code on the keypad via the web API.
The authentication and reading from the smartlockId works fine. With this information I then try to send the following command via PHP and Curl:
$curl = curl_init(âhttps://api.nuki.io/smartlock/â.$smartlockId.â/auth/2â);
$data = array(
ânameâ => âTESTâ,
âtypeâ => â13â,
âcodeâ => â987654â,
âallowedFromDateâ => â2020-12-01T16:00:00.000Zâ,
âallowedUntilDateâ => â2020-12-09T16:00:00.000Zâ,
âallowedWeekDaysâ => â127â
);
$jsonData = json_encode($data);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_POST, false);
curl_setopt($curl, CURLOPT_HTTPHEADER, [âAuthorization: Bearer $authTokenâ]);
curl_setopt($curl, CURLOPT_CUSTOMREQUEST,âPUTâ);
curl_setopt($curl, CURLOPT_POSTFIELDS, $jsonData);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
$response = curl_exec($curl);
echo $response; // Ausgabe fĂźr Test
curl_close($curl);
Unfortunately, I get the error message: {âcodeâ:405,âdescriptionâ:âThe method specified in the request is not allowed for the resource identified by the request URIâ,âhomeRefâ:"/",âreasonPhraseâ:âMethod Not Allowedâ,âuriâ:âHTTP/1.1: Status Code Definitionsâ}
What could be the reason for this?
Thanks for the help.
Greetings Jason