Receive event from webhook

I am new to Asana-PHP library and I have combed through the forum but didn’t get an answer to my post. I am building an app where once a user’s task is closed, a mail must be sent to the aforementioned user. For that purpose, I created a webhook for the specific project using cURL, where the filter: action = changed. The webhook is created correctly and on ‘get’-ting the webhook, the correct details are displayed.

I have set my server’s URL and filename for the target. I am echo-ing the data from PHP:\input onto the screen. Once I edited a task, I expected the webhook will pass the data onto my script. I am unable to receive the event data from webhook. I am sure I am making an extremely silly mistake but I am unable to decipher it.

This is my webhook information
“data”: {
“gid”: “NUMBER”,
“resource_type”: “webhook”,
“resource”: {
“gid”: “NUMBER”,
“resource_type”: “project”,
“name”: "Name "
“target”: “https://URL/file.php”,
“active”: true,
“created_at”: “2022-11-11T09:06:04.546Z”,
“last_failure_at”: null,
“last_failure_content”: “”,
“last_success_at”: “2022-11-11T09:06:05.003Z”,
“filters”: [
“resource_type”: “task”,
“resource_subtype”: null,
“action”: “changed”,
“fields”: [

Do I have to refresh the page after editing the task in Asana to fetch the event?

Thank you

No, that’s not needed; Asana sends the event right away after a change.

I don’t know PHP so probably can’t be of too much help; there are PHP devs in here so hopefully they’ll respond.

One thing to note - this is probably not the source of your problem but I’m not sure that dependencies is available as a valid filter. You might try creating a webhook without that parameter and see if it makes a difference. Just a thought.

1 Like