Smartlock API issue

Hello,

I am implementing Smartlock API (Swagger UI) in my PHP booking manager application.

My application uses the SmartlockAuth PUT in order to create an auth when a new booking is created.

My problem occurs when the nuki is not connected to the internet: in this case the response I get from the API is exactly the same I would get when the nuki is connected: 204 no content. For this reason I can’t tell if the auth has been correctly inserted or not!

When this happens, if I log in in web.nuki.io an error alert is prompted, so in some way the server registers the error…

The problem could be solved by sending an appropriate HTTP response code in case the process encountered an error.

1 Like

Hi!

Due to the asynchronous nature of the Web API (as commands are triggered by the Web API on the device and locally processed on the device itself) this is a bit tricky and we recommend using our new webhooks to handle this.

See also:
https://developer.nuki.io/page/nuki-web-api-webhooks-11/8

You can apply for the advanced endpoints via Nuki Web and then use

PUT /smartlock/auth/advanced

for your usecase.