Nuki applications synchronisation issue

Hi,

I’m getting a 409 error while creating a specific entry for my Nuki Keypad.

payload={‘name’: ‘0AJXP4’, ‘type’: 13, ‘code’: 936414, ‘allowedFromTime’: 0, ‘allowedUntilTime’: 0, ‘allowedFromDate’: ‘2023-08-06T10:00:00Z’, ‘allowedUntilDate’: ‘2023-08-11T10:00:00Z’, ‘allowedWeekDays’: 127}, status=409

I previously had an entry with this name, but I deleted it from the phone application. However, when looking at the Nuki WEB interface, an entry with that name still exist, and trying to delete it lead to an undefined error.

I am also noticing a lot of other entries in the Nuki Web interface that were deleted previously, but are still displayed here. All of theses entry doesn’t show up in the phone application.

This is becoming a real problem, can you help ?

Hi,

  • 409 error occurs only when you have a KP code already (not possible to create two different auths with the same KP code).

  • Does the sync perform correctly? Have you clicked on “Update now” button in Nuki Web or performed a force sync via API and checked if the auths are synced correctly?

  • Did you create the entry ‘OAJXP4’ again today? As we checked the DB to find an entry ‘OAJXP4’ and it could have the same entry code.

Please do a sync and let us know if it works. If not, could you please share your SL ID and web account details with our customer support to investigate further. Thanks.

Clicking the “Update now” button fixed the problem, but this should not have occured in the first place. Any idea how to avoid this from reproducing ?

Another issue that I am seeing is that deleting some created PIN code will return a 204 success, but the PIN code still exist and was not deleted.

For example, last night we issued a delete of pincode ID 64983a56466c244aac626f40. The API call returned 204, but this PIN id still is listed when I query the smartlock.

This can become a problem, since after a certain amount of undeleted pin code, the memory is full and new pincode can not be created.

Any idea how we can fix this problem ?

The daily sync happens once a day to fix the auth syncing between apps and web. But if you want it to happen immediately, you can force a sync through the API (or update the SL from Nuki Web).

The Nuki Web API is asynchronous, which means, you will get the 204 response code if the request is received by our servers. The deletion may or may not happen, and sometimes it takes upto a few seconds. You must use the GET endpoint to validate this at your end.

So I should send a DELETE request, followed by a GET to check if the entry was deleted, and keep issuing the DELETE request if the PIN was not ? Is there any recommanded best practice ?

Sorry the message didn’t come out correctly. No it doesn’t make sense to do that.

If you delete the auth, and is it failing for every request even when the device is online? Then it is definitely a problem when you say delete is not working even when the device is online.

How often do you delete auths? Couldn’t you push a sync when you do the deletion process to be sure that all auths are synced after deleting if you cannot wait until the daily sync process? On another note, if the daily sync didn’t remove the deleted auths, then it could be a bug. Please report if you faced this issue.

The best practice would be to use webhooks, because a forced sync can drain the batteries.

Hello Poonam,

Thank you for taking the time to answer and to help :slight_smile:

It is not failing for every request, sometimes it does, sometimes not. I am unaware of what might be the reason. The delete is issued from a server handling the various apartment bookings, and the Nuki and it’s bridge are always connected.

Auth are deleted a few days past each booking, I would say 6-7 times a month. I have no problem waiting for the daily sync (I don’t do a sync myself), but what I observe is that some of the delete command simply never are processed.

Any suggestions?

Hello,

I think it may be a very specific case. In your case, waiting for the daily sync is the best option.
Since you say, auths need to be deleted after each expired booking, is there a way to trigger a webhook for the same?

Regarding the issue with deletion, it could be the issue that the call is failing sometimes.
Thanks for reporting, we will look into this, more as a generic problem, as to why some commands may get lost. But it will take some time for the investigation.

If you still see a lot of issues, I suggest you file a ticket with our customer support to look into the issue for you specifically. Thanks.

I’m a bit confused now. Each of the keypad PIN authorization I create has a starting and an ending date. My need is to delete keypad PIN once the ending date has passed. I am not sure sure how I can achieve that with a webhook.

At the moment, my manager application just goes through the pin and issue the deletion when the date has passed. It happen many time (I have no concrete idea, but considering how many old pin I see when I check, I would say this happen very frequently) that the command never complete.

That is a really buggy behavior, and it lead to many problem:

  • problem generating new pin if the randomly assigned pincode is the same as one of the older supposedly deleted pin.
  • problem generating new pin when the device memory is full, because of many pin supposedly deleted being still sitting in memory.

Considering I need to fix this problem, what other solution do I have than issuing a DELETE followed by a GET, in a loop until the pin is really deleted ?

As mentioned earlier, the only other way is the webhook.

https://developer.nuki.io/page/nuki-web-api-webhooks-11/8/#heading--device-authorizations
A webhook is triggered when an authorization is created, modified or deleted.

AuthResponse {
feature = “DEVICE_AUTHS”,
deleted (boolean): flag if the auth is deleted or not,
smartlockAuth (SmartlockAuth): Ref: Swagger UI
}

If you think there is a bug, please contact our support for further investigation. Thanks.