Skip to main content
Solved

401 Error


Forum|alt.badge.img+1

I'm extremely new to this but after trying to get anything to work for 3 hours I thought I'd ask here.

I'm trying to get activity data for a Python project. I've followed all the steps on the getting started doc and now I'm trying to use the requests module in Python to get activity information.

Why isn't this working?

import requests

access_token = ""

headers = {"Authorization" : f"Bearer {access_token}"}

response = requests.get("https://www.strava.com/api/v3/athlete/activities", headers=headers)
print(response)
print(response.text)

I just keep getting:
<Response [401]>
{"message":"Authorization Error","errors":[{"resource":"Athlete","field":"access_token","code":"invalid"}]}



Really grateful for any help on this I'm completely lost 😕😕

Best answer by kanoor

check access token use new access token if its expires ... access token expires every 6hr

View original
Did this topic help you find an answer to your question?

3 replies

Forum|alt.badge.img+4
  • Hub Rookie
  • 5 replies
  • Answer
  • January 13, 2024

check access token use new access token if its expires ... access token expires every 6hr


Forum|alt.badge.img+3
  • Hub Starter
  • 2 replies
  • January 16, 2024
I am also facing the same problem
 

 


Forum|alt.badge.img
  • Hub Starter
  • 1 reply
  • February 28, 2024

Encountering the same problem also. I can't authorize(?) my token when using local host


Cookie policy

We use cookies to enhance and personalize your experience. If you accept, you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings