Forum Discussion

vaishnavi's avatar
vaishnavi
Expert
9 years ago

how to get views count for a thread?

Hi,

usecase : return "n" recent solutions from a category/board ordered by the view count
where :  view count = number of views of the original topic + number of views of all replies

 

Currently I am using below REST call to fetch recetn solutions -
rest("${node_type}/id/${node_id}/solutions/recent?restapi.response_style=view&page_size=n").threads/>

 

Issue :-
REST call returns "n" no. of threads but it returns only "n" message in<linear> tag irrespective of actual no. of replies.

Thus unable to calculate correct value for  "views" count.

 

e.g. 

REST call - 

http://comity.stage.lithium.com/restapi/vc/categories/id/vishwajeet_hol/solutions/recent?page_size=1

 

Response -

 

<response status="success">
<threads>
<thread type="thread" href="/threads/id/233">
<title type="string" null="true"/>
<messages>
<topic type="message" href="/messages/id/233">...</topic>
<read>...</read>
<linear>
<message type="message" href="/messages/id/234">...</message>
</linear>
<count type="int">3</count>
</messages>
<board type="board" href="/boards/id/VH_Forum"/>
<solutions>...</solutions>
<id type="int">233</id>
<interaction_style type="string">board</interaction_style>
</thread>
</threads>
</response>

 

If I change page_size to "2" then it returns 2 <messages> inside <linear> tag.

Thus it limits the no. of replies in response to the page_size parameter.

It should only limit no.of threads to be returned.

 

How to fetch all the replies with "n" recent solutions response?

Is there any parameter to REST call to fetch all the replies of a topic/thread?

 

Thanks,

Vaishnavi

No RepliesBe the first to reply