Forum Discussion

synthesis's avatar
11 years ago

REST API - Returning a "solution" flag in messages

Hello! I've spent the last hour looking around the forums and didn't see an answer to my question so here it goes...

 

Is there a way to return a "solution" flag/node/whatever with each message returned from a call like this:

 

http://h30434.www3.hp.com/restapi/vc/boards/id/Printing/posts/recent?page_size=50&page=1&restapi.response_format=xml&restapi.format_detail=full_list_element&restapi.response_style=view

 

I just want to be able to tell if a specific message solved a thread or not. 

 

Ideally I'd like to avoid making additional calls to find the solution to a thread but I'm open to just about anything at this point.

 

Can anyone help?

  • Tim_h's avatar
    Tim_h
    11 years ago

    synthesis wrote:

    Is there an API call I can make to find out if a specific thread (by thread ID) has a solution?


    restapi/vc/threads/id/XXX  will return the details of a thread, with a value in "Solutions" if one exists.

    <solutions><solution type="message" href="/messages/id/XXXX">

     If there is no solution it returns like this:

    <solutions/>

     

    That should get what you need for each one.

     

5 Replies

  • PaoloT's avatar
    PaoloT
    Lithium Alumni (Retired)
    11 years ago

    Hi synthesis 

     

    You should be able to make a call to check each message using something like

     

    http://community/restapi/vc//messages/id/4348980/solutions/solution

     

    Hope it helps,

  • synthesis's avatar
    synthesis
    Guide
    11 years ago
    Paolo, Thank you for your response and the example API call. The problem I have is I read between 10-20 THOUSAND posts every single morning in order to add new messages to an internal DB and to update things like the number of kudos and the number of views. I DO NOT want to make 10-20K individual calls. Is there a way to find out if a thread has a message marked as solved? This would would cut down on my overall call considerably. Are there any other solutions I'm overlooking? ~Tony
  • PaoloT's avatar
    PaoloT
    Lithium Alumni (Retired)
    11 years ago

    Hi synthesis 

     

    it sounds like your use case is very specific and therefore I'd suggest to get in touch with your account manager and see wheter there is anything that can be done from Professional Services to facilitate the task.

     

    That said, if you make a call for a single thread, the response should contain a <solutions> element that is either empty, or contains solutions within the tread itself. Another alternative could be to use the search API instead and look for threads marked as solved.

     

    There are also different possibilities, that may depend on your precise requirement, so I still suggest to get in touch with your Lithium manager and discuss this to find out the best solution available.

     

    Hope it helps,

     

     

     

  • synthesis's avatar
    synthesis
    Guide
    11 years ago

    Hmmmm....

     

    How about I rephrase the question:

     

    Is there an API call I can make to find out if a specific thread (by thread ID) has a solution?

     

    ~Tony

  • Tim_h's avatar
    Tim_h
    Boss
    11 years ago

    synthesis wrote:

    Is there an API call I can make to find out if a specific thread (by thread ID) has a solution?


    restapi/vc/threads/id/XXX  will return the details of a thread, with a value in "Solutions" if one exists.

    <solutions><solution type="message" href="/messages/id/XXXX">

     If there is no solution it returns like this:

    <solutions/>

     

    That should get what you need for each one.