Swagger Interface und API Token

Hallo zusammen,

ich bin neu an Board und benötige bereits Hilfe. :confused:
Mein Auftrag ist es, via Woocommerce und der Nuki Api, aufgrund von Bestellungen einen temporären, zeitlich begrenzten PIN-Code für zwei Keypads zu genieren. Soweit so gut.

Mein Ansatz war, der Dokumentation via Web API Example: Create a key for your Nuki Smart Lock zu folgen. Also die ID des Smartlocks zu holen, PIN zu erstellen, PIN auslesen und via Mail übermitteln und später den PIn wieder zu löschen.

Allerdings verweist der oben angeführte Beitrag auf das Swagger Interface um die entsprechenden Test-Szenarien zu testen. Doch hier komme ich nicht weiter.

Gebe ich im Feld rechts oben meinen API KEy ein und bestätige mit “Authorize”, dann folgt eine Ausgabe mit “detailMessage “The supplied value ‘(mein API Key)’ for parameter ‘client_id’ is not valid””

Führe ich auf derselben Seite einige Test-Kommandos aus, dann erhalte ich “Your access token is not authorized” zurück.

Welcher API Token wird denn nun benötigt?
Ich habe dem Token bereits alle Berechtigungen erteilt - was aber auch nicht Sinn der Sache ist.

Bitte um Unterstützung.
Danke aus Graz, nach Graz
Ronny

Hi Ronny!

Sorry, the problem seems to be a missing update in the documentation!
If the API key is used, the redirect URL in Nuki Web has to be set for it since our last security update. In this case: https://api.nuki.io/static/swagger/o2c.html
I will update this in the doc immediately and we are currently also checking if we can allow this as default, so that the extra step for users is omitted again.

The manual API token did not work for me in the test either; I’ll have a look at that. - But otherwise you can work with it well, for example with Postman; I use that here normally for testing.

wbr,
Stephan


Entschuldige bitte, das Problem scheint ein fehlendes Update in der Dokumentation zu sein!
Wenn der API Key verwendet wird muss seit unserem letzten Sicherheits-Update die Redirect URL in Nuki Web dafür gesetzt werden. In diesem Fall: https://api.nuki.io/static/swagger/o2c.html
Ich werde das sofort in der Doku nachziehen bzw. werden wir prüfen, ob wir diesen als Default zulassen können, so dass der extra Schritt für Nutzer wieder entfällt.

Der manuelle API token ging jetzt bei mir im Test auch nicht; das schaue ich mir noch an. - Aber sonst lässt sich damit gut z.B. mit Postman arbeiten; das verwende ich hier normal zum Testen.

1 Like

I have followed the instructions mentioned in Nuki Developers
I have logged into Nuki Web, I have copied my OAuth2 API key into the exampe Authirization call string, I have been redirected to the Nuki site and have approved my application. Hereafter I have been redirected to an empty page, but the Url does show the Authorization code.

So far so good.

But then, In the section 4.4.1.4 Application Requests Access token, I need to create a curl command that needs a CLIENT_SECRET, This should be available somewhere at Web API settings in Nuki Web. But I cannot find it there. Do I need to first apply for Advanced API Integration?

What am I missing?

An update in this case: The new redirect URL is “api.nuki.io/” instead of “api.nuki.io/static/swagger/o2c.html” starting with https://