Forum Discussion

derek_walker's avatar
10 years ago

REST API v2 URL?

Can I submit LiQL queries through url requests? I need to do some filtering and data retreival that v1 does not allow.

 

Specifically, given a node $display_id, I need the $id, $thread_id, $author_id, $body, and $post_date of all messages posted since $last_checked_date.

 

The $display_id and $last_checked_date are variables that I wanted to provide in the url.

 

I can almost do this with the .../restapi/vc/boards/id/$display_id/messages/linear?message_viewer.topic_sort_order=last_post_date&page=1 endpoint but it does not provide the message body. This would require me to make an individual REST API request for each message to get the body.

 

I am hoping to accomplish this through REST API v2 but could also fall back to a custom endpoint (even though I hate freemarker ;) ).

  • Hi derek_walker,

    did you find the way how?

    I need pretty much the same.

    Struggling to do it in one url for Ajax call to fetch the recent posts from all discussions with specific phrase, get the subject and body of the posts. And do it aka polling every 2 sec or so.

    I need help :-(.

    Agreed on FreeMarker part ;-) 

    • phani's avatar
      phani
      Advisor

      Hi irach15derek_walker,

       

      Use parameter "restapi.format_detail=full_list_element" in API call to get Subject and body in same API call.

       

      Example API V1:

      /restapi/vc/boards/id/${Board ID}/messages/linear?message_viewer.topic_sort_order=last_post_date&page=1&restapi.format_detail=full_list_element

       

      Recent Posts: /restapi/vc/boards/id/${Board ID}/posts/recent?page_size=10&page=1&restapi.format_detail=full_list_element

       

      Hope this helps!

       

      Thanks,

      Phani