Hello, I have a question regarding webhooks. I have a webhook for my project, which triggers when I change the name of the task. I would like to know if it is possible for the body of the webhook event to return the new name of the task.
Welcome to our developer forum. To answer your question “I would like to know if it is possible for the body of the webhook event to return the new name of the task” → No. We do not have a way for developers to specify what properties are returned in the webhook event. You must make a separate API call to get that information. This is by design to limit the amount of sensitive data that is sent in webhook events in case the event gets intercepted.
Here’s a scenario of what we recommend:
- Let’s say you established a webhook in Asana and specified in your webhook filter to receive events on task name changes in PROJECT_A
- User in Asana changes the name of a task in PROJECT_A
- Asana sends a webhook event to your target webhook URL with data looking like:
[
{
user: { gid: '<USER_GID>', resource_type: 'user' },
created_at: '2023-04-16T23:49:58.599Z',
action: 'changed',
resource: {
gid: '<TASK_GID>',
resource_type: 'task',
resource_subtype: 'default_task'
},
parent: null,
change: { field: 'name', action: 'changed' }
}
]
- Use the
<TASK_GID>
with our Get a task to get the name of the task
1 Like
Thank you very much for the answer, and especially for the speed of the response!
1 Like