Skip to main content
Solved

Unpublished Plugin ID not recognized by the REST API

  • February 6, 2024
  • 2 replies
  • 366 views

Bogriceanu_Sorin

I am working on a project that will link Figma assets to assets in our app.

I am doing a lot of work in a plugin developed by us. We store the required metadata as private plugin data keys (not shared)

We didn’t publish the plugin yet, so we are running with a generic string of characters and dashes as the plugin id in the manifest. the plugin id in dev is: ai-plugin-template-01

All operations in the plugin are working ok, but now we need to read the node tree and this plugin data trough the Figma REST API to perform some checks and syncs.

If I call the api without pluginID it works ok, but if I call it with this plugin ID added i get the following error:

{
  "status": 400,
  "err": "ID ai-plugin-template-01 is not a valid plugin ID"
}

the request I used is:

curl -H 'X-FIGMA-TOKEN: <accessToken>' 'https://api.figma.com/v1/files/HdoDdyV9BtqsloqgR1qFpr/nodes?ids=317-4860&depth=1&plugin_data=ai-plugin-template-01'

I assume it is because of a check in the API layer? Is this maybe a regex check? (i am hopefull… ) 🙂

Is there a way around this?

Thank you,

Best answer by tank666

plugin_data
String (optional)
A comma separated list of plugin IDs and/or the string “shared”.

https://www.figma.com/developers/api#get-file-nodes-endpoint

Plugin IDs—a string containing only digits. So, while the plugin is not published, you can specify arbitrary digits in the manifest and in the REST API request. For example, 0.

This topic has been closed for replies.

2 replies

tank666
  • Answer
  • February 6, 2024

plugin_data
String (optional)
A comma separated list of plugin IDs and/or the string “shared”.

https://www.figma.com/developers/api#get-file-nodes-endpoint

Plugin IDs—a string containing only digits. So, while the plugin is not published, you can specify arbitrary digits in the manifest and in the REST API request. For example, 0.


Bogriceanu_Sorin

hope was not in vane!

string with digits did the trick.

Thank you! 🤗