OAuth refresh token automatically

Hi there fellow non-coders,

I am fairly new to the API’s and got stuck.

I have an app with a database that contains per animal ambulance each drive they made
From our gps trackers in the cars comes valuable info that I would like to add to my database drive entries, like destination, km driven and so on…
So far so good.
My gps tracker provider uses an API to connect to their servers.
the only way I can get calls to work in the Bubble API Connector and get my data is by means of Private key in header.
Key name: authorization and in key value goes my bearer token value like: Bearer: xxxxxxxxxx
I can access my data on their servers, that works fine.

But they have given me a client id, a client secret code, a system id that is blank, my username and my password to get my access token, refresh token and expiration time…

when I put them in a POST call with in the body section these 4 items I get a bearer token, a refresh token and a expire time. But with this authorizan I always get an expiration and get locked out when my token expires. But I can’t find a proper way to manage this.
I tried all kinds of authentication methods using these credentials but only Private key in header gives me access…

Schermafbeelding 2020-01-31 om 08.01.05

how do I get proper access by what authorization method in the API Connector?
Can someone fill the the api connector properly and give me a screenshot?

These are my credentials:

“client_id”: “fake-account”,
“client_secret”: “42356gda54c0i41v”,
“system_id”: “”,
“username”: “[email protected]”,
“password”: “123456”

Please advise best practice.

kind regards,


Hey man, I got my app working! I was having the same issue. I follow the JSON format on this post and worked:

Good luck with your app.

Maybe you can show how you have set your API Connector authentication part?
And API Doc

Hi @Jici,

Here are the DOCs: Https://api.ritassist.nl
This is one of my setups that don’t work plus the error message from the connector:

1 Like

I cannot test myself, But I believe you cannot really use the custom token. This API seem to be a “password” grant type oAuth2 and this request to get access token first and after you can use the token endpoint. But there’s lack of documentation. Also, if you want to use custom endpoint. this must point to api/session/Token
I’m not sure you will be able to use the current Authentication and maybe you will need to manually handle this using API Call. You can use the validate access token endpoint to know if you need to get a refresh token or not.