Trello webhook setup needs HTTP HEAD capability

Options
I am setting up a webhook in Trello. I am using the webhook call from Trello into Xano to keep the data in Xano up-to-date in real-time.

Trello has APIs that are used to create, get and delete a webhook. Initially, I created a webhook and used the webhook.site URL for testing. Everything works great and I get the webhook data as expected.

The issue comes with how Trello validates a webhook you are setting up via their webhook create api. Trello sends an HTTP HEAD request to the URL specified for the webhook (Xano api url) and expects an HTTP 200 response before it will setup the webhook. If Trello doesn't get a 200 status it fails the create of the webhook.

How would I go about getting a 200 status returned to Trello when it sends the HTTP HEAD request to the Xano api url I am using for the webhook?

Comments

  • Ray Deck
    Ray Deck Trusted Xano Expert ✭✭✭
    Options
     can set me straight, but I believe that Xano does not currently support TRACE, CONNECT or HEAD http methods. (It does support coding GET, POST, PUT, DELETE and PATCH, and it allows OPTIONS requests but doesn't let you directly control responses AFAICT.) I just tested with curl, and using a HEAD request on either a GET or POST endpoint generates a 404. 

    That said, HEAD is pretty unusual - it even generates a warning in curl when I use it. As a matter of experimental fact, are you experiencing a 404 from Trello's webhook scout that is blocking you?
  • Steve Stava
    Steve Stava Member
    Options
    Yup, it gives a 404 as you would expect :-). Since an HTTP head request is similar to a GET but without returned content I gave that a try as well but as you would expect it didn’t work.
  • Ray Deck
    Ray Deck Trusted Xano Expert ✭✭✭
    Options
    Oof! Let's see if the team has an answer for Xano, otherwise you'd need to "wrap" the API endpoint with another service that can respond to the HEAD request, and just forward your payload from the subsequent POST to Xano. 
  • Sean Montgomery
    Sean Montgomery Administrator

    ADMIN

    Options
     we will be adding the HEAD verb. It will be in the next build which should be Monday. Big release coming!
  • Steve Stava
    Steve Stava Member
    Options

    that is excellent. Thanks! I can go crazy with Trello webhooks 🥳
  • Sean Montgomery
    Sean Montgomery Administrator

    ADMIN

    Options
    this is now released
  • Steve Stava
    Steve Stava Member
    Options
     It works perfectly! Thanks 😃 

    I was able to create a clone of my webhook API and change it from a POST to a HEAD. 

    When I called the Trello webhook create API it called back to the URL I had set as the webhook API in Xano with a HEAD request and received the status of 200 it wanted. Trello then created the webhook!

    I was also able to use the existing functions in Xano to compare the HTTP header X-Trello-Webhook to confirm that what my webhook is receiving is actually from Trello (this header value is a base64 encoded value of an HMAC-SHA1 hash. The hashed content is the binary representation of the concatenation of the full request body and the callbackURL)
    https://developer.atlassian.com/cloud/trello/guides/rest-api/webhooks/ 

    Lots of fun...now anytime something changes in Trello I receive a webhook call and can make real-time updates to the Trello data I have stored in Xano