Webhook Creation - 404 error issues (SnapLogic)

Hello all,

I’ll start this off by saying I’m new to Asana’s API. I’ve gone through the API documentation and other forum posts as much as I can but can’t seem to find the answer, so hopefully someone has run across this issue before and can lend me some tips. I’ll also preface that I’ve tested out some basic GET/POST calls and it works just fine, it’s just the webhook part that’s throwing me for a loop.

I’m using a SnapLogic Ultra Pipeline task as my trigger URL, since that is our primary iPaaS tool that I’m working out of and that’s how we normally would set up our webhooks for other apps. I know that the target URL works, because I can paste it into my browser, see the response and then see the document pass through successfully in my tool’s dashboard. Yet when I attempt to send the POST call for creating the webhook, no document passes through and I’m met with the following error:

{
    "errors": [
        {
            "message": "The remote server which is intended to receive the webhook responded with an incorrect status code: 404",
            "help": "For more information on API status codes and how to handle them, read the docs on errors: https://developers.asana.com/docs/errors"
        }
    ]
}

I’m only including the basic required resource and target parameters in the body and nothing else (no filters or subtypes):

Headers:
Content-type: application/json
Accept: application/json

Body
{
  "data": {
    "filters": [
      {
        "action": "changed",
        "resource_type": "task"
      }
    ],
    "resource": "12007960xxxxxxxx",
    "target": "(my target url)"
  }
}

I feel like I’m missing something, but can’t seem to find it among any of the documentation. Any ideas as to why the webhook creation isn’t hitting the target URL correctly?

Thank you!

Hi @anon96762600 - Thanks for posting this.

Just wanted to share that I have recently run into this, and that the issue here was that the target URL from Snaplogic had a %20 or space character, which was causing the 404 as Asana was likely truncating the URL or not allowing the space character when making the call. I recommend changing spaces to underscores.

Additionally, ensure you are returning the “X-Hook-Secret” header to complete the webhook handshake, per the webhook documentation here: Webhooks

Hope this helps anyone who may find this issue in the future.

Ben

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.