Hello everybody!
Some time ago (about a month ago)
My tool worked fine, uploading files to monday via the API
Now I’m getting an error:
{"errors":[{"message":"'content-type' header must be one of: \\"application/json\\" or \\"application/graphql-response+json\\"","extensions":{"code":"INVALID_CONTENT_TYPE_HEADER"}}],"account_id":null}
I use multiloading of files by sending a request for each file in turn.
my TS(javascript) code
for (const file of files) {
const formData = new FormData()
formData.append(
'query',
`
mutation($file: File!) {
add_file_to_column(
file: $file,
item_id: ${id}
column_id: "${columnId}",
) {
id
}
}
`
)
formData.append('variables[file]', file)
const response = await fetch(API_URL, {
method: 'POST',
headers: {
Authorization: API_KEY,
'API-Version': API_VERSION
},
body: formData
})
}
Does anyone know how to solve this error since I can’t send files to application/json?