File uploading to column through API doesn't work

Hello!

I was trying to upload a file to a board’s column, using the related API, but it doesn’t matter how I tried, I’ve never succeed.

Goal

I’m creating an automation via n8n, the goal would be to upload a file from there, using it’s HTTP node.
I managed to get 3 different responses:

  • HTTP 500 - Internal Server Error → including a HTML file that points to status.monday.com, saying there are some technical issues.
  • HTTP 403 - Forbidden
  • HTTP 200 - Success - with the following message: 0 message:Variable $file of type File! was provided invalid value locations 0 line:1 column:10 extensions value:[null] problems 0 path:[empty array] explanation:Expected value to not be null

In the meantime, the postman collection with the Monday API queries just disappeared.

I’ve also tried to run a cURL query:

curl --location 'https://api.monday.com/v2/file' \
--header 'Authorization: [my token]' \
--header 'API-version: 2023-10' \
--form 'query="mutation add_file($file: File!) {add_file_to_column (item_id: 1738932593, column_id:\"invoice\" file: $file) {id}}
"' \
--form 'map="{\"image\":\"variables.file\"}
"' \
--form 'image=@"/home/garam/Downloads/wallpaper.png"'

This also returned with HTTP 500.

Postman query also keeps returning HTTP 200 with the same error mentioned above.

Any ideas how to solve this issue?

Hello there @Garam and welcome to the community!

Would you be able to please try using this structure for your request:

Edit:

In the meantime, the Postman collection has become available again, but the file uploading query there also returns HTTP 500.

Hello there @Garam,

I just tested it directly from the Postman collection and it is working well for me:

Are you sure you do not have an error in what you are using as an ID, or as the file?

It works now, thanks!
One issue was the lack of name after mutation keyword, also I’ve used the wrong column ID (I expected it to be the column name in lowercase, but it has a totally different one.:sweat_smile:).

Glad you got there in the end, when I get stuck with things like this chatGPT or mondayGPT can be super helpful to get the code you required. Has saved me loads of time.

Alternatively, just use a free no-code tool like this to avoid all the hassle of coding!

I am glad this is working now @Garam !