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?
This is not possible with the Plugin API, but you can use the REST API and the “GET comments” endpoint.
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.
Thanks @tank666 for your great help!!
Do you know a way to access the comments on a file branch. Does API only work on the main file ? That’s a bummer.
Have you tried specifying the branch key instead of the main file key?