How to get an approval_status new state following a webhook notification on status change?

Hi,

I created a webhook and I get notifications on approval_status change, for example:
Webhook data:

“resource”: {
“resource_subtype”: “approval”,
“gid”: “1200874056484601”,
“resource_type”: “task”
},
“change”: {
“action”: “changed”,
“field”: “approval_status”
},

The webhook data doesn’t include the new approval_status state (approved/rejected/request changes)

In order to get the new status I tried calling getTask for the same task gid but for some reason this returns with resource_subtype ‘default_task’ instead of ‘approval’ and it doesn’t include an approval_status data field in the response.

GetTask response:

gid: ‘1200874056484601’,
resource_subtype: ‘default_task’

How should I get the new approval_status?

Hi @Hadar_Bejerano and welcome to the forum!

How specifically are you doing that call? (And you’re definitely doing it with an authorization token that’s authorized for Business or Enterprise?)

I just tried the GET /tasks/{task gid} endpoint in the Asana API Explorer and it worked as we’d expect - it returned a resource_subtype of approval and returned the approval_status field.

2 Likes

Hi,

Thanks for your response.
I’m using a personal access token of a free account which is still on a trial period, so that’s might be the reason.

Thanks.

1 Like

I’m 98% sure that’s it - think you’d need a token from a Business or Enterprise account to access approval-related data.

1 Like

This topic was automatically closed after 6 days. New replies are no longer allowed.