400 Error when creating a webhook

Hello,

I’m trying to create webhooks via the API. I get the following 400 error:

Could not interpret filters[0][action] as an identifier in filters[0][action].

When I do not specify filters it works but then of course my webhook is useless.

I am following the documentation and my syntax should be OK, I don’t understand what’s wrong?

Any help would be much appreciated.

Denis

Please show us your code if you’d like us to try to help debug it.

1 Like

I literally copied the sample form the doc. resource and target seem to be placed correctly because I have a specific error if I remove any of them.

image

Sorry for bumping this, but this is blocking our development for a cool feature in our integration with Asana :). Any help much appreciated.

Hi @denishacquin,

I think the issue is that resource_subtype is not supported for webhook filters; see this post:

Try removing the resource_subtype parameter and see if that works. Please let us know if it does or not!

@Ross_Grambo, it does look like the documentation is incorrect here as it does show a resource_subtype but that’s not allowed per your previous comment, right?

I’m afraid the problem remains. I initially tried without subtype. I only added it to be as close to the doc example as possible :).

Also the error clearly points to the filters.

Could not interpret filters[0][action] as an identifier in filters[0][action].

I tried various syntaxes for the keys but the error remains the same.

The API team is in the middle of making subtypes filterable. They deployed a change mid december but it was rolled back. I can see they’re still actively working on it. But until then, you’re correct. Subtypes are not supported.

Hello @denishacquin !

Could you try and recreate this is postman or insomnia? Everything works as expected for me with:

{
	"data": {
		"resource": "123457890",
		"target": "https://a1b2c3d4e5.ngrok.io/123456789",
		"filters": [
			{
				"action": "changed",
				"fields": ["due_at", "due_on", "dependencies"],
				"resource_subtype": "milestone",
				"resource_type": "task"
			}
		]
	}
}

I’m curious if it’s something your request library is doing to the call.