Limited time access code

Hello Nuki Team,
We have a booking system for our offices which has nuki smart locks.
for this website we want to create code and send to our customer who books online.

we are using Nuki web api to create codes ( time Limited )

Following issues are being faces.

first of all which time field is considered for limited time access.
allowedFromDate/allowedUntilDate or allowedFromTime/allowedUntilTime.

using following body we are able to create code ( which sometimes works and sometimes does not )

{
“name”: “test code”,
“allowedFromDate”: “2025-01-26T14:00:00Z”,
“allowedUntilDate”: “2025-01-26T18:00:00Z”,
“allowedWeekDays”: 127,
“allowedFromTime”: 0,
“allowedUntilTime”: 0,
“accountUserId”: 107323667,
“smartlockIds”: [
18205286116,
18205284340
],
“remoteAllowed”: true,
“smartActionsEnabled”: true,
“type”: 13,
“code”: 839756
} .

Can you explain how we can use the API to create for following scenarios

1: Someone wants to book an office for one day ( 8am-2pm ) , the code should work only in this time.
2: another person want to book same office for sameday ( 2pm-6pm).
3: Someone want to book for 5 days same time ( 8am-12pm).
4: someone wants to book for 5 days but different time each day, for example ( 8am-12pm) for 2 days and for 3 days (2pm-6pm)

1 Like

Hi theworkerplacecenter, and welcome to the forum :wave:

allowedFromDate and allowedUntilDate define the absolute time frame in which these access restrictions apply. If you wished to provide access at various times during the month of January, you would set these date fields to the beginning and end of January respectively.

allowedFromTime and allowedUntilTime allow you to restrict the access on the individual days, e.g. 8am - 2pm in your first use case.

allowedWeekDays are the applicable days of the week this access is granted; this is set via bitmask (you find more information on that in the API documentation; it’s explained in “9. Create a keypad code with recurring access time”)

Hopefully that helps! Let me know if anything is unclear.

This topic was automatically closed 60 minutes after the last reply. New replies are no longer allowed.