Goodreads Developers discussion

300 views
questions > user.friends OAuth

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

message 1: by Jon (last edited Jan 10, 2014 01:15PM) (new)

Jon | 4 comments Hi, I'm having some trouble using OAuth with user.friends

https://www.goodreads.com/friend/user... (returns 404)
https://www.goodreads.com/friend/user... (returns 401 not authorized despite seemingly being authenticated)

I'm able to use call other methods requiring OAuth however, such as shelves.add_to_shelf and user.compare.

I'm using rauth via python as in the example docs https://www.goodreads.com/api/oauth_e...

And help would be appreciated!


message 2: by Ettore (new)

Ettore Pasquini I suspect there's a bug in how the routing for this api works. Can you try using this format:

https://www.goodreads.com/friend/user...

Another thing to verify is to verify you're not using/storing cookies on your client.

Also some users have private profiles, so make sure to query a user whose profile is public.


message 3: by Ettore (new)

Ettore Pasquini Also, using PostMan could help debugging oauth problems:

https://chrome.google.com/webstore/de...


message 4: by Jon (last edited Jan 16, 2014 08:18PM) (new)

Jon | 4 comments Hi, both https://www.goodreads.com/friend/user... and https://www.goodreads.com/friend/user... now work when using Postman. However, I'm still having trouble calling user.friends with rauth + python.

session = OAuth1Session(...)

Working [200]:
session.get('https://www.goodreads.com/api/auth_user')
session.get('https://www.goodreads.com/user/compar...')

Not working [401]:
session.get('https://www.goodreads.com/friend/user...')
session.get('https://www.goodreads.com/friend/user...')


message 5: by Ettore (new)

Ettore Pasquini If they do work in Postman and not in python, it's likely something related to the python set up, although I'm not sure what should be done there since I'm not a python developer…

One thing I know is problematic is how parameter names with square brackets are handled, although it doesn't look like you have those in your case.

A 401 error means that the oauth signature was not verified: this could be for example that not all parameters are signed, or the timestamp is too old (timezone issues), or the nonce is missing...


message 6: by Jon (last edited Feb 09, 2014 02:03PM) (new)

Jon | 4 comments Hmm, I've been using rauth as in the documentation example but still can't get it to work. Would some other OAuth python library be better? (I've tried Flask-OAuth, but ran into issues there too)

It's weird how some API calls work but others don't. Does user.friends operate a different way? If someone could help me out, I'd really appreciate it!

EDIT: Flask-OAuth worked.


message 7: by Gabe (new)

Gabe Gralla | 1 comments I also had similarly strange issues with rauth - many API calls wouldn't work unless I ran an auth.user lookup first.

I switched to requests-oauthlib (https://github.com/requests/requests-...) and that library worked great (one caveat: when trading a request token for access token, just be sure to use a dummy 'verifier' variable since Goodreads doesn't return one.)


back to top