Take the 2-minute tour ×
Stack Apps is a question and answer site for apps, scripts, and development with the Stack Exchange API. It's 100% free, no registration required.

I'm trying to use Stacky to grab a question from Stackoverflow, however I always an error. The error thrown is:

JsonReaderException was unhandled - Unexpected character encountered while parsing value: <. Line 1, position 1.

My code is:

var stackClient = new StackyClient("0.9", "<my appid>", Sites.StackOverflow, new UrlClient(), new JsonProtocol());
Question q = stackClient.GetQuestion(4619829);

Anyone any idea?

I've tried referencing both the Newtonsoft.Json assembly that came bundled with the binary download of Stacky and the version in the dependencies folder in the most up to date source version too.

share|improve this question
add comment

2 Answers 2

up vote 5 down vote accepted

Shot in the dark, but I bet "0.9" should be "1.0" in your code.

The API version is currently 1.0, 0.9 was a beta version which has long since been deprecated.

share|improve this answer
2  
This was the problem, I was using a tutorial that must have been written long ago! –  AndrewC Jan 6 '11 at 22:13
add comment

You should use:

var stackClient = new StackyClient("1.0", "<my appid>", Sites.StackOverflow, new UrlClient(), new JsonProtocol());
share|improve this answer
add comment

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .