Goodreads Developers discussion

35 views
trouble with shelves.create

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

message 1: by Ben (new)

Ben Schuster | 5 comments I'm trying to create a new shelf but I keep getting a 404 error. Has the request uri moved, or am I doing something wrong?

I'm using the oauth-php class from http://code.google.com/p/oauth-php/

and my call looks like:
echo "adding a shelf\n";
$request_uri = 'http://www.goodreads.com/shelf.xml';
$req = new OAuthRequester($request_uri, 'GET', array('name'=>'test_shelf'));
$result = $req->doRequest($user_id);
var_dump($result);

I'm pretty sure my authentication is going through correctly as my calls to auth_user return a valid response.
For comparison that call looks like:
echo "getting user info\n";
$request_uri = 'http://www.goodreads.com/api/auth_use...
$req = new OAuthRequester($request_uri, 'GET');
$result = $req->doRequest($user_id);

Any help would be appreciated,
Thanks
-Ben


message 2: by Ben (new)

Ben Weiner (lostinpatterns) | 24 comments Hi Ben,

Sorry, this needs to be clarified on the API docs. You'll want to send a POST to /shelf.xml, not a GET. (Any time you're writing data when using the API, you'll want to use POST.)


message 3: by Ben (new)

Ben Schuster | 5 comments It works perfectly now that I'm using POST.

Thanks for your help.

-Ben




back to top