Forum Discussion
If you include the parameter restapi.response_style=view in the REST API URL, the results will include the URL for each message returned in the results.
For example, if you search Lithosphere:
http://lithosphere.lithium.com/restapi/vc/search/messages?q=test&restapi.response_style=view
The first message tag looks like this:
<message type="message" href="/messages/id/129079" view_href="http://lithosphere.lithium.com/t5/developers-discussion/Test-messages/m-p/129079#M4947">
The view_href URL should take you straight to the message, whichever page it is on.
Thanks, Nathan, and we are aware of this functionality, but we need the ability to show the thread within our tool without linking out to the website. The case we are using it in will not allow the users to actually go to the website (it is blocked on their machines). We need to replicate the same functionality as that view_href link within our own tool.
Does that make sense?
- YuriK11 years agoKhoros Expert
Hey Bdelaune,
If I'm not mistaken, you're trying to do is figure out the index of the message in a thread, so that you can figure out what page to pass into the /threads/linear call. Unfortunately, there is nothing out of the box that will do that at the moment. One of the reasons for this is that the index of the message would depend on how you're sorting the messages in a thread.
One way that you could get this information is to create an endpoint that will take in a message id and a thread id, and will page through the thread's results using AdamN's method and return the index of the message in the thread with your sorting algorithm, you can then use the index of the message to decide what page to retrieve from the /thread/linear call. However, this approach may not be performant enough for your needs, but since you're doing this for one message at a time only when the user clicks on a search result, it may be ok.
I would also suggest that you add a suggestion to the Lithium Ideas board to create an API that returns the index of a message within a thread that is sorted with a specific algorithm.
Hope this helps,
Yuri
Related Content
- 10 months ago
- 5 years ago
- 11 months ago
- 2 years ago