Can't get webhook id

Hi everyone! Sorry for my English :slight_smile:
I created webhook in test workspace between asana and my server. It is worked fine but now I work from another PC and I can`t get any webhooks on my server, on console from new PC.
browser
%D0%92%D1%8B%D0%B4%D0%B5%D0%BB%D0%B5%D0%BD%D0%B8%D0%B5_001
Just empty array. Webhook working and I see information from asana. Another queries like ā€˜get userā€™ work fine. Can you help me, please?

1 Like

Can you share the code you are using?

1 Like

In application I use package for laravel (GitHub - Torann/laravel-asana: Asana API wrapper for Laravel).
But I tried use console


and result the same

1 Like

So depending on the computer you run the code on, the result is different? Are you logged with the same account everytime?

1 Like

I can confirm that getting the webhooks for the whole workspace is no longer working since it always returns an empty array.
The only way itā€™s getting the webhooks is if we specify the resource_id in the params with the workspace.
Does someone know it this was an intentional change? Because from the documentation it should still be possible to get all the webhooks related to a workspace.

Actually, it seems that it happens only for some workspaces, and not for all of them.

"So depending on the computer you run the code on, the result is different? " -Unfortunately, I think yes. But I can check it only tomorrow.
ā€œAre you logged with the same account everytime?ā€ - yes, I have just one account in asana, but maybe it can depends from ā€˜PERSONAL ACCESS TOKENSā€™. I have two tokens.

FYI I did some testing and am seeing this same issue.

@Joe_Trollo @Matt_Bramlage @Jeff_Schneider Guys, any info on this issue?

I checked my hunch and I was right - if you have two tokens (first and second), and you created one webhook (using the first token), then you cannot see it using the second token

I still think thereā€™s something else going on, though - Iā€™m using OAuth and even though Iā€™m using a token generated from the client credentials that created the webhooks, Iā€™m getting an empty array back when trying to list the webhooks in a workspace.

Hello,

Is it normal than having multiple webhooks already created in my app I get:
https://app.asana.com/api/1.0/webhooks?workspace=id_of_my_workspace

{
ā€œdataā€:
}

The same thing happends with the client library for python:
webhooks = list(self.client.webhooks.get_all(data))

returns an empty list.

are they lost, or am I doing something wrong?
Thanks!

It seems to be a current issue; see this thread:

Iā€™m hoping to hear some input from the Asana API team (@Joe_Trollo @Matt_Bramlage @Jeff_Schneider).

1 Like

Thanks @Phil_Seeman! Am I good merging this thread with Can't get webhook id so?

Yep, I would merge them.

1 Like

All done! As always, thanks for your help @Phil_Seeman

Hi @Damian_Kobza and @Phil_Seeman: so far we have been unable to replicate this issue internally. I have been able to create a webhook via POST /webhooks and then view that webhook in GET /webhooks?workspace=<workspace>. Can you provide more information about how you encounter this issue?

@BorschEugene, that is correct: webhooks are only visible to the user and app/PAT that created them (different PATs canā€™t see each otherā€™s webhooks).

@Joe_Trollo Well, it seems that in my case, in the instance where I was getting an empty array of webhooks for a workspace, there really were no webhooks for that workspace for that app key.

While that explains the empty array, itā€™s a bit disconcerting as those were valid active webhooks and I have a server routine that should have been responding to them. But it seems sometime in the past month or so (I havenā€™t been monitoring this endpoint), the webhooks disappeared.

I wonder if it could be related to the network error issue?

In any case, I have a new set of webhooks created with a different app id which does get properly returned. Iā€™ll be monitoring those actively and weā€™ll see if they also disappear at some point.

We see the same here. The API does return an empty array. If we however recreate the very same web hook we receive an error message as it already exists. Itā€™s the same API key used. The unchanged code worked fine some time ago.

1 Like

In my case, I was testing the webhooks for some of our users that had problems syncing Asana projects with our service. During the tests i stumbled on this problem for some of them, but not all of them. I do not know why but it seems that for some Asana accounts the GET /webhooks?workspace=<workspace> endpoint returns an empty array but for other it returns correctly an array of all the webhooks in the account.

Hi Joe,

Is this issue still persisting? I am having the same problem. I created a webhook to a project then used : curl -H ā€œAuthorization: Bearer ā€
https://app.asana.com/api/1.0/webhooks/?workspace=workspace to get the webhooks and it returns an empty array.