REST API Variables

Hello there,

A tricky one: Is it intentional that when I use the GET /v1/files/:file_key/variables/local API I can get a response that contains an alias pointing to a variable that is not part of the response itself?

...
        "valuesByMode": {
          "XXXX:X": {
            "type": "VARIABLE_ALIAS",
            "id": "VariableID:XXXXX/XXXX:XXX" //<- This id is nowhere else mentioned in the response.
          },
...

Thank you!

1 Like

Hi there,

Thanks for the post! I’m checking with our internal team, and I’ll update if I have anything I can share with you. Thanks for your patience!

Toku

Hi there,

Thanks for waiting! As I asked our internal team, they think they hope to access your file so they can investigate deeply. Could you please file a case via the form here: https://help.figma.com/hc/en-us/requests/new? The support team will look into it.

Thanks for your understanding!

Toku

Hi,

I have to double check the confidentiality of the files but I will try.

Thanks!

@y_toku I have the same situation - aliases that are nowhere to be found in the list of returned variables. Is this expected under certain conditions from /v1/files/my-file-key/variables/local ?

I am also trying to understand this. Where can I find a VARIABLE_ALIAS?

It looks like these references are stored somewhere else. Is there a REST API to look up the contents of a variable based on its id in the format “VariableID:XXXXXXXXXXXXXXXXXXXXXX/XXX:XXX”

I ended up getting permission to the file(s) in question and requested the local variables from an included library and was able to see more variable alias details.

I think there is still an issue because it would be nice to know where the alias is defined (to access that file directly) or to automatically follow the alias “path” or to be able to look up an aliased value directly.

We made an update a few weeks ago to include some more variables in certain cases: https://www.figma.com/developers/api#changelog

Can you check if the variable referred to in the alias is present now?