ffverse / ffscrapr

R API Client for Fantasy Football League Platforms
https://ffscrapr.ffverse.com
Other
84 stars 21 forks source link

401 for pulling specific year of league #332

Closed davisderodes closed 3 years ago

davisderodes commented 3 years ago

Hi! Big fan of the package. Thank you so much for supporting.

Having this really random issue with the following:

conn <- espn_connect(season = 2018, league_id = 336277) matchup_response <- espn_getendpoint(conn, view = "mMatchupScore")

The raw API query: "https://fantasy.espn.com/apis/v3/games/ffl/seasons/2018/segments/0/leagues/336277?view=mMatchupScore" works in a normal browser.

However, the same code for 2016, 2017, 2019, 2020 does not throw an error.

I tried going as deep as I could, but couldn't figure out why it's not running.

tanho63 commented 3 years ago

Hiya! I'm getting some trouble accessing the linked API query, personally - looks like authentication issues and/or the league being private.

image

If you're commish, you can make the league public, or you can look at the vignette on ESPN authentication https://ffscrapr.ffverse.com/articles/espn_authentication.html

davisderodes commented 3 years ago

Hi Tan,

Thanks so much for responding.

Trying the version with the key (I'll let you know if that works).

I'm the comish (which is always nice :) ), but the league is set to public (at least according to ESPN). This makes sense because I can access other years without using a key.

Screen Shot 2021-09-05 at 9 47 34 PM
davisderodes commented 3 years ago

Interesting...all the other years are public...but for some reason the 2018 one isn't editable. Will continue with API key. Thank you so much!

Screen Shot 2021-09-05 at 9 52 02 PM
davisderodes commented 3 years ago

Worked with API key, must be a thing with ESPN that prior seasons are immutable? Anyways, thanks man. Good luck next season!

tanho63 commented 3 years ago

Awesome to hear! Yeah, very possible, ESPN can be ... odd 😝