League Story v2.0
Summary
| League Story | |
| Resource | |
| League Story | A story created by a fantasy league member. |
| Change Log | |
| January 15, 2013 | |
| HTTP Methods | |
| GET | Retrieve a league story by ID. |
| Exceptions | |
| Following list of exceptions will be returned. | |
| HTTP Methods | |
| POST | Create a new league story |
| Example | |
| Retrieve Story by ID | |
| XML field definitions | |
| /league_story | The container element for a league story. |
| /league_story/@id | The ID of the league story. |
| /league_story/ | A synopsis of the league story. |
| /league_story/ | The text of the league story. |
| /league_story/ | The publication date of the league story in the format Sep. |
| /league_story/ | The name of the author of the story. |
| /league_story/ | The title of the story. |
League Story
Description
A story created by a fantasy league member. To request a particular story, you must supply the ID of the story. You can obtain a story ID by requesting the League Headlines resource. The story ID will be found in the /league_headlines/league_headline/@id field of the League Headlines resource.
GET
Retrieve a league story by ID.
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. |
| id | The ID of the story to be returned. You can get a list of league story IDs by requesting the League Headlines resource. The ID is found in the /league_headlines/league_headline/@id field. |
POST
Create a new league story
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. |
POST Data
To be sent as payload=JSON
payload={ "headline": "Headline of the story", "body": "Body of the story", "photo": "http://www.link_to_image", "caption": "Caption of the image" }where
- body can contain fully formatted html or plain text
- photo and caption are optional
Retrieve Story by ID
Sample URL
http://api.cbssports.com/fantasy/league/news/story?version=2.0&id=1285594162
XML Response
<?xml version="1.0"?>
<result uriAlias="/league/news/story" uri="/league/news/story" statusCode="200" statusMessage="OK">
<body>
<league_story id="1285594162">
<synopsis> Synopsis </synopsis>
<story_body> Story Body </story_body>
<date>Sep. 27, 2010</date>
<author> Author name </author>
<title> Story Title </title>
</league_story>
</body>
</result>JSON Response
{
"body" : {
"league_story" : {
"synopsis" : "Synopsis",
"story_body" : "Story body",
"date" : "Sep. 27, 2010",
"author" : "Author name",
"title" : "Story title",
"id" : "1285594162"
}
},
"uriAlias" : "/league/news/story",
"statusMessage" : "OK",
"uri" : "/league/news/story",
"statusCode" : 200
}The ID of the league news story associated with this headline.
