I have a requirement to return a list of threads along with like counts. I'm on version 22.214.171.12457 using the REST api in C# via the sdk...
I can get the threads with GET forums/:forumId/threads.json, but the data returned does not include like counts for each thread.
What's the best way to include like counts for each thread in the array returned by the List Forum Threads REST Endpoint?
I will also need to include a "Liked by me" flag or something similar that shows if the user that made the request liked a particular thread.
You can make two requests to get this information:
1. LikedItems List endpoint will return the number of likes for each item. Use the ContentIds parameter to pass all the Thread ContentIds needed.
2. Likes List endpoint will return whether or not the current user has liked each thread. Use the ContentIds parameter to pass all the Thread ContentIds needed.
I'm having an issue with the second call immediately after a thread in the list was liked/unliked. It appears that when I call likes.json with a list of contentIds within a minute or so of liking or unliking a thread, the likes returned does not reflect the most recent like/unlike.
For example, if I have a forum with 10 threads, and I post to like.json to like the first thread, then immediately call likes.json with contentIds set to a comma separated list of contentIds for all 10 threads, the like I just created will not be returned. If I call again about a minute later, the like does come back.
If, in the same example, I call likes.json individually for each of the 10 threads using the contentId parameter instead of contentIds, when I call for the thread I just liked it immediately returns the like.
Same for unlike - if I unlike, then immediately call likes.json with contentId of the thread I unliked, it returns the correct value (totalCount = 0, likes=). If I instead call likes.json with contentIds containing a list of all 10 contentIds, the like i just deleted is returned. Wait a minute and it goes away.
This really looks like a bug in the likes.json endpoint when calling with the contentIds parameter immedately after a like is created or deleted - perhaps it is not honoring the internal cache? Not sure how else to explain the observation that calling likes.json with contentIds list vs. single contentId would return different values immediately following a like/unlike.
I've been able to reproduce this and logged the following bug for review:
Any update on this? Is there a public location on this forum where I can check the status of bugs?
This item has not yet been scheduled but is flagged with "highest" priority. This generally means it will be in the next product release, but not in a hotfix. The reference above (Brian's post) will update as the status changes and an automated response will be posted to this thread when the issue is resolved.
Powered by Telligent Community