Just getting started on an app using this new API, and I hit a little snag. While trying to figure out the proper GET url for fetching a user's various teams, I noticed that if I query "http://fantasysports.yahooapis.com/fantasy/v2/users;use_login=1/games/leagues/teams" I receive a somewhat strange response (line breaks added for readability):
CODEBOX
<?xml version="1.0" encoding="UTF-8"?>
<error xmlns="http://www.yahooapis.com/v1/base.rng"
xml:lang="en-us"
yahoo:uri="http://fantasysports.yahooapis.com/fantasy/v2/users;user_login=1/games/leagues/teams"
xmlns:yahoo="http://www.yahooapis.com/v1/base.rng">
<description>Game 218 not supported.</description>
<detail/>
</error>
Disregarding the slightly strange "<detail/>" tag, the relevant point is this "Game 218 not supported." error. According to the documentation for the
games resource, there is no Game 218. I suppose, if I look at the game id sequences, it's also fairly likely that there is a Game 218, but it was some other game from 2009 that is not fantasy football or fantasy baseball. At any rate, it seems to me that if I ask for all of a user's games, it is sort of assumed that I only mean those that are supported by the API.
Now, I did discover the
is_available flag for the games resource, and adding that in does return the expected results for my current fantasy football team, so that's excellent. But I still think that the 218 error shouldn't be happening there, especially since it would appear to block my ability to pull up any history for my team, at least without having to resort to manually coding in game IDs for previous years, which just feels a bit hackish. Is there a more elegant solution to pulling up historical data?