Closed CallSign-Filter closed 1 year ago
Most likely an error in setting up your config.json
file.
To validate that this is the problem, after line 259 in /src/yahooFantasyBaseball.js
add console.log(JSON.stringify(results.response.data));
and run it again, which will likely spit out an error such as:
Error with credentials in makeAPIrequest()/refreshAuthorizationToken(): Error: Request failed with status code 401
{"error":{"lang":"en-US","description":"Please provide valid credentials. OAuth oauth_problem=\"token_rejected\", realm=\"yahooapis.com\""}}
This means your credentials are not set up correctly. I re-ran through my instructions and validated they still work.
I'd make a video showing how exactly it's done except the process involves API passwords.
For baseball the league prefix is 412
for this year, I don't know if it's the same for football.
But the keys are:
credentials.json
file (it will create a new one)CONSUMER_KEY
, CONSUMER_SECRET
- from https://developer.yahoo.com/apps/create/YAHOO_AUTH_CODE
- from https://api.login.yahoo.com/oauth2/request_auth?client_id=YOUR-CLIENT-ID-GOES-HERE&redirect_uri=oob&response_type=code&language=en-us
LEAGUE_KEY
- league prefix (412?) + lowercase l + your league number, gotten from web UITEAM
your team number, 1-8, gotten from web UILast two you can leave as is.
Hope this helps! Good luck.
Okay I must have messed something up because it wasn't generating the credentials.json
file over again. So in the fresh one I just downloaded form you (after running the npm install
on both versions with the new version of the dependencies) I had it generate a new credentials file that I put into the other one and it worked beautifully.
If you or anyone else if curious, I am using this to parse out the weekly positional scores because in my league we have weekly payouts for different positions each week. Also we pay out for most WR points all year and most RB points all year so I have this app generate the points that I copy into a Google Sheet.
And this NFL season is league prefix 414.
Thank you for your help and the beautiful public service that is this app
I used this all last NFL season to parse out the weekly positional scores for my Fantasy Football League's weekly payouts. This year I am getting nothing but 401 errors. I tried my fork from last year, I tried cloning over again and nothing.
I followed all of the steps and have the app registered. Any Ideas?