Forum Discussion

michael-r's avatar
10 years ago

REST API for Message Content of a Featured Thread

Hi there,    I'm just getting my head around REST API & freemarker, so bear with me! :-)   I'm looking to call the message content of a thread within a specific board. Specifically, this is for a...
  • Claudius's avatar
    10 years ago

    Hi Michael,

     

    The component that your colleague created should already include the thread.id. This is the key to pull the message body as well, e.g. using API v2 and the following LiQL query:

    SELECT body FROM messages WHERE id = 'thread.id'

    You might even want to rewrite the initial component for API v2 and LiQL and pull author, title and body for the specific board identified via board.id in one go like this:

    SELECT author, subject, body 
    FROM messages
    WHERE board.id = 'board.id' AND conversation.featured = 'true'
    ORDER BY post_time DESC
    LIMIT 1

     Try out those two searches in the "API browser" tab in your Studio on stage.

     

    Some further reading: