Retrieve basic information about a transaction. Users must be authenticated and a member of the league to query against teams of private leagues. Users may not be able to access transactions for privacy reasons (ie/ waiver claims)
Can also be accessed by using the transaction.meta method.
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 players = await yf.transaction.players(transaction_key);
} catch (e) {
// handle error
}
// callback based
yf.transaction.players(transaction_key, callbackFn);
{
"transaction_key": "328.l.34014.tr.237",
"transaction_id": "237",
"type": "add/drop",
"status": "successful",
"timestamp": "1406292531",
"players": [
{
"player_key": "328.p.9147",
"player_id": "9147",
"name": {
"full": "Stephen Vogt",
"first": "Stephen",
"last": "Vogt",
"ascii_first": "Stephen",
"ascii_last": "Vogt"
},
"editorial_team_abbr": "Oak",
"display_position": "C,1B,OF",
"position_type": "B",
"transaction_data": {
"type": "add",
"source_type": "freeagents",
"destination_type": "team",
"destination_team_key": "328.l.34014.t.1",
"destination_team_name": "ChicksDigTheLongBall"
}
},
{
"player_key": "328.p.7865",
"player_id": "7865",
"name": {
"full": "Miguel Montero",
"first": "Miguel",
"last": "Montero",
"ascii_first": "Miguel",
"ascii_last": "Montero"
},
"editorial_team_abbr": "Ari",
"display_position": "C",
"position_type": "B",
"transaction_data": {
"type": "drop",
"source_type": "team",
"source_team_key": "328.l.34014.t.1",
"source_team_name": "ChicksDigTheLongBall",
"destination_type": "waivers"
}
}
]
}