Authorized access

  collapse = TRUE,
  comment = "#>"

Authentication is required in order to access boards that are not public, and to make edits. This document explains how to authenticate your access to Trello.

Getting your access token

A secure token is required to authenticate your access to Trello. To obtain it, login to Trello and visit You will need to do two things there:

Back in R, feed the key and secret to the get_token() function. This will trigger first-time authorization in the browser, allowing you to cache your token locally. You only have to do it once for a given project, unless you opt out of using cache or the cache file is deleted.

my_token = get_token("my-app", key = your_key, secret = your_secret)

This will create an object of class Trello_API_token. Functions in the TrelloR package will always try to read cached token when needed, unless you supply a token object directly. For example, any of these will work with local cache in place:

my_boards = get_my_boards()
my_boards = get_my_boards("path/to/cache/file")

# Works without a cache file, if `my_token` is a Token object.
my_boards = get_my_boards(my_token)

You can create multiple tokens with different names, scope and expiration. See ?get_token for additional arguments.

Keep your credentials safe

Keep your key, secret and any token cache in a safe, non-shared location. Using environment variables or packages like askpass are good options.

Token cache is by default stored in a file called .httr-oauth. You should avoid accidentally copying or exporting this file along with other files. To make this easier, the cache file path is automatically added to .gitignore.

If you think the token might have been compromised or you simply do not want to use it anymore, you should revoke it. Log in to Trello and access your account settings. To make it easier to recognize tokens you have created, use the appname argument when creating a token.

Built with


Try the trelloR package in your browser

Any scripts or data that you put into this service are public.

trelloR documentation built on April 22, 2021, 1:07 a.m.