4

@dillenmeister I tried Trello.NET wrapper but it is always returning NULL after successfully accepting AppKey and Token. I'm sure that AppKey and Token are correct because when I deliberately entered wrong AppKey/Token then I got error.

Versions of packages I've installed are:

Trello.NET 0.6.2 Json.NET 7.0.1 RestSharp 105.1.0

Follwing is the assembly references on class level:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using TrelloNet;
using RestSharp;
using Newtonsoft.Json.Serialization;

public partial class TestTrello : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        ITrello trello = new Trello("[AppKey]");

        trello.Authorize("[Token]");

        // Get a board
        Board theTrelloDevBoard = trello.Boards.WithId("[boardId]");
        string boardName = theTrelloDevBoard.Name;
    }

}

So, what is it I'm missing to get it work?

  • @dillenmeister could you guys please help me out with it? – Vivek Gupta Jul 16 '15 at 07:07
  • From where are you getting the board ID? – Jay Jul 16 '15 at 18:29
  • @Jay I got boardId by firing Trello Api directly in browser: https://trello.com/1/members/me/boards?fields=name – Vivek Gupta Jul 17 '15 at 04:39
  • It does appear that there are issues with this library. When I try to use it, I can see that JSON data is being returned (using Fiddler), but that data is not being materialized in the wrapper objects. You might consider pulling down the source and troubleshooting, using another wrapper, or just calling the API with RestSharp or WebClient directly. – Jay Jul 17 '15 at 13:20
  • @Jay I'm finally able to get data using trello.Advanced.Get api. I want to copy cards from one list to another. I'm unable to frame a correct trello.Advanced.Post api call. Could you help me with that? – Vivek Gupta Jul 17 '15 at 15:22
  • 1
    @VivekGupta, have you tried Manatee.Trello as an alternative? – gregsdennis Oct 05 '15 at 22:12
  • I think maybe the issue with the Boards API is that it's simply missing some colors. http://stackoverflow.com/questions/32678405 – jonnybot Dec 15 '15 at 19:48

1 Answers1

3

It looks like there's a color enum that is missing some colors. That causes an exception when you're trying to download board data. There's several pull requests open to rectify the issue, but the creator hasn't merged one yet, probably because all of the PRs cause the test suite to fail.

As a quick workaround, you can clone the repository:

git clone https://github.com/dillenmeister/Trello.NET.git

Update the Cards\Color.cs file

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

..and then build the project in Visual Studio. Add the resulting TrelloNet.dll as a reference in your project, and you should be able to get board data.

Update

Via @ajwaka's comment: Nuget has TrelloNet.Temp.Fork by the same dev and it seems to work.

Community
  • 1
  • 1
jonnybot
  • 2,435
  • 1
  • 32
  • 56
  • 1
    Seems issue is still there - but nuget has TrelloNet.Temp.Fork by the same dev and it seems to work – ajwaka Jan 06 '17 at 18:32