Whenever I try to make a new authentication code for keypad via API, the time restrictions are not passed along. That way I am getting a new passcode for the lock but no time restraints. Am I doing something wrong or might it be a bug?
Example: Creating a new code named “Guest Name” that only works between 10/22/19 at 2PM and 10/23/19 at 1PM but on nuki web I only get a new entry code called “Guest Name” and has “Limit access time” turned off
{
“name” : “Guest Name”,
“type” : 13,
“code” : 374829,
“allowedFromDate” : “2019-10-22T14:00:00.000Z”,
“allowedTillDate” : “2019-10-23T13:00:00.000Z”
}
You should avoid sending partial JSON requests.
In your case
{
"name" : "Guest Name",
"type" : 13,
"code" : 374829,
"allowedFromDate" : "2019-10-22T14:00:00.000Z",
"allowedUntilDate" : "2019-10-23T13:00:00.000Z",
"allowedWeekDays": 127,
"allowedFromTime": 0,
"allowedUntilTime": 0
}
would be correct.
I see that this is not very intuitive and will check if we can handle this any better.
Note: You also had allowedTillDate
instead of allowedUntilDate
in the reqeust which would be ignored (but makes no difference here).
Thanks that helped!
Now that it’s working, i noticed that any hour set in the API is translated to be 3 hours after (e.g. if i told the authorization code to start from 12:30, on nuki web the it would translate to 15:30). Is this a timezone issue ? (note that I live in israel : GMT +3)
Thanks in advance
All dateTime objects (e.g. allowedFromDate, allowedUntilDat) should be set in UTC.
Time-only values (e.g. allowedFromTime, allowedUntilTime) are an integer (minutes from midnight)