Webhook Events API - receiving updates

1,029 views
Skip to first unread message

Sam Sandberg

unread,
Jul 18, 2016, 2:32:27 PM7/18/16
to Strava API
Howdy, I have an app that has access to the Webhook Events API aka the "Push API" (http://strava.github.io/api/partner/v3/events/).

I've successfully created a subscription for my app (and can confirm that the subscription exists when hitting the list endpoint - my subscription id 83673), but I'm not seeing any events coming in.

Do I need to do something special to start seeing activity create events for my Strava user and my user's friends? What if another user auths my app, will there be a way to differentiate updates from different users? Do I have to create a separate subscription for each user of my app? There doesn't seem to be any way to pass these sorts of parameters (which user of my app to create the subscription for, etc.) to the subscription create endpoint. Perhaps I'm missing something?

Any help appreciated.

Best,
-Sam

PS. I spent some time in the last few days adding initial webhook event support to the python stravalib client - https://github.com/hozn/stravalib/issues/77 - tested and looking good!

Micah Lerner

unread,
Jul 18, 2016, 2:41:16 PM7/18/16
to Sam Sandberg, Strava API
Sam,

Thank you for your interest in the webhooks API. 

Applications receive updates only for athletes that have explicitly authenticated the application. Have the users you are asking about done so?

Micah Lerner
STRAVA

--
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.

Sam Sandberg

unread,
Jul 18, 2016, 2:48:46 PM7/18/16
to Strava API, sam.sa...@gmail.com
Hi Micah, thanks for your quick response.

I personally auth'd my own application and the (public permissions) access token that I got matches the one from my application's settings page: https://www.strava.com/settings/api

I figured maybe I needed private permissions, so I added `view_private` scope to my auth request, and did get a private token. After that, I think I am indeed receiving POSTs to my callback URL with updates for when I complete an activity, but there is no POST parameter data. Any suggestions?

Also, are you saying that I won't be able to receive updates for friends of mine who complete activities unless they explicitly auth my application? If that's the case, how does the IFTTT integration work? https://ifttt.com/strava

My intent was to create a better activity notifier for friends for Android (better than IFTTT, that is), since the native Strava app doesn't have notifications for friends completing rides.

Thoughts?
-Sam

Micah Lerner

unread,
Jul 18, 2016, 2:56:54 PM7/18/16
to Sam Sandberg, Strava API
Sam,

The data for a Webhook event is present in the POST body sent to your callback URL. A description of the data format is present in the "Receiving data" section of the Webhooks API documentation. 

You will not receive updates for an athlete unless they explicitly authorize your application. The IFTTT integration requires an athlete to explicitly authorize the IFTTT application following this pattern.

Micah Lerner
STRAVA

Sam Sandberg

unread,
Jul 18, 2016, 5:31:38 PM7/18/16
to Strava API, sam.sa...@gmail.com
Aha, I must have missed the fact that the data was in the POST body.

Re: the IFTTT integration, I disagree. I have a recipe set up that sends me a notification any of my friends completes an activity:


and I'm absolutely sure that my friends have not all auth'd IFTTT. There's just no way. And yet I am successfully receiving updates for all of my friends.

I have another theory that I'm testing: I just noticed that they ask for `view_private,write` scope when auth'ing Strava, so I'm gonna try that with my app. Maybe I'll have better luck.

Any other thoughts?

-Sam
Screen Shot 2016-07-18 at 5.26.30 PM.png

Micah Lerner

unread,
Jul 18, 2016, 5:36:06 PM7/18/16
to Sam Sandberg, Strava API
Sam,

I am not familiar with all of the recipes that IFTTT has created, and it appears you are right for the case you mention. For that recipe, IFTTT is likely polling our API. 



Micah Lerner
STRAVA

Sam Sandberg

unread,
Jul 18, 2016, 5:50:27 PM7/18/16
to Strava API, sam.sa...@gmail.com
For every single user!? Yikes.

I guess they have a token for each user, and there are only 1440 minutes in a day (way less than the allotted 30k daily API requests), so it is reasonable I suppose.

Having said that, you are confident that there is definitely no way for the Push API to return friends' activity completion events? If so, this is a bummer! Is it on your roadmap at all? I'm happy to pitch in if that helps :)
Reply all
Reply to author
Forward
0 new messages