How to get the parent comment via the API

I'm trying to work out how to get a parent comment (if any) of a comment. The API documentation lists an attribute of comments 'path', which seems to hold a real, but it doesn't explain anywhere (that I could find), how to derive the parent comment from that.

Can anyone point me towards a resource to help me work this out?

Thanks in advance.

4 points · 3 comments · view on lemmy.world

3 Comments

Rooki@lemmy.world · 1 pts · 3y (2 replies)

Path is build up like this:

"0.97159.97160"

0 = The post itself
97159 = the parent comment id
97160 = the "current" comment id ( should be the same as comment.id )

You can ping me if you have another question!

Bluetreefrog@lemmy.world · 2 pts · 3y (1 reply)

Thank you.

Rooki@lemmy.world · 1 pts · 3y

I didnt understood it at first too. But after checking what the numbers are i can share that information :)