Transaction resource

Description

With the Transaction API, you can obtain information about transactions (adds, drops, trades, and league settings changes) performed on a league. A transaction is identified in the context of a particular league, although you can request a particular Transaction Resource as the base of your URI by using the global transaction_key.

You can also PUT to the API to perform operations like editing waiver priorities or FAAB bids, or modifying the state of pending trades. You can also cancel pending transactions by DELETEing them.

Keep in mind, if you don't have the transaction_key for a waiver claim or pending trade, the only way to discover these transactions is to filter the league Transactions collection by a particular type (waiver or pending_trade) and by a particular team_key. Pending transactions will not show up if you simply ask for all of the transactions in the league, because they can only be seen by certain teams.

HTTP Operations Supported

URIs

http://fantasysports.yahooapis.com/fantasy/v2/transaction/{transaction_key}

Any sub-resource under a transaction is extracted using a URI like:

http://fantasysports.yahooapis.com/fantasy/v2/transaction/{transaction_key}/{sub_resource}

Multiple sub-resources can be extracted from transaction in the same URI using a format like:

http://fantasysports.yahooapis.com/fantasy/v2/transaction/{transaction_key};out={sub_resource_1},{sub_resource_2}

Transaction key format

Completed transactions: {game_key}.l.{league_id}.tr.{transaction_id}

Example: pnfl.l.431.tr.26 or 223.l.431.tr.26

Waiver claims: {game_key}.l.{league_id}.w.c.{claim_id}

Example: 257.l.193.w.c.2_6390

Pending trades: {game_key}.l.{league_id}.pt.{pending_trade_id}

Example: 257.l.193.pt.1

Sub-resources

Default sub-resources: metadata, players

Name Description URI Sample

metadata

Includes transaction key, id, type, timestamp, status, players (not displayed for all transaction types)

/fantasy/v2/transaction/{transaction_key}/metadata

An add/drop transaction:

http://fantasysports.yahooapis.com/fantasy/v2/transaction/223.l.431.tr.26

players Players that are part of the transaction. The Player Resources will include a transaction data element by default.

/fantasy/v2/transaction/{transaction_key}/players

http://fantasysports.yahooapis.com/fantasy/v2/transaction/223.l.431.tr.26/players

Sample XML

http://fantasysports.yahooapis.com/fantasy/v2/transaction/257.l.193.tr.2 - Completed add/drop transaction

http://fantasysports.yahooapis.com/fantasy/v2/transaction/257.l.193.w.c.2_6390 - Waiver claim transaction

http://fantasysports.yahooapis.com/fantasy/v2/transaction/257.l.193.pt.1 - Pending trade transaction

PUT

Using PUT, you may edit the waiver priority or FAAB bid for any of your pending waiver claims. You can also accept or reject trades that have been proposed to you, and allow or vote against trades if your league settings allow it. The URL for PUTting to a Transaction resource is:

http://fantasysports.yahooapis.com/fantasy/v2/transaction/{transaction_key}

You can only PUT to Transactions of the types waiver or pending_trade.

Editing Waivers

Once you have the transaction_key for a waiver claim, which you can get by asking the transactions collection for all waivers for a certain team, you can edit the waiver priority or FAAB bid. The input XML should look like:

Accepting Trades

Once you have the transaction_key for a pending trade that has been proposed to you, which you can get by asking the transactions collection for all pending trades for your team, you can choose to accept it. The input XML should look like:

Rejecting Trades

To reject a pending trade proposed to you, the input XML should look like:

Allowing/Disallowing Trades

If there are accepted trades in your league waiting to be processed, which you can get by asking the transactions collection for all pending trades for your team, and you're the commissioner of a league that has the commissioner approve trades, you can choose to allow or disallow the trade. The input XML should look like:

Or

Voting Against Trades

If there are accepted trades in your league waiting to be processed, which you can get by asking the transactions collection for all pending trades for your team, and you're a manager in a league that allows managers to vote against trades, you can choose to vote against the trade. The input XML should look like:

DELETE

Using DELETE, you may cancel any pending waiver claim or proposed trade. The URL for DELETEing a transaction resource is:

http://fantasysports.yahooapis.com/fantasy/v2/transaction/{transaction_key}

You can only DELETE transactions of the types waiver or pending_trade if the pending trade has not yet been accepted.

Table of Contents