Trades v2.0
| Trades | |
| Resource | |
| Trades | A list of trades for the owner’s team. |
| HTTP Methods | |
| GET | Retrieve a list of trades for a team |
| Example | |
| Retrieve Trades | |
| XML field definitions | |
| /trades | A container element for a list of trades. |
| /trades/ | A container element for data on a particular trade. |
| /trades/ | The ID of the trade. |
| /trades/ | The ID of the team that offered the trade. |
| /trades/ | The time that the trade resource was created, in UNIX timestamp format. |
| /trades/ | A container element for a list of the teams that were parties to the trade. |
| /trades/ | A container element for data on a fantasy team that is party to the trade. |
| /trades/ | The ID of the fantasy team. |
| /trades/ | The URL of the team’s logo. |
| /trades/ | An abbreviation of the team’s name, as a string with a maximum length of 10 characters. |
| /trades/ | An abbreviation of the team’s name, as a string with a maximum length of 3 characters. |
| /trades/ | An abbreviation of the team’s name, as a string with a maximum length of 6 characters. |
| /trades/ | The full name for the team. |
| /trades/ | Container element for the teams that the trade was orignially offered to. |
| /trades/ | The ID of the team that the trade was offered to. |
| /trades/ | A container element for a list of the players involved in the trade. |
| /trades/ | A container element for the data on one of the players involved in the trade. |
| /trades/ | The ID of the player. |
| /trades/ | Specifies the roster status of the player on the player’s pro team. |
| /trades/ | An abbreviation for the player’s primary position. |
| /trades/ | The first name of the player. |
| /trades/ | The last name of the player. |
| /trades/ | The full name of the player. |
| /trades/ | The fully qualified URL for the CBSSports.com profile for a player. |
| /trades/ | The ID of the fantasy team that the player was traded from. |
| /trades/ | The ID of the fantasy team that the player was traded to. |
| /trades/ | An abbreviation for the professional team that the player plays for. |
| /trades/ |
Trades
Description
A list of trades for the owner’s team. The list includes the following.
- All Trades offered by the team
- All Trades offered to the team
- If league uses ‘vote’ policy for trades, all the trades that are in vote state
- If the player is a commissioner, and league uses a commissioner-approve policy for trades, all the trades that are in the approve state and waiting commissioner’s approval.
GET
Retrieve a list of trades for a team
URL
http://api.cbssports.com
Parameters
| response_format | (optional) Specifies the format in which the requested resource should be returned. Valid values are XML and JSON. The default is XML. |
Note
Retrieve Trades
Sample URLs
http://api.cbssports.com/fantasy/league/transaction-list/trades?version=2.0
XML Response
<?xml version="1.0"?>
<result uriAlias="/league/transaction-list/trades" uri="/league/transaction-list/trades" statusCode="200" statusMessage="OK">
<body>
<trades>
<trade id="1320159410.15">
<offered_by_team_id>15</offered_by_team_id>
<timestamp>1320159410</timestamp>
<teams>
<team id="15">
<logo>Team Logo URL</logo>
<long_abbr>Team Long Abbreviation</long_abbr>
<abbr>Team Long Abbreviation</abbr>
<short_name>Team Short Name</short_name>
<name>Team Name</name>
</team>
<team id="23">
<logo>Team Logo URL</logo>
<long_abbr>Team Long Abbreviation</long_abbr>
<abbr>Team Long Abbreviation</abbr>
<short_name>Team Short Name</short_name>
<name>Team Name</name>
</team>
</teams>
<offered_to_teams>
<offered_to_team>23</offered_to_team>
</offered_to_teams>
<players>
<player id="7495">
<firstname>Chris</firstname>
<position>SP</position>
<lastname>Carpenter</lastname>
<from_team_id>23</from_team_id>
<pro_status>A</pro_status>
<profile_url>/players/playerpage/7495</profile_url>
<fullname>Chris Carpenter</fullname>
<to_team_id>15</to_team_id>
<pro_team>STL</pro_team>
</player>
<player id="589256">
<firstname>Troy</firstname>
<position>SS</position>
<lastname>Tulowitzki</lastname>
<from_team_id>15</from_team_id>
<pro_status>A</pro_status>
<profile_url>/players/playerpage/589256</profile_url>
<fullname>Troy Tulowitzki</fullname>
<to_team_id>23</to_team_id>
<pro_team>COL</pro_team>
</player>
</players>
<state>offer</state>
</trade>
</trades>
</body>
</result>JSON Response
{
"body" : {
"trades" : [
{
"offered_by_team_id" : 15,
"timestamp" : "1320159410",
"teams" : [
{
"logo" : "Team Logo URL",
"long_abbr" : "Team Long Abbreviation",
"abbr" : "Team Long Abbreviation",
"short_name" : "Team Short Name",
"name" : "Team Name",
"id" : "15"
},
{
"logo" : "Team Logo URL",
"long_abbr" : "Team Long Abbreviation",
"abbr" : "Team Long Abbreviation",
"short_name" : "Team Short Name",
"name" : "Team Name",
"id" : "23"
}
],
"offered_to_teams" : [
23
],
"players" : [
{
"firstname" : "Chris",
"position" : "SP",
"lastname" : "Carpenter",
"from_team_id" : "23",
"pro_status" : "A",
"profile_url" : "/players/playerpage/7495",
"fullname" : "Chris Carpenter",
"id" : "7495",
"to_team_id" : "15",
"pro_team" : "STL"
},
{
"firstname" : "Troy",
"position" : "SS",
"lastname" : "Tulowitzki",
"from_team_id" : "15",
"pro_status" : "A",
"profile_url" : "/players/playerpage/589256",
"fullname" : "Troy Tulowitzki",
"id" : "589256",
"to_team_id" : "23",
"pro_team" : "COL"
}
],
"id" : "1320159410.15",
"state" : "offer"
}
]
},
"uriAlias" : "/league/transaction-list/trades",
"statusMessage" : "OK",
"uri" : "/league/transaction-list/trades",
"statusCode" : 200
}/trades/trade/@id
The ID of the trade. You can use this ID to get more information on a trade by requesting the Trade resource.
/trades/trade/offered_by_team_id
The ID of the team that offered the trade. To get a list of fantasy team IDs, request the Fantasy Teams resource. This ID also indicates which of the teams that are party to the trade was the team that offered the trade. Thus this ID will always correspond to one of the values of /trades/trade/teams/team/@id for the current trade.
/trades/trade/teams/team/@id
The ID of the fantasy team. To get a list of fantasy team IDs, request the Fantasy Teams resource. To determine if this team is the party who offered the trade or the party it was offered to, you can compare this ID to the value of /trades/trade/offered_by_team_id or to each of the values of /trades/trade/offered_to_teams/offered_to_team.
/trades/trade/offered_to_teams/offered_to_team
The ID of the team that the trade was offered to. To get a list of fantasy team IDs, request the Fantasy Teams resource. This ID will always correspond to one of the values of /trades/trade/teams/team/@id for the current trade.
/trades/trade/players/player/@id
The ID of the player. You can use this ID to get more information about the player by requesting the Player Outlook resource or the Player Updates resource.
/trades/trade/players/player/position
An abbreviation for the player’s primary position. You can get a list of the possition abbreviations and their expansions by requesting the Positions resource.
/trades/trade/players/player/fullname
The full name of the player. The value is equivlent to the values of /trades/trade/players/player/firstname and /trades/trade/players/player/lastname joined with a space.
/trades/trade/players/player/from_team_id
The ID of the fantasy team that the player was traded from. This ID will correspond to the the ID of the fantasy team in /trades/trade/teams/team/@id. To get a list of fantasy team IDs, request the Fantasy Teams resource.
/trades/trade/players/player/to_team_id
The ID of the fantasy team that the player was traded to. This ID will correspond to the the ID of the fantasy team in /trades/trade/teams/team/@id. To get a list of fantasy team IDs, request the Fantasy Teams resource.
/trades/trade/state
The current state of the trade. Possible values and their meanings are
| offer | The trade had been offered but not accepted. |
| vote | The trade has been accepted by the teams involved and is waiting for the other league owners to approve the trade (for leagues that use trade_policy of vote). |
| approve | The trade has been accepted by the teams involved and is waiting for the commissioner to approve the trade (for leagues that use trade_policy of approve). |
