I am trying to create a web application that captures sports information from the Yahoo API. I know that in order to speak with the API, it requires the use of OAuth. It is created using Flask and runs on the Google App Engine.
I am trying to use python-oauth2 in people on SimpleGeo and I constantly get the same error when trying to do development work. Here is the code snippet:
import oauth2 as oauth
consumer = oauth.Consumer(key=settings.OAUTH_CONSUMER_KEY, secret=settings.OAUTH_SHARED_SECRET)
request_token_url = "https://api.login.yahoo.com/oauth/v2/get_request_token"
client = oauth.Client(consumer)
resp, content = client.request(request_token_url, "GET")
Here is the error response that I get:
{'status':' 401 ',' transfer-encoding ':' chunked ',' connection ':' close ',' date ':' Tue, 26 Oct 2010 18:24:16 GMT ',' p3p ':' policyref = "http://info.yahoo.com/w3c/p3p.xml", CP = "CAO DSP COR CUR ADM DEV TAI PSA PSD IVAi IVDi CONi TELO OTPi OUR DELI SAMi OTRi UNRi PUBi IND PHY ONL UNI PUR FIN COM COM NAV INT DEM CNT STA POL HEA PRE LOC GOV ", 'content-type': 'application / x-www-form-urlencoded', 'www-authenticate': 'OAuth oauth_problem = consumer_key_rejected'}
Now I have read the documentation available through Yahoo, and I'm at a standstill, because (a) it seems that everything is so simple, and (b) I canโt understand where I am going wrong. I use the consumer key and the shared secret provided to me by Yahoo.
OAuth, .