簡體   English   中英

如何獲取 Trello 列表中最重要的卡片的某些信息?

[英]How do I get certain info of the top card on a Trello list?

我希望獲得名稱 label 以及我板上的一個 Trello 列表中前幾張卡的到期日期,並使用我的機器人通過 Discord 發送它。 我將如何獲得此信息?

您將不得不使用 API,並使用 fetch 庫來發出請求。 他們舉了一些例子來說明如何像這樣使用他們的 API:

// This code sample uses the 'node-fetch' library:
// https://www.npmjs.com/package/node-fetch
const fetch = require('node-fetch');

fetch('https://api.trello.com/1/cards?key=0471642aefef5fa1fa76530ce1ba4c85&token=9eb76d9a9d02b8dd40c2f3e5df18556c831d4d1fadbe2c45f8310e6c93b5c548&idList=5abbe4b7ddc1b351ef961414', {
  method: 'POST'
})
  .then(response => {
    console.log(
      `Response: ${response.status} ${response.statusText}`
    );
    return response.text();
  })
  .then(text => console.log(text))
  .catch(err => console.error(err));

你有很多選擇要處理,就像 php 選項( link/page?option=WhatsYouWAnt&option2=... )。 API 頁面上列出了所有選項。 它使用承諾來返回答案,所以一定要知道你在做什么。

API特雷羅 API

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM