Forum Discussion

bowenli's avatar
11 years ago

how to search messages in idea board with some certain status

have searched all over the forum ,could not find an API to pull all messages in idea board with a type of status.

 

For example , If i want to pull messages with status of "NewIdea" in an idea board,I could image the following :

 

<#assign result =rest("/boards/id/myideas/messages/search?q="status-key:NewIdea" />

 

 which never works.

 

 

 

2 Replies

  • DougS's avatar
    DougS
    Khoros Oracle
    11 years ago

    You can make the following REST call to get threads with a certrain status:

     

    http://community.lithium.com/t5/Community-API/bd-p/developers-rest-api?leaf-id=Board.threads.for.message_statuses.key.status_key#Board.threads.for.message_statuses.key.status_key

     

    Given your example, the call you would make would be:

     

    <#assign result =rest("/boards/id/myideas/threads/for/message_statuses/key/NewIdea/recent") />

     

    I would have recommended you use /topics instead of /threads but it appears we only give you a count (and not the messages themselves) when you make a /topics /replies or /posts call.

     

    It doesn't look like message status is indexed in the message search index, so the threads call is your only way to get these kinds of messages, at least for now.

     

    -Doug

  • chrigu's avatar
    chrigu
    Guide
    11 years ago

    Hi

     

    I'm trying to achieve the same but I'm running in the following problem:

     

    When I call "/boards/id/mysuperidea/threads/for/message_statuses/id/65" The count is always zero even if I have two ideas that have this status. I've checked the status in "/boards/id/mysuperidea/threads" and the messages have the message_status id set to 65.

     

    I also tried "/boards/id/mysuperidea/posts/for/message_statuses/id/65", "/boards/id/mysuperidea/replies/for/message_statuses/id/65" but the result is always the same. 

     

    Is there anything special that needs to be set somewhere?

     

    Thanks