Goodreads Developers discussion

41 views
questions > Add book shelf

Comments Showing 1-12 of 12 (12 new)    post a comment »
dateUp arrow    newest »

message 1: by Gregg (last edited Jan 25, 2012 02:11PM) (new)

Gregg (greggmarshall) | 105 comments I decided to start with Add book shelf.

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?


message 2: by Ettore (new)

Ettore Pasquini 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.


message 3: by Gregg (new)

Gregg (greggmarshall) | 105 comments 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...


message 4: by Gregg (new)

Gregg (greggmarshall) | 105 comments I presume I DO need to URL encode the shelf name, right?


message 5: by Ettore (last edited Jan 24, 2012 02:51PM) (new)

Ettore Pasquini 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.


message 6: by Gregg (new)

Gregg (greggmarshall) | 105 comments I'm still struggling with this, can anyone post what a successful request looks like so I can look at how it is encoded???


message 7: by Gregg (new)

Gregg (greggmarshall) | 105 comments 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.


message 8: by Gregg (new)

Gregg (greggmarshall) | 105 comments 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...


message 9: by Gregg (new)

Gregg (greggmarshall) | 105 comments 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.


message 10: by Michael (new)

Michael Economy (michaeleconomy) Sorry for not responding until now. I'm a little lost, do you still have a question? or did you figure this one out.


message 11: by Gregg (new)

Gregg (greggmarshall) | 105 comments 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.


message 12: by Michael (new)

Michael Economy (michaeleconomy) Yuck, yeah you're right.


We'll try and fix this soon!


back to top