Response payload in Homey Webhook

Hi all,

I want to create an App to respond to webhook calls orginating from Strava (https://www.strava.com/).

For that to work I have followed the steps described on https://developers.strava.com/docs/webhooks. I also created a Webhook in Homey for this.

I now want to ‘create a subscription’ on Strava by calling the https://www.strava.com/api/v3/push_subscriptions API method. This method checks the Homey Webhook which I created by;

  • calling it with a GET request to my Homey Webhook and providing a hub.challenge key in the query string
  • checking the response (is the HTTP response code 200 AND does it echo the hub.challenge key in the response body as application/json content type)

The Homey Webhook responds with a HTTP 200 OK but does not echo the hub.challenge key. Therefore I get the following response from the Strava subscription API method:

{ "message": "Bad Request", "errors": [ { "resource": "PushSubscription", "field": "callback url", "code": "not verifiable" } ] }

My question is: how can I echo the hub.challenge key to strava so it will accept my provided Webhook?

It doesn’t look like Homey’s webhook implementation supports sending data back.

A workaround would be to implement a public Web API endpoint for your app. These can be called from external hosts (like the Strava servers) and you have a bit more control over how to handle such requests and what to send back.

Thanks for your suggestion @robertklep. :slight_smile:

I will do some research on using the Web API and share my results here within time.

Just spent the evening developing the solution with the public Web API endpoint and I can confirm it works like a charm :slight_smile:

I can send back a response body and with that it works. Thanks for the tip!

1 Like