4.12 Topic Content Retrieval Webservice
This webservice enables you to retrieve the content of a filtered
topic. Several parameters are required:
-
idforum : ID of the forum where the topic is located
-
idcat : ID of the category where the topic is located
-
idtopic : ID of the topic to be listed
-
tri : retrieval order, 0 = ascending order, 1 = Descending
order
-
limit : maximum number of messages to be retrieved.
A PHP example
$param = array(
'idforum' => 1,
'idcat' => 22,
'idtopic' => 48,
'tri' => 0,
'limit' => 10
);
$results = $sel->call('read_topic', $param);
The webservice returns several parameters
-
topictitle : Topic title
-
nbanswer : number of replies in the topic
-
messages : FXML feed that contains the messages to be
retrieved. This XML feed is composed of:
<topic>
<reponse id="ID of the reply">
<auteur>Author of the reply</auteur>
<date>Date and time of the message</date>
<message><!--[CDATA[Content of the message]]--></message>
</reponse>
</topic>
Example :
<topic>
<reponse id="108">
<auteur>Zorro</auteur>
<date>02-01-2007 à 14:05:56</date>
<message><!--[CDATA[I am adding a reply just to play around.]]--></message>
</reponse>
<reponse id="109">
<auteur>Zorro</auteur>
<date>03-01-2007 à 11:04:50</date>
<message><!--[CDATA[Answer okey]]--></message>
</reponse>
<reponse id="110">
<auteur>EchoCedric</auteur>
<date>03-01-2007 à 11:05:36</date>
<message><!--[CDATA[This is a test reply]]--></message>
</reponse>
</topic>
Note
The first message of the topic is not returned. The retrieval
process starts with the first reply