Base64 encoded auth for API

Hi,
I’m trying to connect an external api via bubble api connector.
But I’m struggeling with the auth. How can I add a base64 encoded part to the auth?

POST  "url.com/api/v1/connect/token/" 
Accept : application/json
Content-Type: application/x-www-form-urlencoded
Authorization : Basic <base64 encoded ClientId:ClientSecret>

Post params (url encode values):

"grant_type": "password", 
"username": "username", 
"password": "password",
"scope": "CustomerApi"

Hi! Can you provide link to API Doc? Will be easier to help.

You should use Custom Token in API Connector.
Put the url in the POST URL field with ? and all parameters join with & like ?grant_type=password&scope=CustomerApi
Set the Token Header for Authorization with value Basic encodedbase64
You can encode your client ID and client secret with an online tool like https://www.base64encode.org/

1 Like

mhmm dont get it …

The API Call it’s to call the endpoint you want to reach in API.
The first part is where Bubble will handle auth part. From the response I was able to see, I guess the API will expect access token for endpoints authentication. This will be provided by the auth part (Custom Token)
Again, if you have a documentation url, it will be easier to help

sure - will send you a pn

So for example, in this api you have an endpoint to get all organizations. This is what you will call in API Call. You don’t need to put the authorization bearer header because the API Connector custom token will handle this part automatically for all API Call.