I am currently using the OAuthBase.cs helper class available on oauth.net to implement OAuth to talk to the Yahoo! fantasy API. I am currently stuck on Step 5 (Using the access token/access secret to call the API Services).
I successfully completed Step 4 but cannot seem to create the actual service call. The documentation is limited; what parameters am I supposed to be using? I'm getting either a 401 or 400 http error. I'm generating my signature by:
url = new Uri("http://query.yahooapis.com/v1/public/yql?q=select * from fantasysports.teams.roster.stats where team_key='nba.l.52669.t.5' and week='5' and stats_type='week' and stats_week='5'&format=json");
signature = oauth.GenerateSignature(url, string.Empty, consumerKey, consumerSecret, accessToken, accessTokenSecret, "GET", time, string.Empty, nonce, OAuth.OAuthBase.SignatureTypes.HMACSHA1, out normalizedUrl, out normalizedRequestParameters);
using (var y = WebRequest.Create(string.Format("{0}?{1}&oauth_signature={2}", normalizedUrl, normalizedRequestParameters, signature)).GetResponse())
{
....
}
where url is the api call i'm trying to make, consumerKey / consumerSecret are the keys given to me when I signed up for Yahoo!, and accessToken / accessTokenSecret are the response returned from request_auth in Step 4. What am I doing wrong?
Thanks in advance
EDIT: 12/14 - for those not familiar with OAuthBase, it is essentially a library that generates the signature by 1. Consolidating all the url/parameters (consumerkey, token, tokenSecret, httpMethod, nonce, time etc), sorting it, and normalizing the url/parameters; 2. Encodes the consumerSecret '&' tokenSecret as the HMACSHA1 key; 3. computing the hash of the hmacsha1 key