Goodreads Developers discussion
questions
>
Update book reviews
date
newest »
newest »
Gregg, I think we updated the API docs for updating a review: http://www.goodreads.com/api#review.u...
Try that. Also, it should also work with a POST beside a PUT, and actually that's what I do in the iOS app.
Using a PUT with http://www.goodreads.com/review/15190...
returns a 404 error.
Full request was
PUT /review/1519042.xml?review%5Brating%5D=4&review%5Breview%5D=Bot%20keeps%20messing%20with%20my%20reviews HTTP/1.0 Host: www.goodreads.com User-Agent: Drupal (+http://drupal.org/) Content-Length: 0 Authorization: OAuth oauth_version="1.0",oauth_nonce="d4dc68f7ce4f422cbd834ba1d29d1b0e",oauth_timestamp="1328653979",oauth_consumer_key="DELETED",oauth_token="vBIkV8jtucKKYTvAd8rvHQ",oauth_signature_method="HMAC-SHA1",oauth_signature="epCk9HA28Ba0KjJDdqszNajDidc%3D"
Switching to a POST doesn't help.
http://www.goodreads.com/review/15190...
Full request was
POST /review/1519042.xml HTTP/1.0 Host: www.goodreads.com User-Agent: Drupal (+http://drupal.org/) Content-Length: 83 Authorization: OAuth oauth_version="1.0",oauth_nonce="b0c24e6c3598a4141aa43d7ae1ee9bae",oauth_timestamp="1328653816",oauth_consumer_key="DELETED",oauth_token="vBIkV8jtucKKYTvAd8rvHQ",oauth_signature_method="HMAC-SHA1",oauth_signature="6JMLS7GIJ8XnYCeH0%2F48pWk8a%2FU%3D" review%5Brating%5D=4&review%5Breview%5D=Bot%20keeps%20messing%20with%20my%20reviews
I can see the review from that book's page when I'm logged in (it's showing the 3 starts from when I created the review using the APi), I can destroy the review, I can't update the review.
Gregg, is 1519042 a review id? If it is, you're trying to update this review. Is that the correct review?Have you tried sending only a few parameters instead of all? For instance, try with just changing the shelf.
Oh! thats a book id!http://www.goodreads.com/book/show/15...
the non-api uses book_ids to edit reviews, this isn't very restful, so we have different behavior for the api.
Ahhhh, that's the issue. The add and delete review API's use a book ID, but this API uses the review ID. Using the review ID works like a champ.I'd suggest updating the API documentation to make that clear.
Actually which ID to use is a common confusion point in many of the API's documentation. Instead of it would be just as easy to put , or , etc.
Here's another site's API that I'm starting to work with, it has nice documentation (to borrow ideas from):http://mollom.com/api


PUT /review/show/248928291?format=xml&review%5Brating%5D=2&review%5Breview%5D=I%20liked%20it%2C%20but%20the%20bot%20did%20not&review%5Bread_at%5D=2011-25-12
I get an OK response with the XML of the existing review, but nothing changes.
I get the same response without encoding the square brackets.
PUT /review/show/248928291?format=xml&review[rating]=2&review[review]=I%20liked%20it%2C%20but%20the%20bot%20did%20not&review[read_at]=2011-25-12
I noticed the site uses /review/edit instead of /review/show so I tried that and got a 401 error not authorized.
So I can update an owned book and edit a book shelf, but not edit a review.
I'm stuck, any ideas?