Forum Academy Marketplace Showcase Pricing Features

Api authorization: please help! I’ll buy you a drink

How can I connect to API that requires authorization? cURL example below:

Really, I’ll PayPal or cash app the first person to help me connect successfully lol. Thanks!

I have the API connector installed but the bubble interface is new to me. Works in postman.

You can import curl calls, so you might try that first…

2 Likes

I can help you. You’ll need a plug-in as well, look for HASH HMAC.

According to the documentation, you concatenate your key, your secret, your unix timestamp and do a sha256 hash of these and pass it in a header.

You’ll need the plug-in to calculate that, then feed it into your API call.

Presumably the request itself has a timestamp in. These must match.

You’ll need bubble fields or states or whatever to calculate the hash, then feed it into the api. The add in needs you to have a copy of the hash generator on the page, which is invisible.

Calculating a hash signature on the page is all well and nice, except it exposes the secret to the browser, ie. the end user.

When doing a hash signature on the server, you may be able to use a Bubble function …

image

On the other hand, I think the API Connector can do the signing for you if configured right. I don’t recall exactly, might be confusing it with Oauth2 and too tired to test … zzzz zzz

Yeah that last bit is way better.
In my own app I stopped using the hash hmac generator on the page and built my own standalone API on alternate server so my credentials were never in bubble itself.