Parshant
I guess my post resulted in a misunderstanding on your side.
What i meant was, that i have ALSO tried it with the conversation as target.type because it was part of the object on the response.
I also tried to show you that target.id cannot be any board-id or node.id. It can only be a message-id.
To sum it up, what i did so far is:
Assume i have 2 blogs, the first one with the board-id "wlb_communities-principles" and the second one with the board-id "wlb_communities-stories". The user has bookmarked only one message within the "wlb_communities-principles".
Overview about the tested queries:
SELECT * FROM bookmarks
Response:
{
"status" : "success",
"message" : "",
"http_code" : 200,
"data" : {
"type" : "bookmarks",
"list_item_type" : "bookmark",
"size" : 1,
"items" : [ {
"type" : "bookmark",
"id" : "54",
"href" : "/bookmarks/54",
"target" : {
"type" : "conversation",
"id" : "1337",
"view_href" : "/t5/Principles/MyPrinciple3/ba-p/1337",
"style" : "blog",
"thread_style" : "blog",
"messages_count" : 1,
"solved" : false,
"last_post_time" : "2018-08-13T21:12:58.753+02:00",
"last_post_time_friendly" : "Monday"
},
"subscriber" : {
"type" : "user",
"id" : "4",
"href" : "/users/4",
"view_href" : "/t5/user/viewprofilepage/user-id/4",
"login" : "STARFLEET"
}
} ]
},
"metadata" : { }
}
RESULT: this is OK, as the query will give back every existing bookmark of the user
SELECT * FROM bookmarks WHERE target.type='board' and target.id='wlb_communities-principles'
Response:
{
"status" : "success",
"message" : "",
"http_code" : 200,
"data" : {
"type" : "bookmarks",
"list_item_type" : "bookmark",
"size" : 0,
"items" : [ ]
},
"metadata" : { }
}
Result: this is not OK, the expectation would be that the bookmarked item will be in the response, but as i said before, this is NOT a surprise for me, because the target id has to be a message id and therefore this query cannot work !
SELECT * FROM bookmarks WHERE node.id='boards:wlb_communities-principles'
Response:
{
"status" : "success",
"message" : "",
"http_code" : 200,
"data" : {
"type" : "bookmarks",
"list_item_type" : "bookmark",
"size" : 1,
"items" : [ {
"type" : "bookmark",
"id" : "54",
"href" : "/bookmarks/54",
"target" : {
"type" : "conversation",
"id" : "1337",
"view_href" : "/t5/Principles/MyPrinciple3/ba-p/1337",
"style" : "blog",
"thread_style" : "blog",
"messages_count" : 1,
"solved" : false,
"last_post_time" : "2018-08-13T21:12:58.753+02:00",
"last_post_time_friendly" : "Monday"
},
"subscriber" : {
"type" : "user",
"id" : "4",
"href" : "/users/4",
"view_href" : "/t5/user/viewprofilepage/user-id/4",
"login" : "STARFLEET"
}
} ]
},
"metadata" : { }
}
RESULT: this is OK ! And i was happy that his query delivers exact 1 bookmarked item within the specific board. To ensure that this is really working, I did the same call for the board where no bookmark was set:
SELECT * FROM bookmarks WHERE node.id='boards:wlb_communities-stories'
Response:
{
"status" : "success",
"message" : "",
"http_code" : 200,
"data" : {
"type" : "bookmarks",
"list_item_type" : "bookmark",
"size" : 1,
"items" : [ {
"type" : "bookmark",
"id" : "54",
"href" : "/bookmarks/54",
"target" : {
"type" : "conversation",
"id" : "1337",
"view_href" : "/t5/Principles/MyPrinciple3/ba-p/1337",
"style" : "blog",
"thread_style" : "blog",
"messages_count" : 1,
"solved" : false,
"last_post_time" : "2018-08-13T21:12:58.753+02:00",
"last_post_time_friendly" : "Monday"
},
"subscriber" : {
"type" : "user",
"id" : "4",
"href" : "/users/4",
"view_href" : "/t5/user/viewprofilepage/user-id/4",
"login" : "STARFLEET"
}
} ]
},
"metadata" : { }
}
RESULT: this is NOT OK, there should be NO bookmarked item in the response for this board!
I guess this is a bug !!
These are my findings so far and i did not find a way to show only bookmarks of a user specific for a board.