Read current page comments

Hi Folks,

I have requirement to read the all comments on current figma page and download them as csv file as soon I run my figma plugin. I tried to look at API’s but I haven’t found anything so far about comments API, could you please help me with this?

Thanks

1 Like

This is not possible with the Plugin API, but you can use the REST API and the “GET comments” endpoint.
https://www.figma.com/developers/api#comments

Thanks @tank666 for reply, can I get X-FIGMA-TOKEN value in the figma plugin so I can call the api from plugin to download it.

You can only get a user’s personal access token when they enter it into your plugin’s input field.

No way to get automatically in the plugin? (I don’t want that they copy and paste it manually, because they have to copy it and keep it in local and everytime they need to paste it so it’s difficult to do)

This is impossible. This should only be done by the user.

Everything related to the personal access token is described in the links below.
https://www.figma.com/developers/api#access-tokens

Thanks @tank666 for your great help!!