# Public boards can be accessed without authorization, so there is no need
# to create a token, just the board id:
url = "https://trello.com/b/wVWPK9I4/r-client-for-the-trello-api"
bid = get_id_board(url)
# Getting resources from the whole board. `filter="all"` fetches archived
# cards as well.
labels = get_board_labels(bid)
cards = get_board_cards(bid, filter = "all")
# It is possible to call `get_resource()` directly:
lists = get_resource(parent = "board", child = "lists", id = bid)
# As with boards, cards can be queried for particular resources, in this case
# to obtain custom fields:
card = cards$id[5]
acts = get_card_fields(card)
# Set `limit` to specify the number of results. Pagination will be used
# whenever limit exceeds 1000. Use `limit=Inf` to make sure you get all.
if (FALSE) {
all_actions = get_board_actions(bid, limit = Inf)
}
# For private and team boards, a secure token is required:
if (FALSE) {
key = Sys.getenv("MY_TRELLO_KEY")
secret = Sys.getenv("MY_TRELLO_SECRET")
token = get_token("my_app", key = key, secret = secret,
scope = c("read", "write"))
# Token is now cached, no need to pass it explicitly.
cards_open = get_board_cards(board_id, filter = "open")
}
Run the code above in your browser using DataLab