Hi All,
I have a use case in which I need some clarification.
-
Undeleted option - what’s the purpose?
While creating a webhook for a project, this option will available only for few mins/sec when you after click delete.
eg:
url = “https://app.asana.com/api/1.0/webhooks”
headers = {
“accept”: “application/json”,
“content-type”: “application/json”,
“authorization”: "Bearer "+access_token
}
portfolio_webhook_payload = { “data”: {
“resource”: reporting_portfolio_gid,
“filters”: [
{
“resource_type”: “project”,
“action”: “added”
},
{
“resource_type”: “project”,
“action”: “removed”
},
{
“resource_type”: “project”,
“action”: “deleted”
},
{
“resource_type”: “project”,
“action”: “undeleted”
}
],
“target”:portfolio_webhook_target_url
} }
response = requests.post(url, json=portfolio_webhook_payload, headers=headers) -
Validity of a webhook - if a webhook was created, but never used or touched how long will the webhook exist.
-
Restrict filter only to completed project ( project status)
When a webhook is created for a project focused on project status change. Can we make it trigger only for a specific value “completed_at”. Currently webhook will trigger for any change in the status but we want it to trigger only when a project status changes to “completed_at”.
eg:
url = “https://app.asana.com/api/1.0/webhooks”
payload = { “data”: {
“resource”: project_gid,
“target”: project_webhook_target_url,
“filters”: [
{
“resource_type”: “project”,
“action”: “changed”,
“fields”: [“completed_at”]
}
]
} }