i have requests to fetch comment and post data, but i'm struggling to work out how to build a tree from the responses? do i fetch comments with arg parent_id to get a comment's children, and do so recursively for those comments returned that themselves have comments?
I'd call
GET /api/v3/comment/list?post_id=&type_=All
to get comments, then sort the comments withpath
attribute.thanks for the clear info. i think i'd missed the All type_. now off to find the path attribute.
so "path" is a decimal separated list of comment ids? docs say nothing, but it looks like that.
Yes. See here.
chiming in here because I’m trying to figure this out too. If there’s say, thousands of comments, and I don’t want to get all of them at once, how would I sort them based off the path? I don’t want to miss any replies to comments that are loaded, and it doesn’t appear that comments returned are sorted or grouped together in any way by default