-
-
Notifications
You must be signed in to change notification settings - Fork 5
TrelloClient
This is the Main Client to communicate with the Trello API (aka everything is done via this)
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 _trelloClient = new TrelloClient("APIKey", "TOKEN");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) |
Actions | Attachments | Boards | Cards | Checklist | Comments | Covers | Custom Fields | Generic | Labels | Lists | Members | Memberships | Organisations | Stickers | Webhooks
Actions in Trello are the 'things' the Members do on a Board... There are common things like 'Create a Card' or 'Add a Label to a Card', and more obscure things like example 'Accept Enterprise Join Request'. In total, there are over 75 different types of Actions (There is a list of them in TrelloDotNet.Model.Webhook.WebhookActionTypes). You can retrieve these events via the API to example get a list of things that happened on a specific card. NB: You can max get the last 1000 Actions that have happened.
| 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 |
Cards can have Attachments of various types (Links and Files) and these methods allow you to add, get and delete the attachments.
| Feature | Description |
|---|---|
| GetAttachmentsOnCardAsync | Get Attachments on a card |
| DeleteAttachmentOnCardAsync | Delete an Attachments on a card |
| AddAttachmentToCardAsync | Add an Attachment to a Card |
Boards are where you have your Lists (and Cards on those lists). The API gives standard CRUD features (good if you programmatically wish to spin up template Boards in large organizations). A Board's 'parent' is an Organization (Workspace)
| 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 |
Cards are the main feature of any Trello Board. There are associated with a List and have various core fields (Name, Description, Dates) and Links to other Trello artifacts (Labels, Members, Checklists, Attachments, Stickers, and Covers). Via the API you can do standard CRUD operations and link/unlink the other artifacts.
| 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 |
| GetCardsOnBoardFilteredAsync | Get the cards on board based on their status regardless if they are on archived lists |
| GetCardsInListAsync | Get all open cards on a specific list |
| 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 |
On a Card, you can have one or more Checklists that are essential 'SubTasks' for the card. If you are a free user they are simple checklists, while on a premium account, you can also assign members and due dates to each Check-item. Via the API you can do standard CRUD operations.
| 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!!!) |
On a Card, the Members of a Board can add Comments (Comments in Trello are essentially special Actions so they will also appear there). Via the API you can do standard CRUD operations.
| 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]) |
Covers are a special visual feature on Cards that can help the card stand out (color at, the top, the full coloring of the card, or have an image at the top of the card). Via the API you can do standard CRUD operations for covers.
| 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 |
NB: Custom Fields are a Premium Trello Feature only :-/
Custom Fields are as the name says, fields that you can make yourself in order to add custom values to Cards. As an example, Trello does not have a default Priority field, but with a custom field, you could make one.
| 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 |
This API does not cover every single little or obscure feature the Trello API has to offer, but it could be that you wish to use something that is not exposed anyway. For that reason, Generic Post, Put, Get, and Delete methods exist in the API where you can provide the endpoint, parameters and the API will take care of all the core stuff of the call
Tip: If you feel it should be in the product then submit it on the Issues page).
| 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 |
Labels (or Tags as they are called in other systems) can be assigned to Cards to categorize them. The API provides both CRUD operations for the management of Labels (they belong to a board) and the add/removal of labels on Cards.
| 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' |
Lists are the 'Columns' you see on your Board and hold your Cards. They are pretty simple structures with just an Id and a Name. Via the API you can do standard CRUD operations.
| 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 |
Members are the users of Trello, and via the API you can manage invites and access to Boards and Organizations, as well as the assignment of them to Cards
| Feature | Description |
|---|---|
| GetMembersOfBoardAsync | Get the Members (users) of a board |
| GetMembersOfCardAsync | Get the Members (users) of a Card |
| GetMemberAsync | Get a Member with a specific Id |
| AddMembersToCardAsync | Add one or more Members to a Card |
| RemoveMembersFromCardAsync | Remove a Member of a Card |
| RemoveAllMembersFromCardAsync | Remove all Members of a Card |
| AddMemberToBoardAsync | Add a Member to a board (aka give them access) |
| InviteMemberToBoardViaEmailAsync | Invite a Member to a board via email (aka give them access) |
| RemoveMemberFromBoardAsync | Remove a Member from a board (aka revoke access) |
| GetTokenMemberAsync | Get information about the Member that owns the token used by this TrelloClient |
| GetMembersOfOrganizationAsync | Get the Members (users) of an Organization |
Memberships are information about a Member access to a thing (Example: if the Member is Admin or Normal User on a Board). Via the API you can get and update the memberships
| Feature | Description |
|---|---|
| GetMembershipsOfBoardAsync | The Membership Information for a board (aka if Users are Admin, Normal, or Observer) |
| UpdateMembershipTypeOfMemberOnBoardAsync | Change the membership type of a member Member on a board (Example make them Admin) |
Organizations are in Trello called Workspaces but in the API the Organization name is kept to better align with official documentation. The API provide basic CRUD operations
| Feature | Description |
|---|---|
| GetOrganizationAsync | Get an Organization (also known as Workspace) |
| AddOrganizationAsync | Create a new Organization (Workspace) |
| UpdateOrganizationAsync | Update an Organization (Workspace) |
| DeleteOrganizationAsync | Delete a entire Organization include all Boards it contains (WARNING: THERE IS NO WAY GOING BACK!!!) |
Stickers are visuals you can 'attach' at the top of Cards to indicate something special (for example a warning sticker about something is wrong with the card) or someone did a good/bad job with a thumbs-up/thumbs-down sticker. The API provide operations to add and remove stickers to cards.
| Feature | Description |
|---|---|
| AddStickerToCardAsync | Add a sticker to a card |
| UpdateStickerAsync | Update a sticker |
| GetStickersOnCardAsync | Get List of Stickers on a card |
| GetStickerAsync | Get a Stickers with a specific Id |
| DeleteStickerAsync | Delete a sticker (WARNING: THERE IS NO WAY GOING BACK!!!) |
Trello has the option to create Webhooks that can, on each Action event you users do on a board, send the information to a Callback URL. The raw API provides CRUD operations for managing these Webhook subscriptions. For the reaction of event see the AutomationEngine system [recommended] and/or the WebhookDataReceiver
| Feature | Description |
|---|---|
| AddWebhookAsync | Add a new Webhook |
| UpdateWebhookAsync | Update a webhook |
| DeleteWebhookAsync | Delete a Webhook (WARNING: THERE IS NO WAY GOING BACK!!!) |
| DeleteWebhooksByCallbackUrlAsync | Delete Webhooks using indicated Callback URL (WARNING: THERE IS NO WAY GOING BACK!!!) |
| DeleteWebhooksByTargetModelIdAsync | Delete Webhooks using indicated target ModelId (WARNING: THERE IS NO WAY GOING BACK!!!) |
| GetWebhooksForCurrentTokenAsync | Get Webhooks linked with the current Token used to authenticate with the API |
| GetWebhookAsync | Get a Webhook from its Id |
| UpdateWebhookByCallbackUrlAsync | Replace callback URL for one or more Webhooks |
If you are looking for info on a specific method in TrelloDotNet then expand the Pages above and input the 'MethodName' (Example: 'AddCardAsync')