Forum Discussion

david-mcgurrin's avatar
6 years ago

Link to forum post using message_id

Hey Parshant - just following up on the question I asked here.

Getting the "board_id" and "message_id" works great, however I'm still having a bit of trouble actually linking back to the forum post from the  "Post Success Page".

For example, on this Lithosphere board the message ID is as follows:

The forum post itself includes the title of the post and another link before the "message_id" and this number is different for each of the boards so I'm not entirely sure how I can use the "message_id"  to go back to the post after it was successfully posted.

 Any tips or advice here would be great so that I can add a link to return to the forum post when it was posted successfully.

  • david-mcgurrin,

    You can get the message information using V1 and V2 API using that "message_id".

     

    <#assign msgId = rest("/boards/id/${board_id}/messages/id/${message_id}/id").value/>

    and pass this msgId to V2 API.

    SELECT id, view_href, topic.id, topic.view_href, board.id, board.view_href FROM messages WHERE id = '${msgId}'

    This will fetch all the information that message, forum post, board anything you would like. You can also add new fields to the API to get more info. topic.id is the main message id if its reply, and if the message is topic then it will be the same for that id.

    Here is the doc for API v2 messages.

     

  • david-mcgurrin,

    You can get the message information using V1 and V2 API using that "message_id".

     

    <#assign msgId = rest("/boards/id/${board_id}/messages/id/${message_id}/id").value/>

    and pass this msgId to V2 API.

    SELECT id, view_href, topic.id, topic.view_href, board.id, board.view_href FROM messages WHERE id = '${msgId}'

    This will fetch all the information that message, forum post, board anything you would like. You can also add new fields to the API to get more info. topic.id is the main message id if its reply, and if the message is topic then it will be the same for that id.

    Here is the doc for API v2 messages.