Can Anyone Help me pls. PHP

50 views
Skip to first unread message

Christopher Calisi

unread,
May 18, 2022, 9:52:21 AM5/18/22
to Strava API
I haven't been able to pull any data.

I believe I have gotten through the authorization just fine, receive access_token and refresh tokens but when I try to get any data the resonse is blank.

Here is my code to pull data ( by the way, trying to pull by activity ID but can't find a list of activity codes anywhere so I guessed at the code).

  $url = 'https://www.strava.com/api/v3/activities/1?include_all_efforts="true"Authorization: Bearer '. $row['AUTH_CODE_TOKEN1'];      
                                   
                                           
      $header = array("accept: application/json");
      $curl = curl_init($url);
      curl_setopt($curl, CURLOPT_URL, $url);
      curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
      curl_setopt($curl, CURLOPT_HTTPHEADER, $header);
      $http_code = curl_getinfo($curl, CURLINFO_HTTP_CODE);
      $response = curl_exec($curl);

HERE IS THE RESPONSE I GET ( access_token XXXXX-ed out for safety here).

[18-May-2022 09:33:34 America/New_York] STRAVA url>>> https://www.strava.com/api/v3/activities/1?include_all_efforts="true"Authorization: Bearer XXXXXXXXXXXXXXXXXXXXXXXX
[18-May-2022 09:33:34 America/New_York] STRAVA resp>>>>>>
[18-May-2022 09:33:34 America/New_York] STRAVA HTTP Code >>>>>>0

Matti Wenell

unread,
May 25, 2022, 3:45:45 AM5/25/22
to Strava API
Authorization token is sent in header, not in the url
Reply all
Reply to author
Forward
0 new messages