Trades v2.0

Summary
Trades
Resource
TradesA list of trades for the owner’s team.
HTTP Methods
GETRetrieve a list of trades for a team
Example
Retrieve Trades
XML field definitions
/tradesA container element for a list of trades.
/trades/tradeA container element for data on a particular trade.
/trades/trade/@idThe ID of the trade.
/trades/trade/offered_by_team_idThe ID of the team that offered the trade.
/trades/trade/timestampThe time that the trade resource was created, in UNIX timestamp format.
/trades/trade/teamsA container element for a list of the teams that were parties to the trade.
/trades/trade/teams/teamA container element for data on a fantasy team that is party to the trade.
/trades/trade/teams/team/@idThe ID of the fantasy team.
/trades/trade/teams/team/logoThe URL of the team’s logo.
/trades/trade/teams/team/long_abbrAn abbreviation of the team’s name, as a string with a maximum length of 10 characters.
/trades/trade/teams/team/abbrAn abbreviation of the team’s name, as a string with a maximum length of 3 characters.
/trades/trade/teams/team/short_nameAn abbreviation of the team’s name, as a string with a maximum length of 6 characters.
/trades/trade/teams/team/nameThe full name for the team.
/trades/trade/offered_to_teamsContainer element for the teams that the trade was orignially offered to.
/trades/trade/offered_to_teams/offered_to_teamThe ID of the team that the trade was offered to.
/trades/trade/playersA container element for a list of the players involved in the trade.
/trades/trade/players/playerA container element for the data on one of the players involved in the trade.
/trades/trade/players/player/@idThe ID of the player.
/trades/trade/players/player/pro_statusSpecifies the roster status of the player on the player’s pro team.
/trades/trade/players/player/positionAn abbreviation for the player’s primary position.
/trades/trade/players/player/firstnameThe first name of the player.
/trades/trade/players/player/lastnameThe last name of the player.
/trades/trade/players/player/fullnameThe full name of the player.
/trades/trade/players/player/profile_urlThe fully qualified URL for the CBSSports.com profile for a player.
/trades/trade/players/player/from_team_idThe ID of the fantasy team that the player was traded from.
/trades/trade/players/player/to_team_idThe ID of the fantasy team that the player was traded to.
/trades/trade/players/player/pro_teamAn abbreviation for the professional team that the player plays for.
/trades/trade/state

Resource

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.

HTTP Methods

GET

Retrieve a list of trades for a team

URL

http://api.cbssports.com/fantasy/league/transaction-list/trades?version=2.0

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

Example

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
}

XML field definitions

/trades

A container element for a list of trades.

/trades/trade

A container element for data on a particular trade.

/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/timestamp

The time that the trade resource was created, in UNIX timestamp format.

/trades/trade/teams

A container element for a list of the teams that were parties to the trade.

/trades/trade/teams/team

A container element for data on a fantasy team that is party to the 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/teams/team/logo

The URL of the team’s logo.  You can use this URL to display the team logo.

/trades/trade/teams/team/long_abbr

An abbreviation of the team’s name, as a string with a maximum length of 10 characters.

/trades/trade/teams/team/abbr

An abbreviation of the team’s name, as a string with a maximum length of 3 characters.

/trades/trade/teams/team/short_name

An abbreviation of the team’s name, as a string with a maximum length of 6 characters.

/trades/trade/teams/team/name

The full name for the team.

/trades/trade/offered_to_teams

Container element for the teams that the trade was orignially offered to.

/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

A container element for a list of the players involved in the trade.

/trades/trade/players/player

A container element for the data on one of the players involved in the 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/pro_status

Specifies the roster status of the player on the player’s pro team.  Possible values are A (Active), M (Minors), U (Unaffiliated), N (Not With Team), DL (Disabled List), and S (Suspended).

/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/firstname

The first name of the player.

/trades/trade/players/player/lastname

The last name of the player.

/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/profile_url

The fully qualified URL for the CBSSports.com profile for a player.  You should use this URL to link to a page outside of your app’s iframe.

/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/players/player/pro_team

An abbreviation for the professional team that the player plays for.

/trades/trade/state

The current state of the trade.  Possible values and their meanings are

offerThe trade had been offered but not accepted.
voteThe 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).
approveThe 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).
The ID of the fantasy team.
The ID of the team that offered the trade.
The ID of the team that the trade was offered to.
The first name of the player.
The last name of the player.