Hey guys,
I am new to the API but I believe I have my OAuth all setup and working. I keep getting a "Please provide valid credentials. OAuth oauth_problem=\"token_rejected\"
when I try and query the API after authenticating. Can I test with /league/223.l.431/teams?
.NET Setup
Thanks, Arra
To clarify guys,
Here is the error I am getting when I make the API call.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><yahoo:error xmlns:yahoo="http://www.yahooapis.com/v1/base.rng" yahoo:uri="http://yahoo.com" xml:lang="en-US"><yahoo:description>Please provide valid credentials. OAuth oauth_problem="OST_OAUTH_TOKEN_REJECTED_ERROR", realm="yahooapis.com"</yahoo:description><yahoo:detail>Please provide valid credentials. OAuth oauth_problem="OST_OAUTH_TOKEN_REJECTED_ERROR", realm="yahooapis.com"</yahoo:detail></yahoo:error>
I am using Hammocks to make the call. I believe I did everything right prior. I even get an email from Yahoo! stating that I have confirmed my app to have access to my fantasy data. I created a test league under my login and when I test the query beloe in the YQL console it runs fine. Something must be wrong with my token or the process before this? I am not URLEncoding the token before setting it in Hammock as you can see. Any help would be great.
RestClient client = new RestClient()
{
Authority = "https://query.yahooapis.com/v1",
Credentials = new OAuthCredentials()
{
ConsumerKey = key,
ConsumerSecret = secret,
Token = oauth_token,
TokenSecret = oauth_token_secret,
SignatureMethod = OAuthSignatureMethod.HmacSha1,
ParameterHandling = OAuthParameterHandling.HttpAuthorizationHeader,
Type = OAuthType.ProtectedResource,
Version = "1.0"
}
};
var teamRequest = new RestRequest
{
Path = "/yql?q=select%20*%20from%20fantasysports.leagues%20where%20league_key%3D'253.l.224990'"
};
RestResponse rr = client.Request(teamRequest);