Can't get webhook id


#1

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?


Get Asana Webhooks
Webhooks not working
Get Asana Webhooks
#2

Can you share the code you are using?


#3

In application I use package for laravel (https://github.com/Torann/laravel-asana).
But I tried use console


and result the same


#4

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


#5

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.


#6

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


#7

"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.


#8

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

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


#9

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


#10

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.


#11

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!


#12

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).


#13

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


#14

Yep, I would merge them.


#15

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


#16

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).


#17

@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.


#18

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.


#19

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.