League Headlines v2.0
| League Headlines | |
| Resource | |
| League Headlines | A list of league headlines created by fantasy league members. |
| HTTP Methods | |
| GET | Retrieve a list of league headlines. |
| Example | |
| Retrieve Headlines | Retrieve 3 latest headlines |
| XML field definitions | |
| /league_headlines | A container element for a list of league headlines. |
| /league_headlines/ | A container element for a league headline. |
| /league_headlines/ | The ID of the league news story associated with this headline. |
| /league_headlines/ | A synopsis of the news story associated with this headline. |
| /league_headlines/ | The timestamp of the headline expressed in UNIX timestamp format. |
| /league_headlines/ | The name of the author of the story. |
| /league_headlines/ | The text of the headline. |
League Headlines
Description
A list of league headlines created by fantasy league members. Headlines are sorted based on publication time with with the most recent first. You can limit the number of headlines returned by each request (the default is 20), and you can request a set of headlines starting anywhere in the list.
The headline information includes the ID of the story the headline corresponds to, a synopsis of the story, the headline text, author, and timestamp. You can use the story ID (/fantasy_headlines/fantasy_headline/@id) to get the full story by requesting the Fantasy Story resource.
GET
Retrieve a list of league headlines.
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. |
| limit | (optional) Limit the number of league headlines returned to this value. |
| offset | (optional) Return league headlines from this place in the current list of league headlines. The default is 0. You can use this parameter together with the limit parameter to page though a list of headlines. Note that there is no guarantee that the request will always return the next ten after those returned in the original request. If headlines are added to the resource between requests, the later request will return headlines starting from the offset number in the current list at the time the request is made. |
Retrieve Headlines
Sample URL
Retrieve 3 latest headlines
http://api.cbssports.com/fantasy/league/news/headlines?version=2.0&limit=3
XML Response
<?xml version="1.0"?>
<result uriAlias="/league/news/headlines" uri="/league/news/headlines" statusCode="200" statusMessage="OK">
<body>
<league_headlines>
<league_headline id="1285594162">
<synopsis> Synopsis </synopsis>
<timestamp>1285594162</timestamp>
<author> Author name </author>
<title> Story Title </title>
</league_headline>
<league_headline id="1274114662">
<synopsis> Synopsis </synopsis>
<timestamp>1274114662</timestamp>
<author> Author name </author>
<title> Story Title </title>
</league_headline>
<league_headline id="1254142417">
<synopsis> Synopsis </synopsis>
<timestamp>1254142417</timestamp>
<author> Author name </author>
<title> Story Title </title>
</league_headline>
</league_headlines>
</body>
</result>JSON Response
{
"body" : {
"league_headlines" : [
{
"synopsis" : "Synopsis",
"timestamp" : "1285594162",
"author" : "Author name",
"title" : "Story Title",
"id" : "1285594162"
},
{
"synopsis" : "Synopsis",
"timestamp" : "1274114662",
"author" : "Author name",
"title" : "Story Title",
"id" : "1274114662"
},
{
"synopsis" : "Synopsis",
"timestamp" : "1254142417",
"author" : "Author name",
"title" : "Story Title",
"id" : "1254142417"
}
]
},
"uriAlias" : "/league/news/headlines",
"statusMessage" : "OK",
"uri" : "/league/news/headlines",
"statusCode" : 200
}/league_headlines/league_headline/@id
The ID of the league news story associated with this headline. You can use this ID to get the story by requesting the League Story.
