Trello API:如何获取组织或成员的董事会id

Trello API: how to get board ids of an organisation or member

本文关键字:成员 id 董事会 获取 API 何获取 Trello      更新时间:2023-09-26

我正在研究一个基于GitHub的Trello同步机器人:https://github.com/fiatjaf/trello-cardsync,我正在研究coffeescript文件。我看过API,我想我知道我需要什么,我只是不知道如何准确地写它,我找不到任何例子,特别是在coffeescript(或javascript)。

我希望能够通过组织董事会或成员董事会进行搜索,然后挑选出某些董事会id,这样我就可以得到我想要的某些董事会的董事会id列表,然后我可以为这些董事会创建webhook。

我试过使用Trello.get("members/me/boards", { fields: "id, name"})来获得所有的板id和名称,就像在client.js API 'Trello中一样。get(path[, params], success, error)',但是当我试图将其打印到控制台时,我的get只是返回unidentified。我在settings.coffee文件中有一个对象数组来比较名称,以选择我想要的板,但我无法在我的文件中获得完整的列表。目前,我只是从链接中查看数据:https://trello.com/1/members/my/boards?key=substitutewithyourapplicationkey&token=substitutethispartwiththeauthorizationtokenthatyougotfromtheuserand手动输入id以创建webhook,但我想尽可能地自动化此操作。

我也看了"GET/1/搜索"在Trello API,但我不确定如何在我的coffeescript文件。

您需要传递一个回调给Trello.get。它不返回任何有意义的东西,而是将值传递给回调:

Trello.get("members/me/boards", { fields: "id,name"}, function(err, boards) {
  console.log(boards); // got them!
  console.log(err); // if something went wrong, this will be non-null
})