Forum Discussion

Srikanth_Reddy's avatar
Srikanth_Reddy
Contributor
3 years ago

what is the best way of using "query-multiple-collections" REST API ?

I am trying to use the "query-multiple-collections" REST API for pulling all messages from the Khoros community. 

https://developer.khoros.com/khoroscommunitydevdocs/reference/query-multiple-collections 

1. is there any parameter to differentiate the message types (like Questions, Blogs, Articles, etc)? 

 

2. I would like to get all questions that are created/updated in the last 6 hours. how can I achieve this?  

    this updated means: if someone posted a reply or accepted a solution or title modified etc. 

 

Thanks,

Srikanth

 

  • Hi

    If I understand correctly, I don't think you really need to query multiple collections. "messages" is a collection, so you can query messages and get all messages from your community regardless of what board or category they are in unless you specify otherwise.

    This messages (khoros.com) lists all the fields and constraints for messages.

    You can use the constraint conversation.style messages (khoros.com) to select the message type.

    You can use the constraint conversation.last_posting_activity_time messages (khoros.com) to get questions that were edited or replied to in your 6 hour time frame. I don't think this would include accepting a solution though. I'm not sure if there is a way to do that. Also, you need to specify depth=0

    So your LiQL query would look something like this

    SELECT subject, id, [or whatever fields you want] FROM messages WHERE depth = 0 AND conversation.style = 'forum' AND conversation.last_posting_activity_time < [your time]