Goodreads Developers discussion
examples / showcase
>
Anyone grok the square brackets problem?
date
newest »


But in this case I'm able to create shelves without any problems.
I am using URL encoded keys, even though in my testing I found it didn't matter for this API, other method's wanted it and the API seems to accept both.
My call looks about like yours, assuming your OAuth authorization is correct (check and make sure you are using your access token).
user_shelf%5Bname%5D=Sample%20Bookshelf%202
It does appear that the options (exclusive, featured and sortable) don't work on this API call, but seem to work fine when doing the PUT edit method. Not sure what is going on there and haven't heard back from support on that.

I think there might be opensource .net goodreads code out there you could look at (I think a year ago a guy was developing something).

Like Gregg mentioned every other request seems to work, the only ones that don't work for me are those with square brackets so I feel I'm close.
I remember hearing about an open source .NET API but a wee bit of searching hasn't turned it up. I'll dig again.

If you are going to patch it yourself, have a look at the code that solved it for us on Android. It's Java but... maybe still useful for .NET?
http://www.goodreads.com/topic/show/7...


http://www.goodreads.com/topic/show/3...
Not sure it's helpful to you or if you already saw it, but I thought to mention it anyway.

For any other .NET developer that may stumble on this that are using the REST library Hammock (https://github.com/danielcrenna/hammock) it appears the square bracket param issue is known: (https://github.com/danielcrenna/hammo...). The dev had to change how he encoded params to work around how Twitter was interpreting the OAuth spec so that could be the source of pain.
I didn't apply the patch to verify but I did change to another lib, RestSharp (https://github.com/restsharp/RestSharp), and that works perfectly. I still want to fix up Hammock as there are some aspects of that library I like better but at least now I have a working vs. non-working sample to play with.
Thanks everyone for the pointers and help, greatly appreciated! I also plan to make my GoodReads lib open source and I'll throw it up on github once it's a little more tidy so at least people have a working example.
I'm using the .NET library Hammock to generate my requests and everything looks fine from a call perspective but then again I don't know what the square bracket issue is and what the GoodReads server expects.
The full request is (with consumer key obviously changed):
POST http://www.goodreads.com/user_shelves... HTTP/1.1
Accept: */*
Referer: file:///Applications/Install/3D67A276...
Content-Length: 24
Accept-Encoding: identity
Authorization: OAuth oauth_consumer_key="XXXXXXXXXXXXXXXXXXXXX",oauth_nonce="hef5vcmu5mw6qg2n",oauth_signature="apfIcMc4%2B4Hc2%2F60HVezOSYtdYI%3D",oauth_signature_method="HMAC-SHA1",oauth_timestamp="1327977976",oauth_token="hTZqHVG5nliRXG5SZtc6jA",oauth_version="1.0"
Content-Type: application/x-www-form-urlencoded
User-Agent: NativeHost
Host: www.goodreads.com
Proxy-Connection: Keep-Alive
Cache-Control: no-cache
Pragma: no-cache
user_shelf%5Bname%5D=buy