Message List
| Message List | |
| Resource | |
| Message List | List of messages in a fantasy league’s message board. |
| HTTP Methods | |
| GET | Get a list of messages from the league’s message board. |
| Example | |
| Get messages for a league | Retrieve 50 latest messages for the league |
| XML field definitions | |
| /message_list | A container element for the list of messages. |
| /message_list/ | A container element for a message in the list. |
| /message_list/ | The ID of the message. |
| /message_list/ | The number of times the message has been viewed. |
| /message_list/ | The timestamp of the message in UNIX timestamp format. |
| /message_list/ | The subject of the message. |
| /message_list/ | Indicates whether the message is an ordinary message or a poll. |
| /message_list/ | The name of the author of the message. |
Message List
Description
List of messages in a fantasy league’s message board. A message can be either a regular message or a poll. You can tell if a message is a poll by examining the /message_list/message/type field.
The message information includes the message ID, subject, type (Message or Poll), author, timestamp, and the number of time the message has been viewed. You can use the message ID to get the body of the message by requestiong the Message resource.
GET
Get a list of messages from the league’s message board.
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 messages returned to this number. The default is 50. |
| offset | (optional) Return messages from this place in the current list of messages. The default is 0. You can use this parameter together with the limit parameter to page though a list of messages. Note that there is no guarantee that the request will always return the next ten after those returned in the original request. If messages are added to the resource between requests, the later request will return messages starting from the offset number in the current list at the time the request is made. |
Get messages for a league
Sample URL
Retrieve 50 latest messages for the league
http://api.cbssports.com/fantasy/league/message-board/message-list?offset=1&limit=50
Retrieve messages 51-100 for the league
http://api.cbssports.com/fantasy/league/message-board/message-list?offset=51&limit=50
XML Response
<?xml version="1.0"?>
<result uriAlias="/league/message-board/message-list" uri="/league/message-board/message-list" statusCode="200" statusMessage="OK">
<body>
<message_list>
<message id="1317410488-78504BEA-EAE8-11E0-85B1-C722C816362C">
<views/>
<timestamp>1317410488</timestamp>
<subject>Dolphins Wins</subject>
<type>Poll</type>
<author>Author Name</author>
</message>
<message id="1317410477-78504BEA-EAE8-11E0-85B1-C722C816362C">
<views/>
<timestamp>1317410477</timestamp>
<subject>Dolphins Wins [eom]</subject>
<type>Poll</type>
<author>Author Name</author>
</message>
<message id="1317410392-78504BEA-EAE8-11E0-85B1-C722C816362C">
<views/>
<timestamp>1317410392</timestamp>
<subject>Dolphins Wins [eom]</subject>
<type>Poll</type>
<author>Author Name</author>
</message>
<message id="1317396269-78504BEA-EAE8-11E0-85B1-C722C816362C">
<views/>
<timestamp>1317396269</timestamp>
<subject>Re: No Subject</subject>
<type>Message</type>
<author>Author Name</author>
</message>
<message id="1317393925-78504BEA-EAE8-11E0-85B1-C722C816362C">
<views/>
<timestamp>1317393925</timestamp>
<subject>Re: No Subject</subject>
<type>Message</type>
<author>Author Name</author>
</message>
</message_list>
</body>
</result>JSON Response
{
"body" : {
"message_list" : [
{
"views" : 1,
"timestamp" : "1317303520",
"subject" : "Re: Gorillas Win!",
"type" : "Message",
"author" : "Author Name",
"id" : "1317303520-6C6C6BCE-F8DA-11E0-9D13-007589CED746"
},
{
"views" : 1,
"timestamp" : "1317302815",
"subject" : "Gorillas Win!",
"type" : "Message",
"author" : "Author Name",
"id" : "1317302815-6C6B9AA0-F8DA-11E0-9D13-007589CED746"
},
{
"views" : 2,
"timestamp" : "1316437794",
"subject" : "Playoffs Week 2",
"type" : "Message",
"author" : "Author Name",
"id" : "1316437794-6C6B9AA0-F8DA-11E0-9D13-007589CED746"
},
{
"views" : 3,
"timestamp" : "1315835798",
"subject" : "Playoffs Week 1",
"type" : "Message",
"author" : "Author Name",
"id" : "1315835798-6C6B9AA0-F8DA-11E0-9D13-007589CED746"
},
{
"views" : 3,
"timestamp" : "1315234639",
"subject" : "2011 Playoffs",
"type" : "Message",
"author" : "Author Name",
"id" : "1315234639-6C6B9AA0-F8DA-11E0-9D13-007589CED746"
}
]
},
"uriAlias" : "/league/message-board/message-list",
"statusMessage" : "OK",
"uri" : "/league/message-board/message-list",
"statusCode" : 200
}/message_list/message/@id
The ID of the message. You can use this ID to retrieve the body of the message by requesting the Message resource.
