A C# Based Wrapper of the Trello API
Features
- A TrelloClient implementing the Trello API for CRUD operations on most Trello Features
- An Automation Engine and Webhook Data Reciver for handling Webhook Events from a Trello Board
How to get started
- Install the ‘TrelloDotNet‘ NuGet Package (dotnet add package TrelloDotNet)
- Retrieve your API-Key and Token
- Create new instance of
TrelloDotNet.TrelloClient - Locate you Ids of you Boards, List and Cards (see video here or at the end on this ReadMe)
- Use the TrelloClient based on the examples below and/or the Wiki.
Examples of Usage:
TrelloClient client = new TrelloClient("APIKey", "TOKEN"); //IMPORTANT: Remember to not leave Key and Token in clear text!
//Get a board
Board board = await client.GetBoardAsync("<boardId>");
//Get Lists on a board
List<List> lists = await client.GetCardsOnBoardAsync("<boardId>");
//Get a card
Card card = await client.GetCardAsync("<cardId>");
//Get Cards on Board
List<Card> cardsOnBoard = await trelloClient.GetCardsOnBoardAsync("<boardId>");
//Get Cards in List
List<Card> cardsInList = await trelloClient.GetCardsInListAsync("<listId>");
//Add a card
var input = new Card("<listId>", "My Card", "My Card description");
//todo - add more about the card
var newCard = await client.AddCardAsync(input);
//Add a Checklist to a card
var checklistItems = new List<ChecklistItem>
{
new("ItemA"),
new("ItemB"),
new("ItemC")
};
var newChecklist = new Checklist("Sample Checklist", checklistItems);
var addedChecklist = await client.AddChecklistAsync("<cardId>", newChecklist);
Leave a Reply