Skip to content

grisxa/brevet-top-strava-webhook

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Receiver for the Strava events

This is a simple implementation of the Strava Webhook API for a local cycling community.

Validation request [GET]

Comes with the following query parameters:

  • hub.mode = subscribe
  • hub.verify_token = a secret used for subscription
  • hub.challenge = a random string to send back

The response is a JSON string with the same hub.challenge.

Event data request [POST]

Comes as a JSON string with the following keys:

  • subscription_id = the webhook's unique id
  • aspect_type = type of change, either create or update (delete is being ignored)
  • updates = what has been changed
    • type = the only update supported is the type switch to Ride
    • authorized = false when the athlete unsubscribes
  • object_type = athlete or activity
  • owner_id = the athlete's unique number
  • object_id = either activity's unique number or the athlete's if they unsubscribes

In case all the requirements are met the whole request goes to a Google Pub/Sub service queue and triggers another cloud function to pick it up on the other side.

WARNING. If the hook doesn't manage to finish in 2 sec. (when cold started) Strava gonna repeat the request in 2 min. Next attempt has more chances to succeed due to a warm cloud function state.

About

Receiver for the Strava events

Resources

License

Stars

Watchers

Forks

Packages

No packages published
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy