Forum Discussion

dhpawar's avatar
dhpawar
Helper
12 years ago

Call REST API for accepted solutions (Question & answer)

Hi,

is it possible to search across string for questions? I mean whether there is a method in the REST API that allows us to retrive a list of questions that are marked as solved and only matches with a given string.

For example searching and retrieving and xml containing all the solutions that contains the keyword 'feedback'.

Does anyone know about how to use the parameter in the REST API?

Thanks,

3 Replies

  • AdamN's avatar
    AdamN
    Khoros Oracle
    12 years ago

    If you use the REST API message search call, you can filter by various criteria. To get only messages that are solutions (i.e. the reply to a question that has been marked as the solution), you can add the parameter "solution" and set the value to true.

     

    For example:

    http://lithosphere.lithium.com/restapi/vc/search/messages?q=feedback&solution=true

     

    If instead you wanted messages that have been solved (i.e. questions that have received a solution), you can use the parameter "solved" and set the value to true.

     

    For example:

    http://lithosphere.lithium.com/restapi/vc/search/messages?q=feedback&solved=true

     

    The first essentially gives you the "answers", and the latter essentially gives you the "questions".

     

    Does that answer your question, or were you looking for something different?

  • dhpawar's avatar
    dhpawar
    Helper
    12 years ago

    I am looking to Rest call which searches for relevant posts /threads using the keyword.  also trying to filter the result such that i get back only threads  that has accepted soultions. is it possibale in singal Rest API Call?

     

     

    Thanks

     

     

  • AdamN's avatar
    AdamN
    Khoros Oracle
    12 years ago

    When searching, you will only get results back in messages instead of threads. You can get topics (the root messages, or questions) using the method I described previously. But to get the corresponding thread object (root message plus reqplies) you will need to make an additional REST API call per topic message.

     

    Alternately, you could combine these calls into an endpoint using the techniques described here:

    http://lithosphere.lithium.com/t5/developers-knowledge-base/Using-Endpoints-to-Condense-REST-API-Requests/ta-p/88908