CFDs are complex instruments and come with a high risk of losing money rapidly due to leverage. -- % of retail investor accounts lose money when trading CFDs with this provider. You should consider whether you understand how CFDs work and whether you can afford to take the high risk of losing your money.

Refresh_token can only be used once

Hello team,

I try to use refresh_token in https://www.darwinex.com/data/darwin-api to generate new access token.
It seems it can only use once, the 2nd time to request access_token, it shows bellow error:

{'error_description': 'Persisted access token data not found', 'error': 'invalid_grant'}

url = 'https://api.darwinex.com/token'

More information: the sampe method is not working anymore https://github.com/darwinex/darwin-api-tutorials/blob/ee87ce33fb83835369e348ef51982666ec65c8e1/PYTHON/AUTH/dwx_oauth2_p3.py#L20

Hello @fountainhead,

Using the refresh token to generate new access tokens not only generates a new access token but also a new refresh token, revoking the existing one. It is not always happening, but most of the times.
After using the refresh token grant successfully, if you access the https://www.darwinex.com/data/darwin-api , it should display the updated credentials for you.

I see. thank you for your response!