How can I get all boards from Trello using Trello.NET?

我的梦境 提交于 2019-12-12 11:26:14

问题


Here is my code:

ITrello trello = new Trello("MyAppToken");
trello.Authorize("MyUserToken");
Member me = trello.Members.Me();
var cards = trello.Cards.ForMe();
var allboards = trello.Boards.ForMe();

So I got all my cards without any problems. But how can I get all my boards? It's always null and I don't understand what is the problem. My user and application tokens are valid.

My me object is not null and I have information about my account.

What did I miss? Thank you!

UPD: I can't even get board by board ID. I got the boardId from the card.


回答1:


Finally I get it!

When I got json object from trello API and tried to serialize it there was an exception. Enum that contains colors in Trello.JSON had not enough colors for API. So I added missing colors.

public enum Color
{
    Green,
    Yellow,
    Orange,
    Red,
    Purple,
    Blue, 
    Turquoise, 
    Lightgreen,
    Pink,
    Sky,
    Lime,
    Black
}



回答2:


FYI, at the time of my post the Trello.NET library no longer works. It doesn't provide access to boards, cards, or lists. The project hasn't been updated since 2014. It's essentially been abandoned.

I would recommend either making API calls directly or finding an alternative library.



来源:https://stackoverflow.com/questions/32678405/how-can-i-get-all-boards-from-trello-using-trello-net

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!