YHandler icon indicating copy to clipboard operation
YHandler copied to clipboard

KeyError: 'oauth_token'

Open shawnhind opened this issue 10 years ago • 11 comments

When I try to use your library I get that error. I may be using it incorrectly but I followed your instructions.

I imported YHandler.py I created a YHandler object I called object.call_api(URI) I get that key error

shawnhind avatar Oct 01 '14 22:10 shawnhind

I'll try to look into this. It could be that one of the libraries used has changed it's api. Or could be something else. What kind of app are you trying to use this in? Desktop? Web?

mleveck avatar Oct 01 '14 22:10 mleveck

Well I was trying to use it in a web app for pulling basic sports data through the Yahoo API. Am I using it correctly? Do I have to call any of the other functions before calling object.call_api('URI'). What is the difference between call_api and api_req. Which one should I use? From the looks of it call_api just turns in the query string into a full URI?

shawnhind avatar Oct 01 '14 22:10 shawnhind

It's not set up out of the box for webapps. It's set up for a command line client. You'll notice it using OOB for the intermediate token step. On Oct 1, 2014 3:10 PM, "Shawn Hind" [email protected] wrote:

Well I was trying to use it in a web app for pulling basic sports data through the Yahoo API. Am I using it correctly? Do I have to call any of the other functions before calling object.call_api('URI'). What is the difference between call_api and api_req. Which one should I use? From the looks of it api_req just turns in the query string into a full URI?

— Reply to this email directly or view it on GitHub https://github.com/mleveck/YHandler/issues/2#issuecomment-57548961.

mleveck avatar Oct 01 '14 22:10 mleveck

Now it appears to be a different issue when I try using it with api_req and a query string: Below has my test code and my error message. http://pastebin.com/fviZig5z

shawnhind avatar Oct 01 '14 22:10 shawnhind

Well I mean I'm planning on using it in a web app but I'm currently messing around with it in a desktop program.

shawnhind avatar Oct 01 '14 22:10 shawnhind

Ok. I'll take a look when I can then. Unfortunately with my job, that probably won't be until Saturday. If you find the bug before then, feel free to submit a patch. On Oct 1, 2014 3:20 PM, "Shawn Hind" [email protected] wrote:

Well I mean I'm planning on using it in a web app but I'm currently messing around with it in a desktop program.

— Reply to this email directly or view it on GitHub https://github.com/mleveck/YHandler/issues/2#issuecomment-57550625.

mleveck avatar Oct 01 '14 22:10 mleveck

Am I using it correctly though from what you see?

shawnhind avatar Oct 01 '14 22:10 shawnhind

Assuming you correctly set up the author.csv , that looks right. On Oct 1, 2014 3:24 PM, "Shawn Hind" [email protected] wrote:

Am I using it correctly though from what you see?

— Reply to this email directly or view it on GitHub https://github.com/mleveck/YHandler/issues/2#issuecomment-57551324.

mleveck avatar Oct 01 '14 22:10 mleveck

I just started using this for the same sort of thing as Hinds and also get the error regarding 'pre-request'

sheepeatingtaz avatar Oct 31 '14 17:10 sheepeatingtaz

Looks like it's a problem with requests-oauth and the version of requests: https://github.com/maraujop/requests-oauth/issues/42

I haven't tried, but there is a workaround listed that I will have a go at later

sheepeatingtaz avatar Oct 31 '14 17:10 sheepeatingtaz

A work-around is to use older version of Request. version 0.14.0 works for me.

cllin avatar Nov 09 '14 01:11 cllin