Goodreads Developers discussion
questions
>
Add book shelf
date
newest »
newest »
Sticky and recs are not supported by the API yet.The problem is probably the square brackets. If you search the group you'll find others that may have a solution for making it work with PHP (if I recall that's what you're using) or, client side, with whatever you are using to send the request.
Most of the PHP implementations I know of on the forums are only using the GET API's without OAuth, but I'll look again.If I am interpreting you correctly I need to NOT URL encode the parameters, and pass the actual brackets, correct? I wonder if I can force my library to do that...
Gregg wrote: "If I am interpreting you correctly I need to NOT URL encode the parameters, and pass the actual brackets, correct? I wonder if I can force my library to do that... "No, I didn't mean that. What I meant is that I know square brackets have caused a few issues to some, and how to solve them depends on the actual technology you are using to execute the request. Searching the forum might provide some insights.
I'm still struggling with this, can anyone post what a successful request looks like so I can look at how it is encoded???
I can make Update User status work, which uses square brackets, so I now think there might be a problem with the options.Either there's a bug or the API documentation is wrong.
I can add a book shelf, I just tried putting the options parameters as part of the URL, both with and without encoding the square brackets, like I did for the PUT edit book shelf, but they didn't work that way either. the options just seem to get ignored when adding. Odd...
Edit a book shelf can change the options parameters, but add a book shelf cannot. In the add case, the options don't generate any errors, they just seem to be ignored.
Sorry for not responding until now. I'm a little lost, do you still have a question? or did you figure this one out.
Actually this problem is still unresolved.I can add a shelf, but none of the options (e.g. featured) get changed, they always end up 'false'
I can edit a shelf, and change any of those same options, so I know that API can handle the options ok.
Since the documented syntax for both API's is the same, I have to presume it's a problem with the add API.


I can add a book shelf successfully (in fact easier than I expected).
But I can't get the options to work.
My second try was to delete then add the same book shelf with all the options set to 'true'. Checking on the site shows they are all not checked, indicating to me they didn't set.
Request was
POST /user_shelves.xml HTTP/1.0 Host: www.goodreads.com User-Agent: Drupal (+http://drupal.org/) Content-Length: 142 Authorization: OAuth oauth_version="1.0",oauth_nonce="c4c0cc6ab8b86cf1a7befd39a3a8e46a",oauth_timestamp="1327442799",oauth_consumer_key="KEY",oauth_token="TOKEN",oauth_signature_method="HMAC-SHA1",oauth_signature="wLqw129ohqwLUngkTxSjsnXuDUY%3D" user_shelf%5Bname%5D=OAuth%20Test%20Shelf&user_shelf%5Bfeatured%5D=true&user_shelf%5Bexclusive_flag%5D=true&user_shelf%5Bsortable_flag%5D=true
Also on the book shelf page there are two other options, sticky and recs that aren't listed in the API documentation. Any reason they aren't included?