Skip to main content
March 26, 2024
Solved

API call results in an empty data response (202 Statuscode)

  • March 26, 2024
  • 21 replies
  • 2519 views

Hi together we are facing a strange behaviour regarding the Figma API Endpoint /v1/images

We are fetching some images but sometimes it happens that we get an API response with an empty data field, but no additional error like “to many request” or similar.

Is there any know issue or limitation?

This topic has been closed for replies.
Best answer by jefflee

Hey folks, Jeff from Figma here. We appreciate everyone’s patience on this issue and sincerely apologize for the disruption.

First, the details: we had a misconfiguration in our anti-automation protection. This was in effect from March 25 5:50PM Pacific to March 26 8:50AM Pacific, and affected about 0.5% of our REST API traffic. As others have observed in this thread, if you hit this issue, you’d get a 202 status code with an empty response body. Definitely not great!

We’re working on trying to prevent this thing from happening again. More than that, we’re also not happy with how long it took us to get to a solution. We had some early metrics that didn’t accurately convey the scope of the issue, and we’re working on improving our response time.

Thanks again for everyone bearing with us.

21 replies

March 26, 2024

Seems like AWS is doing a challenge check on these requests:

docs.aws.amazon.com
Nuno_Ferreira
March 26, 2024

On Node v20.11.1 the standard fetch request always works while axios always returns empty string

const teamProjects = await fetch(`https://api.figma.com/v1/teams/${FIGMA.TEAM_ID}/projects`, {
		headers: {
			'X-Figma-Token': FIGMA.ACCESS_TOKEN
		}
	}).then((response) => response.json());
March 26, 2024

Works well with fetch (node v20). Its a workaround for now, but it should not matter which http lib we are using.

Reece_McDonald
New Member
March 26, 2024

We’re also seeing this issue with fetch in node (v18).

Luca_Oelsner
New Member
March 26, 2024

Not sure what is going on here, but it seems like downgrading Node from v20 to v16 fixes the issue with axios for us.

Eugene_Gromadsky
March 26, 2024

It helps for me (v20.11.0) Thank you

Reece_McDonald
New Member
March 26, 2024

I think this was just fixed on Figma’s end. Node version shouldn’t really affect this? It’s working for us again now with no node version changes.

Nuno_Ferreira
March 26, 2024

It matters for server requests because native Fetch API only exists on NodeJS since v18.
But my guess is that that AWS Challenge was turned on by default during an upgrade (AWS does stuff like that) and Axios - and others - are maybe adding something that makes it trigger (User Agent or any other header) the browser challenge.
But of course, I can be totally wrong and this is something else entirely.
Figma is a massively complex system, so better not make any assumptions 😉
For what is worth, in my use case I dropped the reliance on a third-party package and refactored to use native Fetch instead.

jefflee
Figmate
jeffleeAnswer
Figmate
March 26, 2024

Hey folks, Jeff from Figma here. We appreciate everyone’s patience on this issue and sincerely apologize for the disruption.

First, the details: we had a misconfiguration in our anti-automation protection. This was in effect from March 25 5:50PM Pacific to March 26 8:50AM Pacific, and affected about 0.5% of our REST API traffic. As others have observed in this thread, if you hit this issue, you’d get a 202 status code with an empty response body. Definitely not great!

We’re working on trying to prevent this thing from happening again. More than that, we’re also not happy with how long it took us to get to a solution. We had some early metrics that didn’t accurately convey the scope of the issue, and we’re working on improving our response time.

Thanks again for everyone bearing with us.

Princi_Vershwal
November 14, 2024

Hello @jefflee
Is this happening again?
I’ve noticed that Figma APIs are sometimes responding with a 202 status code and an empty response body. However, this issue seems to occur intermittently and is not consistent.

Here are some URLs I am working with, I am hitting these urls from my nodeJs service:-