Goodreads Developers discussion
questions
>
Using review/destroy to delete a review of a book
date
newest »




Request showing that user OAuth credentials are configured correctly. I can edit an existing review for this user:
>> OAUTH_GOODREADS_CLIENT.oauth_request_method(:post, "/review/#{review_id}.xml", {:"review[read_at]" => '2017-06-01'})
I, [2018-06-12T20:47:28.525579 #6140] INFO -- : POST /review/2417021488.xml
I, [2018-06-12T20:47:29.857878 #6140] INFO -- : PARAMS {"review[read_at]"=>["2017-06-01"]}
I, [2018-06-12T20:47:29.857916 #6140] INFO -- : BODY: Net::HTTPOK
<?xml version="1.0" encoding="UTF-8"?>
<review>
<id type="integer">2417021488</id>
<user-id type="integer">82720595</user-id>
<book-id type="integer">234225</book-id>
<read-at type="datetime">2017-06-01T07:00:00+00:00</read-at>
...
</review>
Request to /review/destroy/:book_id?id=:review_id&format=xml fails Unauthorized:
>> OAUTH_GOODREADS_CLIENT.oauth_request_method(:post, "/review/destroy/#{book_id}", {id: review_id, format: 'xml'})
I, [2018-06-12T20:45:17.924128 #6140] INFO -- : POST /review/destroy/234225
I, [2018-06-12T20:45:18.294053 #6140] INFO -- : PARAMS {"format"=>["xml"], "id"=>["2417021488"]}
I, [2018-06-12T20:45:18.294090 #6140] INFO -- : BODY: Net::HTTPUnauthorized
<?xml version="1.0" encoding="UTF-8"?>
<errors>
<error>Unauthorized</error>
</errors>

Params should be send in url, I think, like in GET request.

I've played around with this request a bunch of ways and basically can't get it to work no matter what combination of params I try. If you or anyone else has a working OAuth request, I'll use that to figure out what's wrong. My current thinking is that this endpoint doesn't work.

The review in question is 2417021488 (at https://www.goodreads.com/review/show...)
I have tried every variation I can think of based on the documentation for review.destroy https://www.goodreads.com/api/index#r...
The docs say the URL is /review/destroy/12345?format=xml (with an ID in the URL, as well as an id parameter). My assumption is that this is the review id, but I'm not sure whether I should supply no id param, the same value as an id, or something else. Everything I try results in an error, either Unauthorized or NotFound with an error message about a book id.
Here is a transcript of my requests:
# Here I make an authenticated OAuth query so you can see my client is properly configured
Then I get the current user's review for a book:
Then I try to delete the review, putting the review id in the URL, as a parameter, both, with the book_id:
Any suggestions on how to use the /review/destroy API?