Goodreads Developers discussion
questions
>
PHP Not authorized response on signed requests with token
date
newest »


Use cases (after successfully getting the user's authorized token):
use ExampleBundle\OAuth1\Client\Server\Goodreads;
// configure the Goodreads OAuth client
$server = new Goodreads(array(
'identifier' => '***goodreads_key***',
'secret' => '***goodreads_secret***'
));
$server->setToken('***stored_user_token***');
// look up this member's user ID on Goodreads
// FAILS, return value is "Invalid OAuth Request"
$userId = $server->apiAuthUser();
// look up the book on Goodreads
// SUCCEEDS, return value is "26771521"
$bookId = $server->bookIsbnToId('9781516865871');
// look up any existing review by this member for this book on Goodreads
// SUCCEEDS (when $userId is set manually to a known value), return value is a XML document
$reviewData = $server->reviewShowByUserAndBook($bookId, $userId);
// attempt to create a Goodreads review
// FAILS, return value is "not authorized"
$result = $server->review($bookId, $reviewText, $starRating);
Hi, sorry for the late response to this thread. The post review operation requires additional permissions to be granted, which is likely the cause for the response you are getting.
Your request does not seem malformed, which is in line with being able to make other API request successfully.
Looking into your API profile at the moment
Your request does not seem malformed, which is in line with being able to make other API request successfully.
Looking into your API profile at the moment

Can anyone spot any error in our building of the Authorization header in the requests below? Or other possible cause for the not authorized responses? (Extends https://github.com/thephpleague/oauth..., which provides functionality for the HMAC-SHA1 signature generating.)