I successfully deployed my asana app and the endpoints to heroku which are now all working.
Now i’m trying to execute the webhook. I’m currently getting the error with the message
message: 'You should specify one of resource',
2021-09-22T17:20:27.693066+00:00 app[web.1]: help: 'For more information on API status codes and how to handle them, read the docs on errors: https://asana.com/developers/documentation/getting-started/errors'
I have two web-hooks
- My first webhook would execute the target script when a new task is added to a section :
note: the the resource id here im using is the section id.
var webhookEvent = {
"data": {
"filters": [
{
"action": "added",
"resource_type": "task"
}
],
"resource": "XXXXXXXXX", // This is the id of the section
"target": "https://XXXXXXX/create_task" // this is where web-hooks script is
}
}
- The second webhook is to execute a different script when a specific task in a section is marked as completed (TICK)
note: the resource id im trying to use here the task id.
var webhookEvent = {
“data”: {
“filters”: [
{
“action”: “changed”,
“fields”: [
“completed” // when your clicks completed it will generate the task
],
“resource_type”: “task”
}
],
“resource”: “XXXXXXXXXX”, // This is the id of the generate score field task
“target”: “https://xxxxxx/score” // this is where your web-hooks
}
}
Could you help me to correct my syntax here for the filter i’m using for both 1 and 2.
Or is there anything else i’m doing wrong?
I would greatly appreciate your help here.
Thanks