Getting started with Trello REST API

Please note that our support services don’t extend to custom scripts or any user-generated custom developments. Should you require help with custom scripts, the development of a Power-Up, or encounter any issues with your application that interfaces with Trello's API, we strongly encourage you to seek guidance and support from Trello’s Developer Community.

What's Trello API?

The Trello API is a simple yet powerful RESTful web API that provides programmatic access to Trello's resources. You can use the API to retrieve detailed information about boards, cards, members, and more and to create, update, and delete content, enabling powerful integrations and automation.

The benefits of using Trello’s API

  • Let users access their existing Trello data easily by making RESTful API requests

  • It can facilitate the integration between different systems by enabling seamless data exchange across Trello and other apps. This comes in handy when users or organizations need to share information between Trello and other apps, such as CRMs, for example.

  • Allows users to integrate their internal applications with Trello to ensure they can send data from these apps to Trello and vice-versa.

Furthermore, users and organizations can harness Trello’s API usefulness by creating customized Power-Ups based on their needs or custom scripts that perform certain actions on their behalf. The way you use Trello’s API will depend on your current needs.

Getting started with Trello’s API

Before we get started, here are a few API terms you should be familiar with:

用語

定義

API key

A unique passcode of letters and numbers that grants access to Trello API

Token

The API token is a unique passcode of letters and numbers that identifies a specific user. API tokens also carry the scope of access granted to a specific user

Because the token, along with the API key, can be used to read and write your entire Trello account, they should always be kept secret and never shared!

エンドポイント

The digital location where an API receives requests about its resources

Request method

Uses HTTP methods (GET, POST, PUT, DELETE) to tell to the Trello API what you want it to do

JSON object (JavaScript Object Notation)

JSON object is a way to store and transport data in a structured format that resembles JavaScript object syntax. You can learn more about JSON here

API call

Process of a client (your computer or the device that makes the API request) making an API request to a server

Status code

A number code that appears in the body of an API response that tells you if your request was successful or not. You can learn more about status codes here

API server

Authenticates and processes API requests before delivering an appropriate response

API レスポンス

A response generated by the API server and returned to the client (your computer or the device that originated the API request)

Because API tokens grant access to users' data, they should be kept secret. Moreover, because of the authorization flow, the API key is intended to be publicly accessible. An API key by itself doesn’t grant access to a user’s Trello data.

Furthermore, the token, along with the API key, can be used to read and write for your entire Trello account. Thus, tokens should always be kept secret and never shared!

To start using Trello’s API, you’ll need an API key. To generate an API key, you first need to create a Trello Power-Up. Creating a Power-Up is necessary to access Trello’s API because it’s tied to the process of generating an API key, which is crucial for authentication and making API calls. This will also ensure your API key is identified during the authentication process. To create a Trello Power-Up, you can visit our guide on creating your first Power-Up on this page.

Once you’ve already created a Power-Up, go to the https://trello.com/power-ups/admin page, access your Power-Up, navigate to the API key tab, and select the option Generate a new API key.

On the same page where you found your API key, click the hyperlinked “Token” at the right of the API key. You should be prompted with the following screen:

The API token authorization panel, asking you to allow access to your account.

Once you click “Allow,” you’ll grant your own Power-Up access to your account, and you’ll be redirected to a page that contains your API key and token.

Making your first API call

Now that you have your account's API key and token, you can start making API calls. There are many ways you can use Trello’s API to send API calls, such as:

  • Coding languages (JavaScript, Python, PHP, Node.JS, etc.) in case you want to write a script that interacts with Trello’s API.

  • API platforms like Postman or SoapUI. These API platforms offer user-friendly interfaces for APIs.

It’s totally up to you to decide which platform or coding language suits your needs.

One of the most popular API calls in Trello is the board's API endpoint. For example, you can get all the boards that belong to your user.

You can make a GET request to the API 1/members/{memberId}/boards endpoint and list all of the boards associated with your user.

curl 'https://api.trello.com/1/members/me/boards?key={yourKey}&token={yourToken}'

Be sure to replace the {yourKey} and {yourToken} parameters with the key and token values you previously generated. Otherwise, the API call will fail.

Once you’ve made the request above, you’ll receive a response that contains a JSON object with information about all of the boards you belong to.

With the information you have in the response, you can get more information from one of your particular boards. In this example, you can grab one of the board IDs from the JSON response you just received and plug it into the following API call:

curl 'https://api.trello.com/1/boards/{idBoard}?key={yourKey}&token={yourToken}'

This is just an example of how to get started using the Trello API, and from here, there are many directions you can explore. Feel free to delve into the Trello API documentation to discover more about its capabilities.

More API calls examples:

  • Get all the boards of your Workspace: curl 'https://api.trello.com/1/members/me/organizations/{organizationId}/boards

  • Get all cards on a board: curl 'https://api.trello.com/1/boards/{boardId}/cards?key=APIKey&token=APIToken

  • Get all users of Trello Enterprise: curl 'https://api.trello.com/1/enterprises/{enterpriseId}/members/query?key=APIKey&token=APIToken

その他のリソース

 

さらにヘルプが必要ですか?

アトラシアン コミュニティをご利用ください。