Hey !
I wanted to point out an issue in the Assets upload api documentation that I’ve encountered while building an integration.
Specifically in this section
In the graphQL and curl example, it is mentioned to use “files” for the column_id
However using this column_id will result in a 500 error
curl --location 'https://api.monday.com/v2/file' \\
--header 'Authorization: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' \\
--header 'API-version: 2023-10' \\
--form 'query="mutation ($file: File!) {
add_file_to_column (file: $file, item_id: 7655999011, column_id: \\"files\\") {id}}"' \\
--form 'map="{\\"image\\":\\"variables.file\\"}
"' \\
--form 'image=@"/Users/sylvainb/downloads/large-marc.jpg"'
{"status_code":500,"error_message":"Internal server error","error_code":"INTERNAL_SERVER_ERROR"}%
Despite that error code, the file is still being uploaded to the file, however on top of throwing an error in my code, it prevents me from getting the id of the asset that was uploaded.
In order to circumvent this issue, I inspected the network calls of the webapp and realized that it was using the “files__1” for the column_id.
This solution was successfull:
curl --location 'https://api.monday.com/v2/file' \\
--header 'Authorization:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' \\
--header 'API-version: 2023-10' \\
--form 'query="mutation ($file: File!) {
add_file_to_column (file: $file, item_id: 7655999011, column_id: \\"files__1\\") {id}}"' \\
--form 'map="{\\"image\\":\\"variables.file\\"}
"' \\
--form 'image=@"/Users/sylvainb/downloads/large-marc.jpg"'
{"data":{"add_file_to_column":{"id":"1735828653"}},"account_id":6498124}%
Later i found out that this column_id was mentioned in the python example of the doc 🙂
Thank you !
PS: The postman template also has this error.