Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How do you list all webhook ID's monitoring a model?

Ryan January 13, 2021

How do I find out the webhook ID's currently monitoring a model?

2 answers

0 votes
Ryan January 20, 2021

<removed>

0 votes
milynnus
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 13, 2021

@Ryan 

You can list the Webhooks via api and extract the idModel. 

Ryan January 20, 2021

I have the idModel, what I need is the webhook id.

What API call do I make? Can you point me to some documentation?

milynnus
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 20, 2021

@Ryan 

I don't work with Rest API directly since I am using py-trello. Looking at the library and comparing with Trello API documentation it should be 

https://developer.atlassian.com/cloud/trello/rest/api-group-tokens/#api-tokens-token-webhooks-get


url = "/tokens/%s/webhooks" % token
return self._existing_hook_objs(self.fetch_json(url), token)

Ryan January 20, 2021

Hi @milynnus

Thanks for replying. What is the token in this scenario?

Is the token mentioned in this API reference documentation different to the token for authentication (i.e. secret & user token)?

https://developer.atlassian.com/cloud/trello/rest/api-group-tokens/#api-tokens-token-get

Thanks for your help.

milynnus
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 20, 2021

@Ryan 

 

Tried my hand on using REST API "as is". With the documented API example I got a 401. I supplied the key and it returned the list I wanted.

 

url = "https://api.trello.com/1/tokens/{}/webhooks".format(client.resource_owner_key)

headers = {
"Accept": "application/json"
}

query = {
'key': client.api_key,
'token': client.resource_owner_key
}

response = requests.request(
"GET",
url,
headers=headers,
params=query
)

print(response.text)
milynnus
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 20, 2021

@Ryan 

Because I am using BenkoBoard , there were webhooks registered with the token I used for that application. It is also the one I used for my application development hence I have a client - hence client.resource_owner_key...etc

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events