403 Forbidden CORS, accessing Figma API from inside Figma

Hi!

I’m a developer building a small Figma Plugin to export components as images directly to ClickUp. I’m having trouble with the GET/v1/images/:key endpoint in the Figma API.

I’m using a personal API token, and using a proxy to make the request. I’m getting a 403 forbidden cors error.

Here’s the specific code I’m using:

fetch(`https://fierce-spire-09192.herokuapp.com/https://api.figma.com/v1/images/{(File ID)}?ids={(Object ID)}`, {
                  "method": "GET",
                  "muteHttpExceptions": true,
                  "headers": {
                      "Authorization": `(my personal auth token)`,
                      "Access-Control-Allow-Origin": "true"
                  }
              }).then(response => {
                console.log(response);
              });

Where the prefix of the request is the proxy URL (using CORS anywhere), which I’ve verified works for the Clickup API, but doesn’t work for Jira API. Making the request directly in Figma works perfectly.

I was wondering if there’s a way to resolve this? Thanks so much!

1 Like

Are you sure the url you put is correct? It seems wrong to me.