Forum Discussion
I thought You were making the V2 call directly from browser and not from studio.
I have found the way to figure out this issue on your side.
Use below API to fetch results for bookmark from Board using your example
SELECT * FROM bookmarks WHERE target.type = 'board' and target.id='myblog1'
I have tested this on our community as well and its works like a charm.
Hi Parshant,
thanks again for your reply, but the mentioned query is not wokrking and i am wondering how the query can work for you as the target.id cannot be the id of the board. It is the message id of the bookmarked message. The best example is the response i am getting after doing my calls:
{ "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" : { } }
You can easily see that the target.id cannot be the board.id.
I've tried it also with target.type='conversation' as i saw the target.type= 'conversation ' in the result.
The bookmarked message is in our blog with the id "wlb_community-principles".
I have a second blog which contains no bookmarks of the calling user, but using the blog.id of this will give again back the response above - and this is still wrong.
- Parshant7 years agoBoss
If you write target.type = 'conversation' in your query it will return all the conversation means only messages from the bookmarks. You can not pass board.id with the target.type = 'conversation' . You can only pass target.id of related target.type
and If you need to get all bookmark results from your one blog you need to add
target.type = 'board' and target.id='wlb_community-principles'
both in your where clause.
If you are still facing this problem
- STARFLEET7 years agoExpert
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.
- STARFLEET7 years agoExpert
One additional finding:
For categories it seems working fine, the error is only happening on board-level.
SELECT * FROM bookmarks WHERE node.id='category:wlb_community-en'
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 within this category there was 1 bookmark of the user.
Now double checked with a category where no bookmark was set:SELECT * FROM bookmarks WHERE node.id='category:wlb_community-de'
RESPONSE:
{ "status" : "success", "message" : "", "http_code" : 200, "data" : { "type" : "bookmarks", "list_item_type" : "bookmark", "size" : 0, "items" : [ ] }, "metadata" : { } }
RESULT: OK ! In this category the user had no bookmark. The response is correct.
Related Content
- 12 months ago
- 2 years ago