access_token is invalid (after just receiving it)

1,070 views
Skip to first unread message

Sante Kotturi

unread,
Aug 29, 2016, 7:15:12 PM8/29/16
to Strava API
Hi All, 

Something that worked a week ago, is no longer working for me :( 

I get an access_token using OAuth. 
I then submit this token to get recent activities and I get :

{
 
"message": "Authorization Error",
 
"errors": [
   
{
     
"resource": "Athlete",
     
"field": "access_token",
     
"code": "invalid"
   
}
 
]
}



I searched through the group history and found the following post but the API endpoint format seems to have changed since 2014. 

I'm using the format from the current docs: 

curl -G https://www.strava.com/api/v3/athlete \
     
-H "Authorization: Bearer XX"



I get the same error when trying in Postman. 

In my webapp, chrome logs out :

XMLHttpRequest cannot load https://www.strava.com/api/v3/athlete/activities. Response for preflight is invalid (redirect)

The associated $http request has a 302 for OPTIONS. 


Thanks in advance for any help or suggestions,

Sante




Sante Kotturi

unread,
Aug 31, 2016, 1:28:34 PM8/31/16
to Strava API
Tried again this morning and its working. I changed nothing.  ¯\_(ツ)_/¯

John Davis

unread,
Sep 4, 2016, 11:54:17 PM9/4/16
to Strava API
Is this a CORS issue?  Perhaps  some instances of the strava api server do not allow javascript requests from javascript not sourced from the strava server?

Sante Kotturi

unread,
Sep 5, 2016, 12:41:32 AM9/5/16
to Strava API
I believe it ended up being a CORS issue, although I think there was a couple hour period where something was amiss with the server I was hitting as I'm now able to access the API. 

Is there any documentation on how to setup CORS correctly for the API? 
I'm able to access endpoints from: 
Postman (api test application)
iOS app
Android app
Bash term using curl 

cannot access from:
webapp running at localhost on my local dev machine. 
Message has been deleted

Bryan Swagerty

unread,
Feb 6, 2017, 11:17:18 PM2/6/17
to Strava API
Did you ever figure this out? Getting the exact same issue.

Sante Kotturi

unread,
Feb 6, 2017, 11:23:35 PM2/6/17
to Strava API
I don't remember exactly, I think I might have had a typo in the url that went unnoticed, maybe it was "athlete" not "athletes". 

The issue went away and hasn't come back since so I havent looked into it/remember the details of what resolved it. 

Sorry if thats not more helpful. 
Reply all
Reply to author
Forward
0 new messages