Forum Discussion

alexisc's avatar
alexisc
Guide
14 years ago

REST API call to get topic with accepted solution

I am trying to verify if it is possible to use a REST API call to get a topic and it's associated 'accepted solution' reply post?

 

We would like to integrate this knowledge into a new system and the only way I believe is using REST API but it seems through my investigation this may not be possible.

Any insight is greatly appreciated!

 

Thanks,
alexisc

  • 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!

     

     

     

4 Replies

  • AdamN's avatar
    AdamN
    Khoros Oracle
    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!

     

     

     

  • alexisc's avatar
    alexisc
    Guide
    14 years ago

    Hi AdamN,

     

    Thank you so much for all the very helpful information. I greatly appreciate the insight and the link to the documentation.

     

    Best,

    alexisc

  • Adam,

     

    I don't see anything labeled "solutions" under All Methods on the main page.... I do see how to pull back recent solutions, but am curious if there is a way, outside of a custom endpoint, to search for solutions by keyword (...search?q=xbox...) or pull them back by category or board?

  • AdamN's avatar
    AdamN
    Khoros Oracle
    13 years ago

    Hi Shawn,

     

    You should be able to add the parameter solved with a value of true to your search query. For example:

    ...search?q=xbox&solved=true&...

     I hope this helps!