Need help uploading a file in Monday.com file column

Hi,

I need some help to upload a binary file (PDF) to a file column in monday.com. I was trying to do it in the monday.com change column value node, but I failed.

Now I am trying to do it in HTTP but dont know how to create it.

I would appreciate some help.

Kind regards,

<{
“nodes”: [
{
“parameters”: {
“httpMethod”: “POST”,
“path”: “pdfquotation”,
“options”: {}
},
“name”: “Webhook”,
“type”: “n8n-nodes-base.webhook”,
“typeVersion”: 1,
“position”: [
420,
300
],
“webhookId”: “946379be-feb3-453c-83c4-9c9cafca1364”
},
{
“parameters”: {
“url”: “={{$json[“body”][“document”][“download_url”]}}”,
“allowUnauthorizedCerts”: true,
“responseFormat”: “file”,
“options”: {}
},
“name”: “HTTP Request1”,
“type”: “n8n-nodes-base.httpRequest”,
“typeVersion”: 1,
“position”: [
600,
300
]
},
{
“parameters”: {
“requestMethod”: “POST”,
“url”: “https://api.monday.com/v2/file”,
“jsonParameters”: true,
“options”: {
“bodyContentType”: “multipart-form-data”
},
“sendBinaryData”: true,
“headerParametersJson”: “{ “Authorization” : “removed” }”,
“queryParametersJson”: “{ “item_id” : “2678513724”, “column_id” : “archivo0” }”
},
“name”: “HTTP Request”,
“type”: “n8n-nodes-base.httpRequest”,
“typeVersion”: 1,
“position”: [
780,
300
]
}
],
“connections”: {
“Webhook”: {
“main”: [
[
{
“node”: “HTTP Request1”,
“type”: “main”,
“index”: 0
}
]
]
},
“HTTP Request1”: {
“main”: [
[
{
“node”: “HTTP Request”,
“type”: “main”,
“index”: 0
}
]
]
}
}
}>

Hey @edego878,

I have removed the JWT from your post :+1: it might be worth using the format option we provide as looking at your workflow to do anything with it we will have to place a lot of characters as it won’t import.

When you run your workflow does it give you any errors?

Thank you very much Jon :+1:

So, first I receive a document from a pdf creator web page webhook. Then I download the pdf data through the download URL and get the binary file.

Once I have the binary file, I send a Post request through http node and I get a 400 error {“error_message”:“Unsupported query”,“status_code”:400}".

How can you structure a post request to upload a file to monday.com?

According to monday.com library, this is the way in GraphQl:

mutation {
add_file_to_column (item_id: 143, column_id: ‘files_03’, $file: File!) {
id
}
}

And this would be the way in cURL:

curl --location --request POST ‘https://api.monday.com/v2/file
–header ‘Authorization: YourSuperSecretAPIKey’
–form ‘query=“mutation add_file($file: File!, $item_id: Int!, $column_id: String!) {add_file_to_column (item_id: $item_id, column_id: $column_id, file: $file) {id}}”’
–form ‘variables="{“item_id”:1104589438, “column_id”: “files”}"’
–form ‘map="{“image”:“variables.file”}"’
–form ‘[email protected]"/Users/alexsavchuk/Downloads/300px-All_Right_Then,_Keep_Your_Secrets.jpg"’