Hello! I’m new to the Asana API, and fairly new to manually creating webhooks…
I am creating approval tasks and hope to trigger a webhook whenever the approval task status is changed (approved, rejected, change requested) in my project (“IAM Tasks”). I would like the webhook to send the gid and due information. (Ideally, it would also send the name/description, but I’d settle for the gid)
Here is the body of my webhook creation request
{
“data”: {
“filters”: [
{
“action”: “changed”,
“fields”: [
“gid”,
“name”,
“due_on”
],
"resource_subtype": "approval",
"resource_type": "task"
}
],
"resource": "XXXXXX",
"target": "XXXXX"
}
}
and the response:
{
“response”: {
“status_code”: 201,
“headers”: {
“server”: “nginx”,
“date”: “Fri, 21 May 2021 13:21:38 GMT”,
“content-type”: “application/json; charset=UTF-8”,
“content-length”: “478”,
“connection”: “close”,
“location”: “/api/1.0/webhooks/XXXXX”,
“cache-control”: “no-store”,
“pragma”: “no-cache”,
“set-cookie”: [
“TooBusyRedirectCount=0”
],
“x-frame-options”: “DENY”,
“x-xss-protection”: “1; mode=block”,
“x-content-type-options”: “nosniff”,
“content-security-policy”: “report-uri https://app.asana.com/-/csp_report?report_only=false;default-src ‘none’;frame-src ‘none’;frame-ancestors ‘none’”,
“x-asana-api-version”: “1.0”,
“asana-change”: “name=new_user_task_lists;info=Update on our planned API changes to user task lists (a.k.a. My Tasks)”,
“x-robots-tag”: “none”,
“strict-transport-security”: “max-age=31536000; includeSubDomains”,
“datacenter-time-end”: “1621603298.133”,
“x-loadbalancer”: “prod-lb013.ec2”
},
“body”: {
“data”: {
“gid”: “XXXX”,
“resource_type”: “webhook”,
“resource”: {
“gid”: “XXXX”,
“resource_type”: “project”,
“name”: “IAM Tasks”
},
“target”: “XXXXXXX”,
“active”: true,
“filters”: [
{
“resource_type”: “task”,
“resource_subtype”: “approval”,
“action”: “changed”,
“fields”: [
“gid”,
“name”,
“due_on”
]
}
],
“created_at”: “2021-05-21T13:21:35.534Z”,
“last_failure_at”: null,
“last_failure_content”: “”,
“last_success_at”: “2021-05-21T13:21:37.794Z”
}
}
}
}
The changes only trigger the webhook intermittently (I’ve received one notification out of 3-4 changes to the status of a task in the project), and when I do receive the notifications, they are essentially blank, as seen below:
{
“method”: “post”,
“path”: “/”,
“body”: {
“events”:
},
“query”: {},
“headers”: {
“accept-encoding”: “identity”,
“content-length”: “13”,
“content-type”: “application/json”,
“host”: XXXXX
“user-agent”: “Asana”,
“x-amzn-trace-id”: “Root=1-60a7b4d8-402a26017c38a95100243f8d”,
“x-asana-request-signature”: “XXXXXXX”,
“x-forwarded-for”: “3.239.117.148”,
“x-forwarded-port”: “443”,
“x-forwarded-proto”: “https”,
“x-hook-signature”: “XXXXX”
}
}
Any suggestions would be appreciated!