Is there a way for me to access a ride's data using my API id that's marked private by me on Strava?

711 views
Skip to first unread message

bp

unread,
Apr 24, 2015, 4:13:53 AM4/24/15
to strav...@googlegroups.com
Is there a way for me to access a ride's data using my API id, that's marked private by me on Strava?

Thanks.

Jake Oktawiec

unread,
Apr 24, 2015, 12:11:51 PM4/24/15
to bp, strav...@googlegroups.com
you need to add "scope: view_private" to your oauth token request





On Apr 24, 2015, at 1:13 AM, bp <b...@hdbatik.co.uk> wrote:

Is there a way for me to access a ride's data using my API id, that's marked private by me on Strava?

Thanks.

--
You received this message because you are subscribed to the Google Groups "Strava API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to strava-api+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

bp

unread,
Apr 24, 2015, 6:45:22 PM4/24/15
to strav...@googlegroups.com, b...@hdbatik.co.uk
This is driving me potty.

I'm trying to access my data marked private via my Strava API application.

I access this page in a web browser:


That gives a webpage:
_________________________________________________________
Authorize xxxxx to connect to your account
...
Amongst other things, this application will be able to:
Access your name, location and email address
Access your activity data
Display public data related to those activities
Read your public profile data
See private data on your activities
_________________________________________________________

I click Authorise and that gives, in the address bar

I then, on the command line, go:

curl -X POST https://www.strava.com/oauth/token -F client_id=1234 -F client_secret=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx -F code=c4f282db07b0f136d2ff5979a6ff106bba34a6fc

and that gives

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

I just want to allow my PHP code to access my marked private data on Strava -- only my Strava athlete account -- on an ongoing basis.

How? Please help, thanks.


Under My API Application it says "Your Access Token (permissions: public)". Is there not just a way of changing that to allow it to access my private data?

Paul Mach

unread,
Apr 24, 2015, 6:53:01 PM4/24/15
to bp, strava-api
I don't know, worked for me:

curl -X POST https://www.strava.com/oauth/token -F client_id=5645 -F client_secret=a73**************1d78 -F code=c4f282db07b0f136d2ff5979a6ff106bba34a6fc

Dr. Paul Mach
STRAVA

Prashanth Chengi

unread,
May 11, 2015, 2:51:34 PM5/11/15
to strav...@googlegroups.com, b...@hdbatik.co.uk
Please, could you provide more details on how to use it? 
Earlier, I used to be able to get my private activities using this something like this
curl -G https://www.strava.com/api/v3/athlete/activities \
    -H "Authorization: Bearer 83ebeabdec09f6670863766f792ead24d61fe3f9"

Should we now provide the 'code' as a header? or client_secret? Or something else? 
I really wish the documentation had an updated example showing how this is to be accomplished.

/Prashanth

Prashanth Chengi

unread,
May 11, 2015, 3:05:09 PM5/11/15
to strav...@googlegroups.com, b...@hdbatik.co.uk
Never mind. I figured out that I needed to exchange the temporary code for a new access token. With the new access token, everything works, as expected.

/Prashanth
Reply all
Reply to author
Forward
0 new messages