Issue with webhook event.

Hello! So I’m writing a server that will receive webhooks of a tasks info when created in an asana project. The Issue is I established a webhook with my server, I used this in Postman:
{
“data”: {
“filters”: [
{
“action”: “added”,
“resource_type”: “project”
}
],
“resource”: “MyId”,
“target”: “MyEndpoint”
}
}
I successfully esatblished the link but when I add a task to the project I dont recieve a webhook. Am I using the wrong event for what I want to do? Or is it an issue in the setup?

Hi @John_Gonzalez1,

Issuing that call is just the first part of creating a webhook. After that, Asana will reply and you need to respond that reply to complete the handshake. Subsequent to that, your server also needs to respond whenever it receives a heartbeat event in order to remain active.

Hi @John_Gonzalez1

It is not really clear to me what resource “MyId” is associated to in your example. But from the looks of your filter it looks like you are asking for webhook events for a project being added not a task. Hence why you did not receive any events for "when I add a task to the project I dont recieve a webhook"

If you would like to receive webhook events when a task is added to a particular project (<YOUR_PROJECT_GID>) try the following request body when you Establish a webhook

{
    "data": {
        "filters": [
            {
                "action": "added",
                "resource_type": "task"
            }
        ],
        "resource": "<YOUR_PROJECT_GID>",
        "target": "<YOUR_WEBHOOK_TARGET_URL>"
    }
}

With the above request body → You will receive all task added event types in the specified project. So in this case some events include:

  • a task added to a project
  • a task addd to a section in the project

So most likely if you add a task to a project with the above filters you will receive two task added events. 1 for adding the task to the project you can see this in the parent value of the event response and 2 for adding the task to a section in the project. Again, you can distinguish this by looking at the parent value in the response.

Also, keep in mind the webhook heart beat events and webhook handshake that @Phil_Seeman mentioned when implementing our webhooks.