Class: Strava::Webhooks::Models::Challenge
- Inherits:
-
Hashie::Trash
- Object
- Hashie::Trash
- Strava::Webhooks::Models::Challenge
- Defined in:
- lib/strava/webhooks/models/challenge.rb
Overview
Represents a webhook subscription validation challenge.
When creating a webhook subscription, Strava sends a GET request to your callback URL with challenge parameters. Your application must validate the verify_token and respond with the challenge value.
Instance Method Summary collapse
-
#challenge ⇒ String
Challenge value that must be echoed back.
-
#mode ⇒ String
Subscription mode, typically "subscribe".
-
#response ⇒ Hash
Returns the response hash that should be sent back to Strava.
-
#verify_token ⇒ String
Verification token to validate the request.
Instance Method Details
#challenge ⇒ String
Returns Challenge value that must be echoed back.
44 |
# File 'lib/strava/webhooks/models/challenge.rb', line 44 property 'challenge', from: 'hub.challenge' |
#mode ⇒ String
Returns Subscription mode, typically "subscribe".
38 |
# File 'lib/strava/webhooks/models/challenge.rb', line 38 property 'mode', from: 'hub.mode' |
#response ⇒ Hash
Returns the response hash that should be sent back to Strava.
51 52 53 |
# File 'lib/strava/webhooks/models/challenge.rb', line 51 def response { 'hub.challenge' => challenge } end |
#verify_token ⇒ String
Returns Verification token to validate the request.
41 |
# File 'lib/strava/webhooks/models/challenge.rb', line 41 property 'verify_token', from: 'hub.verify_token' |