Hi,
We have implemented Lithium forums. If I click on a message in a forum, I see a URL like:
http://forums.xyz.com/board/message?board.id=pqr&t
Now when I try to use the following REST API:
http://forums.xyz.com/restapi/vc/messages/id/5948/
I expect the above API to return board "pqr" but for some reason it is returning a different board id.
What could be the reason that the above API is returning incorrect board id in our instance? I see the same issue with other APIs.
Thanks for all your help!
Solved! Go to Solution.
Hi gabatra,
The first url you are showing lists a thread id of "5948". The thread id is different than the message id. Can you try "restapi/vc/threads/id/<threadid>/board" and see if that gives you back the expected results?
Hi,
As per your suggestion, tried the following:
http://forums.xyz.com/restapi/vc/threads/id/5948/b
But even this doesn't return board id as "pqr". This returns the same board id as my earlier query:
http://forums.xyz.com/restapi/vc/messages/id/5948/
Also, as per my understanding, thread id is same as the message id of the first message in that thread, so it shouldn't really matter.
Thanks.
Hi,
This is a confusing aspect of messages, which is not made clear in the docs. Each message basically has two integer ids, one uniquely identifies the message only within a board, and the other uniquely identifies a message across the entire community. When a URL specifies both a board id and a message id, it is using the board-relative message id. When it only specifies a message id, it is using the community-wide message id. To get a message using the board id and message id you see in a message URL, you can use
http://forums.xyz.com/restapi/vc/boards/id/pqr/mes
That will give you the message with board-relative id '5948' within the board 'pqr'.
http://forums.xyz.com/restapi/vc/messages/id/5948
Will give you the message with the community-wide id '5948', which has no particular relation to the message with that id in board 'pqr'.
In a message response, the 'id' element always specifies the community-wide message id. The misnamed 'board_id' element specifies the message's board relative id.
Doug
Hi Doug,
Thanks for your reply. This answers my question.
Thanks dhauge! Sorry, gabatra for the confusion.