简体   繁体   中英

How to access current card id in Trello API

How can I programmatically get the currently displayed card id?

Looking through the Trello API documentation and in particular at the t.card() call, I'm left wondering if there is further documentation somewhere better describing the allowed fields. According to the snippet the link provides, the first parameter should be id , yet in the example it calls a string 'all' . Is 'all' some kind of keyword that represents all cards in a board? Is there a keyword for 'thiscard' or something similar?

All the other calls seems to require a card ID already , so I seem to be in a catch 22.

I'd eventually like to use this ID to create a checklist but this also requires a card ID.

Use the following code snippet to get the card id.

/* global TrelloPowerUp */

var t = TrelloPowerUp.iframe();
t.card('id')
    .then(function (name) {
        console.log(name);
});

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM