Figma Support Forum

Figma API Help

Hey Figma friends,

I’ve been experimenting with the Figma REST API for an app. I have a prototype that works well with my Personal Access Token. But now I’m trying to build out the entire OAuth2 flow.

I can see the access_token and other attributes from the response after making this POST request:


  "access_token": <TOKEN>,
  "expires_in": <EXPIRATION (in seconds)>,
  "refresh_token": <REFRESH TOKEN>

But when I finally make this call:

headers = {"content-type": "application/json", "Accept-Charset": "UTF-8", 'X-FIGMA-TOKEN': accessToken}
fileURL = '' + figmaFileKey
fileResponse = requests.get(fileURL, headers=headers)

I get a 403 Invalid token as the response.

Any idea what I could be doing wrong? Thanks for your help.

I’m pretty sure for Oauth flow you need to use Bearer token, not X-FIGMA-TOKEN. I don’t remember as I did it a long time ago but check out this project’s code, it was working the last time I checked:!/figma-to-gif?path=server.js%3A111%3A61

Gah, can’t believe I missed that. That was it! Thanks for your help.