在Trello上查找现有的Webhooks ID
我已经使用Trello的API( Node JS包 )添加了webhooks。 我如何获得当前的webhook,或者如何获得现有的webhook ID?
无法find通过API的方法: https : //developers.trello.com/advanced-reference/webhook
这里说:
有三种方法可以删除webhooks。
- 在webhook上使用DELETE路由DELETE https://api.trello.com/1/webhooks/[WEBHOOK_ID]?key=[APPLICATION_KEY]&token=[USER_TOKEN]
- 如果来自Trello的webhook请求在发送到callbackURL时收到HTTP 410 Gone响应,则WebHook将被删除。
- 如果webhook绑定的标记被撤销或过期,则webhook将被删除
第一种方法需要身份证,第二种方法要求我每次要删除一个webhook都取下服务器,第三种方法不是更好。 任何想法如何获得ID?
以下是获取应用程序创build的所有webhook的API请求:
GET https://api.trello.com/1/members/me/tokens?webhooks=true&key=[APPLICATION_KEY]&token=[USER_TOKEN]
下面列出了Trello API Documentation / 1 / members / [id] / tokens的相关部分:
GET / 1 / members / [idMember或username] / tokenslink必需的权限:读取,拥有,帐户
参数
filter
(可选)
- 默认:
all
- 有效值:
all
,none
webhooks
(可选)
- 默认:
false
- 有效值:其中一个:
true
,false
另外请注意, 我被用作idMember或Username
注意:如果您将我指定为用户名,则此调用将作出响应,就像您提供与提供的令牌关联的用户名一样
请参阅Trello API文档/ 1 / members / me
以下是我得到的JSON响应示例:
{ "id": "568d40cc3aa021f1b3602ea0", "identifier": "Server Token", "idMember": "562d50bc3aa020f1b3602ec0", "dateCreated": "2016-05-30T22:01:15.721Z", "dateExpires": null, "permissions": [ { "idModel": "562d50bc3aa071f1b3602ec6", "modelType": "Member", "read": true, "write": true }, { "idModel": "*", "modelType": "Board", "read": true, "write": true }, { "idModel": "*", "modelType": "Organization", "read": true, "write": true } ], "webhooks": [ { "id": "5675a0a8159fbeef4b796da3", "description": "Feature Requests Board", "idModel": "55a1176a0b620663da985753", "callbackURL": "http://example.com/trello/webhook-callback?type=features", "active": true }, { "id": "5673a0ac6ab60af7ec3a706b", "description": "Bugs Board", "idModel": "541ebcf34c03910922ff0fc3", "callbackURL": "http://example.com/trello/webhook-callback?type=bugs", "active": true } }
您可以使用令牌资源来查看webhook的列表。
看到这里: https : //developers.trello.com/advanced-reference/token#get-1-tokens-token-webhooks
GET / 1 /令牌/ [令牌] / webhooks
如果您使用相同的标记创buildwebhook,则[token]等于[USER_TOKEN]。