Asana Webhook are giving me empty events

Hi guys,
A week ago, I did a webhook that give me details from tasks in a project. Everything was working fine but when I went to do the same webhook in other project I just can receive empty events. The two webhooks looks the same, and I don’t know what I’m doing wrong, can anyone help me?

Hi @Giulia_Maia_Costa and welcome to the forum!

Do you have any filters set on the webhook? Can you post the exact webhook request here so we can take a look at it?

Also, please note that you will receive empty webhooks periodically from any webhook - Asana “pings” all webhooks periodically with a blank event to make sure they’re still active, and it deactivates webhooks if it doesn’t get a response to those pings after a while. So empty events in themselves aren’t an issue.

Of course! There it is:

public Webhook createWebhook(User user, String resource) {
	Webhook result = null;
	String[] fields = { "completed" };

	List<WebhookFilter> list = new ArrayList<WebhookFilter>();
	list.add(WebhookFilter.builder().resource_type("task").action("changed").fields(fields).build());
	list.add(WebhookFilter.builder().resource_type("task").action("added").build());

	try {
		result = this.getAsanaClient(user.getAsanaToken()).webhooks.createWebhook().data("field", "added")
				.data("filters", list).data("target", String.format("%s?resource=%s", asanaTarget, resource))
				.data("resource", resource).execute();
		logger.info("Asana webhook established sucessfully for project = " + resource);

		asanaInfoService.save(result, user, this.createSync(resource, user.getAsanaToken()));

	} catch (Exception e) {
		logger.error("Error trying to establish asana webhook = " + e.getMessage());
	}

	return result;
}

PS: I have the same webhook in another project, so I do a asana event (like complete a task) and I receive the event in one application, but I don’t in this (just the empty event I talked about)

Hi, just to update: I resolved this just changing the "JsonObject"in the asana target to a String. I still don’t know why it works in a project and doesn’t in other, but okay! It’s fine now haha

1 Like