REST API call to get topic with accepted solution
- 14 years ago
Hi alexisc,
It is possible to obtain this data via the REST API.
If you know or are able to obtain the thread ID of the thread you're interested in, you can use the "threads" method on the "Community" class. A sample call would look like this:
http://<your community domain path>/restapi/vc/threads/id/thread_id
Where thread_id is the ID of the thread for which you'd like to obtain information. The result of this method will give you details about the topic, as well as details of the solution. For the solution details, there's a "solutions" element in the XML that is returned (assuming the topic has an accepted solution).
If you'd rather get a list of recent solutions, there's a "solutions/recent" method on the Community, Category, Board, Blog, and GenericNode classes. A sample call would look like:
http://<your community domain path>/restapi/vc/solutions/recent
This call will return a list of threads that have one or more accepted solutions. For each thread returned, there's information about the topic as well as the solutions.
There are other solutions related calls available as well, including the ability to mark a message as a solution. If you have the latest REST API docs handy (http://lithosphere.lithium.com/t5/Documentation-TKB/Admin-Guide-REST-API-JavaDocs/ta-p/5966), pull up the "All Methods" page and do a search within the page for "solutions" to see all of the relevant calls.
I hope this helps!