API Key problems

Hey guys,

Having problems with how Bubble sees API keys.

Currently adding a new API for a service I’m using, however all their API keys by default come with ‘=’ signs at the end of the key. When you add this into the Oauth header parameter (where it needs to sit), I’ve noticed bubble automatically doesn’t recognise the = sign.

Any ideas of how to get around this?

Cheers

Having = at the end would suggest that the string you have is base64 encoded. There is a good chance that decoded it would be something along the lines of yourusername:yourpasswordorkey i would decode the base and try that if you have the method correct as per the service.

If your familiar with console replace the word HERE with the string you have and run this code to get the decoded value,

atob('HERE');

Thanks for the response!

I tried this, but it looks like the API call is specifically looking for that key, and not the decoded text, so this doesn’t solve it.

Was is a username : a key?

Wasn’t username, looked almost like a couple of mac addresses

OK, so the service defines that you need the Authorization header? if so the api connector would need a header added and if its an auth header would have the key Authorization and the value oauth YOURSTRING but if there is something non standard and they are asking for a header names oauth the the key would be oauth and the value YOURSTRING.

If you drop a screen shot here it may help a lot, another thing that may spark something you have seen in the service’s doc is that Authorization is not the same as Authentication as far as an OAuth 2.0 call is concerned.

This is how I’ve got the API making the call, according to the API docs

And here’s the error I get (taken out a few API key characters for obvious reasons)

Raw response for the API
"{"type": "list", "correlationId": "355e6e98-475a-11e8-b338-d75fabb646c9", "data": [ {"type": "error", "code": "internal-server-error", "title": "Internal server error", "detail": "‘eyJhbGciOiJIUzI1NNTIiwic2FuZGJveF9hY2NvdW50Ijp0cnVlLCJleHAiOjE1MjQ1MzQ5NDAsImlhdCI6MTUyNDUzMTM0MCwidmVyc2lvbiI6IjIuMCJ9.oshd3BYRqIFzCl3tMoC9NmWUtbAnBxFdqHHzTksaOf0’ not a valid key=value pair (missing equal-sign) in Authorization header: 'Bearer

Again, thanks for your help

Remove the apostrophe from the key.

Still the same result, unfortunately.

Well i went over there to basiq to see there docs & there site was so basiq that apart from a few flags the site is showing errors in the console rather than a key. from a quick a look though give this a try…

Use Basic YOURKEY in the header value and if not try application/json as the content type…

Tried what you thought too, get this error now. So frustrating!

Raw response for the API
“{“type”:“list”,“correlationId”:“f05fa0a0-4773-11e8-8241-d1f346ef188e”,“data”:[{“type”:“error”,“code”:“parameter-not-valid”,“title”:“Required parameter not valid”,“detail”:“Invalid authorization header”,“source”:{“pointer”:“header/Authorization”,“parameter”:“Authorization”}}]}”

Ok, that means that the ?scope=SERVER_ACCESS needs to come out and either go back in the header or more likely in the params section below with query string checkbox ticked, if you have a spare key PM me one and I will work it out for you.