Problem with a query with x-www-form-urlencoded content-type

I have a request aiming at refreshing an access_token to Revolut API which works well in postman but doesn’t work in bubble.

The post settings for this request are the following:



… and I have a correct answer :
(status code 200
{
“access_token”: “oa_sand_k1jwhzvj5JohswAnKfNGC6RTkOrRii_s-amMXvYkS3I”,
“token_type”: “bearer”,
“expires_in”: 2399
})

In bubble, I set the API connector as follows:


… and I have an answer with status code 400 and the following message: {“error”:“invalid_client”,“error_description”:“client_id is missing”}

I also tried the same request with

  • unchecked Querystr. boxes.
  • a form-date body type.
    I however got the same status code and error message.

What should I set the API connector do to make it work?

Your content-type has 2 ‘-’ between www and form. Is that meant to be correct?

Otherwise, i can’t spot any difference between the 2. it says client_id is missing so maybe the param is not being sent somehow

@loh.cher.e have found something interesting. But it may not be enough.
Even if you set this content-type, in some case, Bubble will override this and set it to json.
Here’s how to solve this:
remove parameters
Go in Body
add this:
grant_type=refresh_token&refresh-token=&client_id= and so on will all your parameters

Works with this. Thanks a lot.

2 Likes