spilchen / yahoo_fantasy_api

python bindings for the Yahoo! Fantasy API (https://yahoo-fantasy-api.readthedocs.io/)
MIT License
87 stars 33 forks source link

Commissioner Tools Functionality Request #19

Closed dlw5007 closed 3 years ago

dlw5007 commented 3 years ago

I've had really good success using yahoo_fantasy_api for some fantasy football player research. However I'm interested in utilizing it to help automate some mid-season customized rules by dropping/adding players from teams' rosters as the commissioner. I don't think I'm able to do this with the current functions available in YFA, and I am not well versed in API calls so I was hoping one of the dev's of this project could point me in the right direction or provide some sample code to execute commissioner drops and adds from the URI's "https://basketball.fantasysports.yahoo.com/nba/XXXXXX/Y/commishdropplayer" and "https://basketball.fantasysports.yahoo.com/nba/XXXXXX/Y/commishaddplayer"

Thanks!

spilchen commented 3 years ago

I'm not aware of any APIs that Yahoo! exposes to perform things as the commissioner. So I wonder if you can use the regular add/drop as long as you authenticate as the commissioner. I would have to try this out to confirm.

dlw5007 commented 3 years ago

Thanks for the reply. I attempted what you suggested and received an error indicating I am not the manager of the selected team, even when signed in with commissioner's credentials (see below). I suspected this would not work since commissioners only have the ability to edit rosters through the "commissioner tools" interface.

Error message:

RuntimeError: b'<?xml version="1.0" encoding="UTF-8"?>\n\n <descripti on>You are not the manager of this team.\n \n'

spilchen commented 3 years ago

That's too bad. Yahoo must have a different set of APIs for doing these commish level actions. Unfortunately, they don't expose them in their documentation, so I don't know what those are.

dlw5007 commented 3 years ago

I will try to reach out to the Yahoo dev team to see if anything exists. I saw some examples for accepting/rejecting trades as a commish, but nothing else.

Thanks