I’ve been looking at the Files column type, and see that for external files hosted in say Google Drive, Box, Dropbox or Sharepoint, the files are described by a stringified version of the structure below:
{
"files": [
{
"name": "Book.xlsx",
"fileId": "c42b3230-42b3-42b3-42b3-9d6f7b2a081b",
"fileType": "ONE_DRIVE",
"createdAt": 1234,
"createdBy": "456",
"linkToFile": "https://someinstance-my.sharepoint.com/:x:/g/personal/username_someinstance_onmicrosoft_com/PlkJXFVMWpEV2cVApxt_H_EB6GH1viK96wa1-rEqGKjmpw"
},
...
]
}
What mutation would be required to add a file from an external provider such as Google Drive, Box, Dropbox or Sharepoint to a column?
This is not the normal “upload a file” mutation as described here by:
mutation {
add_file_to_column (
item_id: 1234567890,
column_id: "files",
file: YOUR_FILE
) {
id
}
}
or
curl --location 'https://api.monday.com/v2/file' \
--header 'API-Version: 2024-01' \
--header 'Authorization: thisisasecret' \
--form 'query="mutation($item_id: ID!, $column_id: String!, $file: File!) { add_file_to_column(item_id: $item_id, column_id: $column_id, file: $file) { id } }"' \
--form 'variables="{\"item_id\": 123456, \"column_id\": \"files\"}"' \
--form 'map="{\"file\":\"variables.file\"}"' \
--form 'file=@/Users/me/Pictures/MyCat.png'
It looks to be different, but is not documented anywhere I can see.
.
.
.
Aside: I’m seeing a 404 on the documentation examples here:
https://developer.monday.com/api-reference/changelog/add_file_to_column-mutation
It points to this:
https://developer.monday.com/api-reference/docs/columns-queries-1#add-a-file-to-the-file-column
…rather than this:
https://developer.monday.com/api-reference/reference/assets-1#add-file-to-the-file-column