Skip to main content
Parag_Gupta
May 15, 2023
Solved

Find link between comment and page/canvas

  • May 15, 2023
  • 3 replies
  • 740 views

Hello all,

Trying to find all comments on a page using the Rest API, but there does not seem to be any filter to find comments via page/canvas, but only for the entire file.

I looked at the Rest API response to see if anything (maybe client_meta answers it) but not seeing anything reliable there.

Is there a simple way to:

Option 1: Given a page/canvas, find all comments on it?
Option 2: Given a comment, find the page it belongs to?

Currently, I’m going Option 2, by using client_meta, and finding the page that element belongs to, and then linking it to the page, but that seems to be calling too many APIs.

Also, is there any structure to the Node IDs? Not able to find any documentation. The IDs are of the format xxx:yyy.

Thanks!

This topic has been closed for replies.
Best answer by jak_e

Hey @Parag_Gupta! The client_meta.node_id is the node that the comment is fixed to. Sometimes that is the page itself, sometimes it’s a node that is nested within the page. To do either of the things you’re talking about, you will want to also get the file using the get file endpoint. Then, you would navigate the file children to find the nodes that the comments belong to, by referencing their id. From there, you can determine what page the node is on. You can also start with a page, and go through its children to find which comments belong on that page.

The id strings are unique to the file, and although at times include information that lines up with other ids, you will not be able to rely on them as identifiers for other nodes.

3 replies

jak_e
Figmate
jak_eAnswer
Figmate
May 15, 2023

Hey @Parag_Gupta! The client_meta.node_id is the node that the comment is fixed to. Sometimes that is the page itself, sometimes it’s a node that is nested within the page. To do either of the things you’re talking about, you will want to also get the file using the get file endpoint. Then, you would navigate the file children to find the nodes that the comments belong to, by referencing their id. From there, you can determine what page the node is on. You can also start with a page, and go through its children to find which comments belong on that page.

The id strings are unique to the file, and although at times include information that lines up with other ids, you will not be able to rely on them as identifiers for other nodes.

Parag_Gupta
May 18, 2023

That’s the approach I was afraid of 😦
Thanks @jak_e

Arturs1
July 31, 2024

Yeah, would love a better API to connect comments and pages / nodes, too. I want my users to share a link to either a canvas or specific node inside canvas and get all comments within that region. Trying to whole tree is quite intensive. Having something like path of parent nodes for each comment would be awesome.