Skip to main content
Question

Get image by Node ID stopped returning URL


Hello,

we have a couple projects in production that use this endpoint to retrieve images from a particular Figma document.

Up until yesterday, everything was working as expected. We recovered the node ID of the element containing the Image and then we used the endpoint (GET /v1/images/:key?ids=1:2,1:3,1:4) to recover them.

Yesterday morning we received a message from our clients saying that the images for their project were not being added correctly. We started testing and realised that the endpoint was returning the following message:

status: 200,
{
"err": null,
"images": {
"I1111:56472;2:2936": null
}
}

We spend the day testing and we believe that it happens when you try to recover an image from a Copy or instance of an original element. We basically create a copy or instance of original components to form a newsletter, edit the content (texts, images) and then recover information from them.

It was working correctly for months up until yesterday, so what changed? We can’t retrieve images from an instance anymore? I don’t see any info related to this nor any updates to documentation.

Thanks.

This topic has been closed for comments

For anyone with the same problem, we ended up using the Plugin API’s exportAsync method and uploading a base64 version of the images to a external provider in order to get a valid URL.

Still would like to know why the Rest API stopped giving us a valid URL though.


tank666
  • June 13, 2024

Important: the image map may contain values that are null. This indicates that rendering of that specific node has failed. This may be due to the node id not existing, or other reasons such has the node having no renderable components. For example, a node that is invisible or has 0% opacity cannot be rendered. It is guaranteed that any node that was requested for rendering will be represented in this map whether or not the render succeeded.

Source: Figma Developers


As I said, it stopped working from one day to another. We already knew about that, thank you anyway :=)


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings