strava

Strava Webhook API is not sending all events


I created an app on Strava. Authorized my app on my account with read,activity:read,activity:read_all,read_all permissions.

I didn't want polling their API for activities as they recommend webhooks for that.

So I created a webhook subscription and validated it via the callback url.

Here's the response of Strava API for the webhook subscriptions I successfully created:

    [
        {
            "id": 179***,
            "resource_state": 2,
            "application_id": 59***,
            "callback_url": "http://*************.duckdns.org:8100/strava/webhook",
            "created_at": "2021-01-22T20:42:46Z",
            "updated_at": "2021-01-22T20:42:46Z"
        }
    ]

My problem is that I'm not receiving any activity events.

The only event I get is the revoke access event when I delete my app from my account.

{
    'aspect_type': 'update', 
    'event_time': 1611350203, 
    'object_id': 6881533, 
    'object_type': 'athlete', 
    'owner_id': 6881533, 
    'subscription_id': 179***, 
    'updates': {'authorized': 'false'}
}

So this indicates that my side is correct because event is received.

I tried sending an email to Strava but all I got was a auto-response telling me to use Strava API Google Groups for help, which was not helpful at all.

Does anyone have any clue what is wrong?


Solution

  • Finally solved my problem and writing the solution here for other people. Probably the people who don't have this problem are using libraries for Strava in their coding languages which already obtain access_token and refresh_token after the authorization.

    If you're dealing with Strava Webhook API yourself like me, after the authorization, you must obtain your access_token and refresh_token as explained here https://developers.strava.com/docs/getting-started/#oauth

    Strava Webhook API documentation doesn't say anything about this because access_token is not needed for creating a webhook subscription. Strava API creates a subscription and returns a successful response. This is misleading because your endpoint won't get any webhook events