only works if you discard the allowedFromDate (and allowedUntilDate) values. If you add something like
“allowedFromDate”:“2022-12-20T10:42:00.000Z”
into your -d list of parameters, the request fails with some mystic response:
{“code”:422,“description”:“The server understands the content type of the request entity and the syntax of the request entity is correct but was unable to process the contained instructions”,“homeRef”:"/",“reasonPhrase”:“Unprocessable Entity”,“uri”:“HTTP Extensions for Distributed Authoring -- WEBDAV”}
This happens no matter which parameters you add: until, timeFrom or timeUntil, with or without weekdays.
Anyone knows the right format of the date? All I tried so far failed.
{“code”:422,“description”:“The server understands the content type of the request entity and the syntax of the request entity is correct but was unable to process the contained instructions”,“homeRef”:"/",“reasonPhrase”:“Unprocessable Entity”,“uri”:“HTTP Extensions for Distributed Authoring -- WEBDAV”}
it works when I try the same values with swagger. BUT: it also works with curl when I leave the dates out of my curl command. In this case I can insert a key. The difference is the date.
Trying your changes (accountUserId and enabled) doesn’t seem to make a difference:
curl https://api.nuki.io/smartlock/1805XXXXX/auth -X PUT -H “Content-Type: application/json” -H “Accept: application/json” -H “Authorization: Bearer XXXXXXXXX” -d “{ “name”: “GeorgeLukas7”, “allowedFromDate”:“2022-12-25T11:00:00.000Z”, “allowedFromTime”: 0, “allowedUntilDate”: “2022-12-28T10:00:00.000Z”, “allowedUntilTime”: 0, “allowedWeekDays”:127, “accountUserId”: 0, “enabled”: true, “remoteAllowed”: true, “type”: 13, “code”: 181830 }”
{“code”:422,“description”:“The server understands the content type of the request entity and the syntax of the request entity is correct but was unable to process the contained instructions”,“homeRef”:"/",“reasonPhrase”:“Unprocessable Entity”,“uri”:“HTTP Extensions for Distributed Authoring -- WEBDAV”}
curl https://api.nuki.io/smartlock/18051XXXX/auth -X PUT -H “Content-Type: application/json” -H “Accept: application/json” -H “Authorization: Bearer XXXXXXXXXXX” -d “{ “name”: “GeorgeLukas8”, “allowedFromDate”:“2022-12-25T11:00:00.000Z”, “allowedUntilDate”: “2022-12-28T10:00:00.000Z”, “allowedWeekDays”:127, “allowedFromTime”: 0, “allowedUntilTime”: 0, “accountUserId”: 0, “enabled”: true, “remoteAllowed”: true, “code”: 181831 }”
{“code”:422,“description”:“The server understands the content type of the request entity and the syntax of the request entity is correct but was unable to process the contained instructions”,“homeRef”:"/",“reasonPhrase”:“Unprocessable Entity”,“uri”:“HTTP Extensions for Distributed Authoring -- WEBDAV”}
Well, to conclude the question in the post, the date works correctly in the format 2022-12-25T11:00:00.000Z. It was the initial curl command that had an error, which was fixed later.