Registering decentral webhook

Hi

I would like to register decentral webhooks for our integration, but i got stuck at the first step when I need to request a code with the oAuth codeflow.

Here is the request url I created:
https://api.nuki.io/oauth/authorize?response_type=code&client_id=OUR_CLIENT_ID&redirect_uri=https%3A%2F%2Fcodeantz.com&scope=webhook.decentral

Our return url in decoded form, which is added to the Nuki Advanced Integration tab as a return url:
https://codeantz.com/

If i put this into my browser I get the following page:

Can someone help what I am doign wrong.

Many thx!

Kind regards
Viktor Pári

Hi, does anyone have any suggestion what could be the problem. Many thx!

Hi Viktor,

I forwarded it to our devs to have a look at your problem I will get back to you soon.

Orsolya

Hi Viktor!

Could you check please the redirect URL setting on the General tab Oauth2 Redirect URL field. We currently see that it’s not set.

image (8)

Thanks,
Orsolya

Wow, finaly! Thank you for pointing it our, I mixed it with the webhook url input filed on the advanced API tab. I managed to get back the bearer token. :pray: :blush:

Okay, so I am following the instrustions of the decentral webhook setup:
https://developer.nuki.io/page/nuki-web-api-webhooks-11/8#heading--decentral-setup-steps

So I managed to get a “code” from point 2.

In point 3. a POST resquest need to send, I am using postman application with develpoment, here are screens how I setup the request:
Params

Just want to mention here that I am using the redirekt urel from the General tab of the Nuki web integration page in url encoded form.

Authorization


Header

In my understanding all setup as instructied but I receive the following response.

<html>
<head>
    <title>400 Bad Request</title>
</head>
<body>
    <center>
        <h1>400 Bad Request</h1>
    </center>
    <hr>
    <center>nginx</center>
</body>
</html>

Any suggestion wnat is wrong with the request?
Many thx in advance!

Hi Viktor!

Actually we must correct the documentation. To get the token from the code, the request must contain the header “Content-Type=application/x-www-form-urlencoded” and the parameters should be added in an URL encoded way:

grant_type=authorization_code&code=tN6-zB....&redirect_uri=https://...&scope=smartlock smartlock.auth account webhook.decentral

Screen for the Body:

Best Regards,
Orsolya