can't make react js or postman api request to strava api

Viewed 21

I have been using different end points with the strava api but have run into some issues when trying to make a request to this particular endpoint now there is documentation on how to make the request using an instance in javascript but I wanted to make it using axios my issue seems to be I cannot seem to get the right url to make the request after trying countless different ones.

I want to make the request to this one to get the stats about one of my workouts the workout has the id=7825986552, I have written code to make the call and tried to make the call in postman but none work.

Here is the docs for the endpoint I am using: https://developers.strava.com/docs/reference/#api-Activities-getActivityById

Here is code for the call without my access token included for obvious reasons and where id is the id I have stated above:

const link =
    "https://www.strava.com/api/v3/athlete/activities/" + id;
  useEffect(() => {
    const fetchData = async () => {
      const stravaResponse = await axios.get(
        `${link}?access_token=ACCESS_TOKEN_VAR`
      );
    };
    fetchData();
  }, []);

I have also tried it in postman with a GET request:

https://www.strava.com/api/v3/activities/{7825986552}?access_token=ACCESS_TOKEN

but nothing works does anyone know the correct format or how to make the request?

0 Answers
Related