Draft Order v3.0

Summary
Draft Order
Resource
Draft OrderThe draft order for a league.
Change Log
V3.1 - December 2015
HTTP Methods
GETRetrieve Draft Order
PUTUpdate the draft order resource.
Example
Retrieve Draft Order
XML field definitions
/draft_orderA container element for the draft order.
/draft_order/picksA container element for the list of picks in the draft order.
/draft_order/picks/pickA container element for information on a pick.
/draft_order/picks/pick/numberThe number of the pick in the draft order, as an integer.
/draft_order/picks/pick/roundThe round the pick is in, as an integer.
/draft_order/picks/pick/teamA container element for the data on the team that owns this pick in the draft order.
/draft_order/picks/pick/team/@idThe ID of the fantasy team.
/draft_order/picks/pick/team/logoThe URL of the team’s logo.
/draft_order/picks/pick/team/long_abbrAn abbreviation of the team’s name, as a string with a maximum length of 10 characters.
/draft_order/picks/pick/team/abbrAn abbreviation of the team’s name, as a string with a maximum length of 3 characters.
/draft_order/picks/pick/team/short_nameAn abbreviation of the team’s name, as a string with a maximum length of 6 characters.
/draft_order/picks/pick/team/nameThe full name for the team.
/draft_order/sourceThe name of the draft order source.
/draft_order/typeThe name of the draft order source.

Resource

Draft Order

Description

The draft order for a league.  The resource consists of a list of picks and contains the pick number and the team that has that pick in the draft order in each round.  The list of pics is delivered in draft order for the first round.  The order of picks in the following rounds is determined by the league’s draft rules.  Team information includes the team ID, team name, various abbreviations for the team name, and the URL of the team logo.

Note that the draft process itself is handled by the main CBS Interactive application.

Change Log

V3.1 - December 2015

  • Add “source” and “type” to GET
  • Add PUT method

HTTP Methods

GET

Retrieve Draft Order

URL

http://api.cbssports.com/fantasy/league/draft/order?version=3.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.

PUT

Update the draft order resource.  Note: only available in version 3.1.

This method allows the use to update a draft order.  It supports the both snake and nonsnaking types, and either random, manual or custom draft order sources.  The data required is different depending on the source.  Keeper leagues are also supported, with a payload keyword “keepers” (see below).

If source = random, a new random order can optionally be generated.  This will cause a message to be sent to the league with the new draft order.

For randomspecify “type”, “source” and optionally “generate_new_order”.
For manualspecify “type”, “source” and an array of team ids representing the picks for one round of the draft, using the keyword “picks”.  This order is used for each round, allowing for “snake” draft types if necessary.
For custom picksyou must pass picks for all teams and all rounds using the keyword “picks”.
For keepersyou must specift picks for all teams and all rounds, and optionally the players to be kept at each pick.  This is passed in using the keyword “keepers”.

URL

http://api.cbssports.com/fantasy/league/draft/order?version=3.1

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.

Payload

type : must be “snake” or “nonsnaking”.

source : must be “random”, “manual” or “custom”.

generate_new_order : 0 or 1.  For source=”random” only this will generate a new random order.

picks : For manual, an array of picks for a single round.  For custom (non-keeper) an array of arrays, representing all rounds of the draft, one array per round.  The elements of each array is a team id (representing the team that has that pick).

keepers : For custom, keeper leagues only.  An array of arrays.  The inner array is an array of objects with a team and optionally a player key (see example below).  The team is the team id that has the pick.  The optional player is a player to be kept at that pick.

Example payload for a random snake draft, generating a new random draft order
payload={
        "type" : "snake",
        "source" : "random",
        "generate_new_order" : 1
       }
Example payload for a snake draft with manual order of picks.
payload={
         "type" : "snake",
         "source" : "manual",
         "picks" : [ "28", "27", "11", "21", "20", "1", "18", "25", "26", "15", "8", "24", "19", "29" ]
        }
Example payload for a custom draft order (non-keeper).
payload={
        "type" : "snake",
        "source" : "custom",
        "picks" : [[ "28", "27", "11", "21", "20", "1", "18", "25", "26", "15", "8", "24", "19", "29" ],
                   [ "27", "28", "21", "11", "20", "1", "18", "25", "26", "15", "8", "24", "19", "29" ],
                   [ "28", "27", "11", "21", "20", "18", "1", "25", "26", "15", "8", "24", "19", "29" ],
                                        ...
                                        ...
                  ]}
Example payload for custom snake draft order with two keepers assigned to the first 2 teams.
payload={
        "type" : "snake",
        "source" : "custom",
        "keepers" : [
        [{ "team" : "28", "player" : "367942"},
         { "team" : "27", "player" : "392294"},
         { "team" : "11"},
         { "team" : "21" },
         { "team" : "20" },
         { "team" : "1"  },
         { "team" : "18" },
         { "team" : "25" },
         { "team" : "26" },
         { "team" : "15" },
         { "team" : "8"  },
         { "team" : "24" },
         { "team" : "19" },
         { "team" : "29" }
        ],
        [{ "team" : "28", "player" : "1660162"},
         { "team" : "27", "player" : "545787"},
         { "team" : "11"},
         { "team" : "21" },
         { "team" : "20" },
         { "team" : "1"  },
         { "team" : "18" },
         { "team" : "25" },
         { "team" : "26" },
         { "team" : "15" },
         { "team" : "8"  },
         { "team" : "24" },
         { "team" : "19" },
         { "team" : "29" }
        ],
             ...
             ...
        ]}

Example

Retrieve Draft Order

Sample URL

http://api.cbssports.com/fantasy/league/draft/order?version=3.0

XML Response

<?xml version="1.0"?>
<result uriAlias="/league/draft/order" uri="/league/draft/order" statusCode="200" statusMessage="OK">
  <body>
    <draft_order>
      <picks>
        <pick>
          <number>1</number>
          <round>1</round>
          <team id="22">
            <logo>Team Logo URL</logo>
            <long_abbr>Team Long Abbreviation</long_abbr>
            <abbr>Team Abbreviation</abbr>
            <short_name>Team Short Name</short_name>
            <name>Team Name</name>
          </team>
        </pick>
        <pick>
          <number>2</number>
          <round>1</round>
          <team id="11">
            <logo>Team Logo URL</logo>
            <long_abbr>Team Long Abbreviation</long_abbr>
            <abbr>Team Abbreviation</abbr>
            <short_name>Team Short Name</short_name>
            <name>Team Name</name>
          </team>
        </pick>
      </picks>
    </draft_order>
  </body>
</result>

JSON Response

{
   "body" : {
      "draft_order" : {
         "picks" : [
            {
               "number" : 1,
               "round" : 1,
               "team" : {
                  "logo" : "Team Logo URL",
                  "long_abbr" : "Team Long Abbreviation",
                  "abbr" : "Team Abbreviation",
                  "short_name" : "Team Short Name",
                  "name" : "Team Name",
                  "id" : "15"
               }
            },
            {
               "number" : 2,
               "round" : 1,
               "team" : {
                  "logo" : "/ownerlogo?size=36x36&amp;teamid=1",
                  "long_abbr" : "Pudge",
                  "abbr" : "LP",
                  "short_name" : "Little",
                  "name" : "Little Pudge",
                  "id" : "1"
               }
            },
         ]
      }
   },
   "uriAlias" : "/league/draft/order",
   "statusMessage" : "OK",
   "uri" : "/league/draft/order",
   "statusCode" : 200
}

XML field definitions

/draft_order

A container element for the draft order.

/draft_order/picks

A container element for the list of picks in the draft order.

/draft_order/picks/pick

A container element for information on a pick.

/draft_order/picks/pick/number

The number of the pick in the draft order, as an integer.

/draft_order/picks/pick/round

The round the pick is in, as an integer.

/draft_order/picks/pick/team

A container element for the data on the team that owns this pick in the draft order.

/draft_order/picks/pick/team/@id

The ID of the fantasy team.  You can get a list of team IDs and their expansions by requesting the Fantasy Teams resource.

/draft_order/picks/pick/team/logo

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

/draft_order/picks/pick/team/long_abbr

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

/draft_order/picks/pick/team/abbr

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

/draft_order/picks/pick/team/short_name

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

/draft_order/picks/pick/team/name

The full name for the team.

/draft_order/source

The name of the draft order source.  Must be “random” or “manual” or “custom”.  V3.1 only

/draft_order/type

The name of the draft order source.  Must be “snake” or “nonsnaking”.  V3.1 only

CBSSports.com Development Center

© 2016 CBS Interactive. All rights reserved.
CBS Sports is a registered trademark of CBS Broadcasting Inc.
CBSSports.com Fantasy Platform is protected by one or more of the following United States Patents: 8732278, additional patents pending.