Base64 API Auth API connector

Hi there,

I’m using an API for my app : API reference · Smartcar docs
I tried to achieve the call which need base64 "Authorization token (Authorization: Basic base64({client_id}:{client_secret})) " but I cannot achieve it I always got the same issue :
“Raw response for the API
Status code 400
{“error”:“invalid_request”,“error_description”:“Invalid code: undefined.”}”

I did encode my two id in base64 using so it look good.

Hope someone can help me with this :pray:t2:

Normally, you should use Bubble oAuth2 user-agent authentication
. But because this API doesn’t return email when calling the user endpoint, you need to process manually.
Normally this is apikey:apisecret

The error you get seem to be related to the code returned by authorization url and used in the token endpoint. Maybenyou sre not fast enough? The code doesn’t length a lot of time. Share screenshot of API connector

Hi Jici, Thanks for your reply.

I don’t think is link to the timing because on the API documentation they said :
“An authorization code that will be used to obtain an access token in the following step. The authorization code expires after 10 minutes.”

I did my test call within the 10 minutes.

Here is my call:

I think may be due to the way I encoded the ids. But I just did “client_id:secret_id” and paste it in base64 encoder so I don’t see where the mistake is.

The header should be Authorization
And the value Basic base64encodedstring

Thanks Jici !

I tried both way Authorization - Basic base64encoestring and Basic - base64encoestring
Still same result. I must miss something. I will keep searching.

It’s hard to validate on our side if you encoded correctly the base64 clientid:clientsecret
You can also try to put everything in the url instead ?grant_type=…

The error code you get seem more related to the code
Or do you have different error message?