Simplest way to unlock

Hi everyone,

We have a co-work space in Portugal with a WordPress + WooCommerce booking system that works very well, with user system / subscriptions / payments and we would love to be able to make it work with a Nuki SmartLock. I hope I’m not posting in the wrong place, if it’s the case please let me know.

All of our users are managed in WordPress and all subscriptions are handled by WooCommerce. We are of course able to know in the user account area whether they are allowed to enter the workspace for the current day. If it’s the case, we’d like to have a button there that once clicked would open the unique lock (Nuki) that’s on the main door.

What’s the shortest/simplest way to do this? Should we create a small NodeJS + Express server with a set of credentials that has a single endpoint that unlocks the door? We would call that endpoint/route from the WooCommerce account page. We don’t want to manage users with the Nuki API and we don’t care so much about security since it’s in a small village. We just need to be able to unlock the door, as simply as possible (maybe just from WordPress, with PHP).

Sorry in advance if this question sounds dumb. We are 100% about to get the Nuki SmartLock, just making sure we can make it work with our system :slight_smile:

Any help is much appreciated!
Pete-

1 Like

The Web API with API Token authentication is your friend. It’s just one HTTPS call and no problem to integrate into Wordpress/PHP. Obviously you need a Nuki bridge for this to work.

https://developer.nuki.io/page/nuki-web-api-1-3-0/3

1 Like

Hi Jürgen,

Thank you so much for your answer. The co-work space owner is willing to get the product in the next week if there’s a way for me to set it up the way you mentioned.

I’m not too familiar with this kind of integration work. I have built custom WordPress themes several times and worked with Invoicing APIs so it shouldn’t be too complicated but it would really help me if you had a small example for me.

What I have now is an “Unlock Door” button in the user dashboard (it only shows if the current user has access to the co-work space in our system). I have done all this, it is secured and has payments/user area and everything.

If we get the Nuki combo 2.0 (Nuki lock + Bridge), what would the integration steps be? Do you have code example for my specific case? I only need to understand how to make this PHP button click open the door. We already have someone that can physically install the device to the door, all this is taken care of, I’m only talking about the software side. I’ve read about an IP address for calling the bridge, does the user have to be connected to the same Wi-Fi network as the bridge?

Again, code examples would be greatly appreciated as I don’t know where to start :slight_smile: I feel like it’s going to be easy once I understand the process (hopefully).

Pete-

It’s so simple that you won’t need much code examples …

Just follow the link that i sent you. Once you are in section 4.3 you will end up with an example that looks like this: curl -X POST --header ‘Content-Type: application/json’ --header ‘Accept: application/json’ --header ‘Authorization: Bearer API_token’ ‘https://api.nuki.io/smartlock/1234567890/action/unlock

If you copy that into a command line in linux it will unlock your Smart Lock.

So now you just incorporate that into php and you’re done.

Did you already take a look at https://api.nuki.io/?
There you can the available endpoints and see you commands could be sent via command line.
Integrating into PHP and your interface as well as securing API token would have to be done on your side.

EDIT: Jürgen was faster with more details :wink:

Hi Donny, I’ve been looking for a reliable woocommerce booking app for a while, which one are you using?

Hello,

I’m starting to develop a WordPress connector https://github.com/sebastienserre/connect-nuki-smartlock
We can surely speak togther about a solution (I’m an independant developer, owner of a Smartlock Pro 3.0)

There’s also another request about WooCOmmerce Booking, maybe development can be mutualized.

Regards