【问题标题】:How to get the id of an attached Trello ticket in the API如何在 API 中获取附加的 Trello 票证的 ID
【发布时间】:2018-09-13 16:16:22
【问题描述】:

我想以编程方式查找和访问 trello 票证 B,它是票证 A 的附件。

所以,我有票证A,我通过调用https://developers.trello.com/reference#cardsidattachments检索附件

但是,在响应中,如果附件 B 本身是 Trello 卡,我只会得到 B 的短网址。

如何获取B 的ID,以便使用https://developers.trello.com/reference#cardsid 检索B 的详细信息?

有没有办法从shortURL 中获取B 的id?

【问题讨论】:

  • 顺便说一句,通过网络,我当然可以通过转到shortUrl+'.json' 来做到这一点 - 但是我需要登录,并且不能为此使用 API。

标签: trello


【解决方案1】:

所以基本上你想要的是从 URL 获取id。据我所知,这是不可能的。在我的情况下,我通过另一个这样的请求解决了它。

function main() {
  for(let i=0; i<input.length; i++) {
    input[i] = input[i][0].slice(0, 29);  //takes short url
    let target = input[i] + '.json';

    let xhr = new XMLHttpRequest();
    xhr.open("GET", target);
    xhr.addEventListener("readystatechange", function() {
      if(this.readyState === this.DONE) {
        let json = JSON.parse(this.responseText);
        console.log(json['id']);
        ...

input 是您想知道其ids 的 Trello URL。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-03-18
    • 1970-01-01
    • 2017-10-07
    • 1970-01-01
    • 1970-01-01
    • 2020-07-31
    • 2021-01-30
    相关资源
    最近更新 更多