Forum Discussion
5 Replies
- Payal8 years agoDirectorHi amuthan,
You can use V2 Query to fetch recent posts with replies count and accepted solution.
V2 Query:
Select replies.count(*),id,subject,post_time,conversation.solved from messages where depth = 0 ORDER BY post_time DESC
Hope this helps. - amuthan8 years agoAdeptHi,
I am using V1 rest API.Can you we get the same using V1? - cike8 years agoChampion
Hi amuthan,
if you want to use APIv1, you have to use multiple request to get all information. Take a look at the message resource of APIv1:
There you get a request for replies:
http://community.lithium.com/community-name/restapi/vc/messages/id/[id]/replies/count
and an other one for the solution marker:
http://community.lithium.com/community-name/restapi/vc/messages/id/[id]/solutions/solution
Best regards,
Christian
- amuthan8 years agoAdept
Thanks for the reply.
I need it as single endpoint that should give root message topic,replies count,solution there or not,timestamp,author id with image.
Performance based approach is needed.
- cike8 years agoChampion
Regarding to your requirement to get all those information from only one endpoint, I would recommend developing a custom endpoint by yourself. Within the endpoint you can request the Lithium API resources an concat them to a response object which fits in your requirements.
So, components in your frontend will only need one AJAX request to this endpoint (which does the "expensive" API calls on the server side). For example you can build a JSON-Object which is returned by this endpoint and can be processed in other components.
Best regards,
Christian
Related Content
- 8 months ago
- 8 months ago
- 3 years ago
- 3 years ago