Skip to content
Rasmus Wulff Jensen edited this page May 12, 2023 · 64 revisions

This is the Main Client to communicate with the Trello API (aka everything is done via this)

Creating a new TrelloClient

In order to instantiate the client you need to provide:

Option Description
ApiKey (Required) The Trello API Key you get on https://trello.com/power-ups/admin/
Token (Required) Your Authorization Token you generate get on https://trello.com/power-ups/admin/
Options (Optional) Various options for the client (if null default options will be used) See below for details
HttpClient (Optional) Optional HTTP Client if you wish to specify it on your own (else an internal static HttpClient will be used for re-use)

Example

TrelloClient client = new TrelloClient("APIKey", "TOKEN");

TrelloClientOptions

The TrelloClientOptions can be passed optionally to the TrelloClient Constructor with the following options:

Option Description
ApiCallExceptionOption Control level of URL Details are shown in Exceptions from calls to the API
AllowDeleteOfBoards Controls if it is allowed to delete Boards (secondary confirmation)
IncludeCustomFieldsInCardGetMethods Control if cards should retrieve Custom Fields when retrieving cards (WARNING: Non-Get-Methods returning Card will NOT include Custom fields)
IncludeAttachmentsInCardGetMethods Control if cards should retrieve Attachments when retrieving cards (WARNING: Non-Get-Methods returning Card will NOT include Attachments)
AllowDeleteOfOrganizations Controls if it is allowed to delete Organizations (secondary confirmation)

Features of the API

Action Features

Feature Description
GetActionsOfBoardAsync Get the most recent Actions (Changelog Events) of a board
GetActionsOnCardAsync Get the most recent Actions (Changelog Events) on a Card
GetActionsForListAsync Get the most recent Actions (Changelog Events) for a List
GetActionsForMemberAsync Get the most recent Actions (Changelog Events) for a Member
GetActionsForOrganizationsAsync Get the most recent Actions (Changelog Events) for an Organization

Attachment Features

Feature Description
GetAttachmentsOnCardAsync Get Attachments on a card
DeleteAttachmentOnCardAsync Delete an Attachments on a card
AddAttachmentToCardAsync Add an Attachment to a Card

Board Features

Feature Description
AddBoardAsync Add a new Board
CloseBoardAsync Close (Archive) a Board
ReOpenBoardAsync ReOpen a Board
UpdateBoardAsync Update a Board
DeleteBoardAsync Delete an entire board (WARNING: THERE IS NO WAY GOING BACK!!!). Alternative use CloseBoard() for non-permanency
GetBoardAsync Get a Board by its Id
GetBoardsForMemberAsync Get the Boards that the specified member has access to
GetBoardsCurrentTokenCanAccessAsync Get the Boards that the token provided to the TrelloClient can Access
GetBoardsInOrganization Get the Boards in an Organization

Card Features

Feature Description
AddCardAsync Add a Card
ArchiveCardAsync Archive (Close) a Card
ReOpenCardAsync ReOpen (Send back to board) a Card
UpdateCardAsync Update a Card
ArchiveAllCardsInListAsync Archive all cards on in a List
MoveAllCardsInListAsync Move all cards of a list to another list
DeleteCardAsync Delete a Card (WARNING: THERE IS NO WAY GOING BACK!!!). Alternative use CloseCard() for non-permanency
GetCardAsync Get Card by its Id
GetCardsOnBoardAsync Get all open cards on un-archived lists
GetCardsInListAsync Get all open cards on a specific list
GetCardsOnBoardFilteredAsync Get the cards on board based on their status regardless if they are on archived lists
GetCardsForMemberAsync Get all Cards a Member is on (across multiple boards)
SetDueDateOnCardAsync Set Due Date on a card
SetStartDateOnCardAsync Set Due Date on a card
SetStartDateAndDueDateOnCardAsync Set Start and Due Date on a card

Checklist Features

Feature Description
AddChecklistAsync Add a Checklist to the card
AddChecklistAsync Add a Checklist to the card based on an existing checklist (as a copy)
UpdateChecklistItemAsync Update a Check-item on a Card
GetChecklistAsync Get a Checklist with a specific Id
GetChecklistsOnBoardAsync Get a list of Checklists that are used on cards on a specific Board
GetChecklistsOnCardAsync Get a list of Checklists that are used on a specific card
DeleteChecklistAsync Delete a Checklist (WARNING: THERE IS NO WAY GOING BACK!!!)

Comments Features

Feature Description
AddCommentAsync Add a new Comment on a Card
UpdateCommentActionAsync Update a comment Action (aka only way to update comments as they are not seen as their own objects)
DeleteCommentActionAsync Delete a Comment (WARNING: THERE IS NO WAY GOING BACK!!!).
GetAllCommentsOnCardAsync Get All Comments on a Card
GetPagedCommentsOnCardAsync Get Paged Comments on a Card (Note: this method can max return up to 50 comments. For more use the page parameter [note: the API can't give you back how many there are in total so you need to try until non is returned])

Cover Features

Feature Description
UpdateCoverOnCardAsync Update a Cover to a card (this is equivalent to AddCoverToCardAsync, but here for discover-ability. Tip: It is also possible to update the cover via UpdateCardAsync)
AddCoverToCardAsync Add a Cover to a card. Tip: It is also possible to update the cover via UpdateCardAsync
RemoveCoverFromCardAsync Remove a cover from a Card

Custom Field Features

Feature Description
UpdateCustomFieldValueOnCardAsync Update a Custom field on a Card
ClearCustomFieldValueOnCardAsync Clear a Custom field on a Card
GetCustomFieldItemsForCardAsync Get Custom Fields for a Card (Tip: Use Extension methods GetCustomFieldValueAsXYZ for a handy way to get values)
GetCustomFieldsOnBoardAsync Get Custom Fields of a Board

Generic Features

Feature Description
PostAsync Custom Post Method to be used on unexposed features of the API
PutAsync Custom Put Method to be used on unexposed features of the API
GetAsync Custom Get Method to be used on unexposed features of the API
DeleteAsync Custom Delete Method to be used on unexposed features of the API

Label Features

Feature Description
AddLabelsToCardAsync Add a Label to a Card
RemoveLabelsFromCardAsync Remove a Label of a Card
RemoveAllLabelsFromCardAsync Remove all Labels of a Card
GetLabelsOfBoardAsync Get List of Labels defined for a board
AddLabelAsync Add a new label to the Board (Not to be confused with 'AddLabelsToCardAsync' that assign labels to cards)
UpdateLabelAsync Update the definition of a label (Name and Color)
DeleteLabelAsync Delete a Label from the board and remove it from all cards it was added to (WARNING: THERE IS NO WAY GOING BACK!!!). If you are looking to remove a label from a Card then see 'RemoveLabelsFromCardAsync' and 'RemoveAllLabelsFromCardAsync'

List Features

Feature Description
AddListAsync Add a List to a Board
ArchiveListAsync Archive a List
ReOpenListAsync Reopen a List (Send back to the board)
UpdateListAsync Update a List
MoveListToBoardAsync Move an entire list to another board
GetListsOnBoardFilteredAsync Get Lists on board based on their status
GetListAsync Get a specific List (Column) based on its Id
GetListsOnBoardAsync Get Lists (Columns) on a Board

Member Features

Feature Description

Membership Features

Feature Description

Organization Features

Feature Description

Sticker Features

Feature Description

Wehook Features

Feature Description

Clone this wiki locally