stravalib.client.Client.exchange_code_for_token#

Client.exchange_code_for_token(client_id: int, client_secret: str, code: str) AccessInfo[source]#

Exchange the temporary authorization code (returned with redirect from strava authorization URL) for a short-lived access token and a refresh token (used to obtain the next access token later on).

Parameters:
  • client_id (int) – The numeric developer client id.

  • client_secret (str) – The developer client secret

  • code (str) – The temporary authorization code

Returns:

Dictionary containing the access_token, refresh_token and expires_at (number of seconds since Epoch when the provided access token will expire)

Return type:

dict