How to upload file to Column file with api request in Javascript?

Hi,

i try to upload file to File Column with monday api in javascript.
i seccess to upload the file with Postman, but when i try to upload the file from my server i get error.

this is the code to upload the file in my server:

 var myHeaders = new Headers();
    myHeaders.append("Authorization", token);    
    
    const data = new FormData();
    data.append(
      "query",
      'mutation add_file($file: File!) {add_file_to_column (item_id: 1365130178, column_id:"files", file: $file) {id}}'
    );
    data.append("map", '{"image":"variables.file"}');
    data.append("image",file); 
  
    var requestOptions:any = {
      method: 'POST',
      headers: myHeaders,
      body: data,
      redirect: 'follow'
    };
    
    fetch("https://api.monday.com/v2/file", requestOptions)
      .then(response => response.text())
      .then(result => {
        console.log(result)
      })
      .catch(error => {
        console.log('error', error)
    });```

the error that i get is:
'<!doctypehtml><html><head><style>@font-face{font-family:Roboto;font-style:normal;font-weight:500;font-display:swap;src:url(data:font/woff2;base64,d09GMgABAAAAACswAA4AAAAAVHwAACrYAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGmQbmh4cg3wGYACHbBEMCu9I2GwLg3IAATYCJAOHYAQgBYMAByAbO0YzA8HGAQBQZyajkRFsHAAUbVAUZYOyJfg/JGgLhuC1B62JCWNiDIqaKUtrEQhjIJnCeHmtlh3y9eOs6eV8V611d7UeMfbVnwlxCKJ/aszxY8wj28fCDwDEjtHQSGISRHbBf3VPz+0TnYmOzJCIGIRCBCiDP3jzAz+33l9BS6kI2qBNxQhHjsiclLhROUa1REuFA0ERRaoM9IBDLEoseorniVIA/0TV1FpmLrOQP6wj/…);if (document.readyState !== 'loading') {document.onreadystatechange = prev;handler();}};}})();</script><script defer src="https://static.cloudflareinsights.com/beacon.min.js/v84a3a4012de94ce1a686ba8c167c359c1696973893317" integrity="sha512-euoFGowhlaLqXsPWQ48qSkBSCFs3DPRyiwVu3FjR96cMPx+Fr+gpWRhIafcHwqwCqWS42RZhIudOvEI+Ckf6MA==" data-cf-beacon='{"rayId":"84666685db76e3cf","b":1,"version":"2023.10.0","token":"ef3b38c2289c47fa9034fc63ed8ed581"}' crossorigin="anonymous"></script>\n</body></html>\n'

thanks,
Lidor.

Hello there @Ovadia1311 and welcome to the community!!

Please submit this form with the same information and a timestamp of the last time you tested it from your script including:

  1. Script
  2. User ID (or email address) of the user whose API token is being used for the call
  3. Account ID (or name)
  4. Date
  5. Hour
  6. Minute

With this information our team will take a look into this :grin:

Cheers,
Matias