Retrieve a detailed description of all player position types for a specified game.
const YahooFantasy = require('yahoo-fantasy');
const yf = new YahooFantasy(
Y!APPLICATION_KEY,
Y!APPLICATION_SECRET,
tokenCallbackFn, // optional
redirectUri // optional
);
yf.setUserToken(
Y!OAuthAccessToken
);
// promise based
try {
const position_types = await yf.game.position_types(game_key);
} catch (e) {
// handle error
}
// callback based
yf.game.position_types(game_key, callbackFn);
{
"game_key": "331",
"game_id": "331",
"name": "Football",
"code": "nfl",
"type": "full",
"url": "http://football.fantasysports.yahoo.com/f1",
"season": "2014",
"position_types": [
{
"type": "O",
"display_name": "Offense"
},
{
"type": "K",
"display_name": "Kickers"
},
{
"type": "DT",
"display_name": "Defense/Special Teams"
},
{
"type": "DP",
"display_name": "Defensive Players"
}
]
}