Added support for uploading file into an item's column #36
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🎯 Summary
This PR adds the ability to upload files to file columns on monday.com items using the SDK. It implements the
multipart/form-dataupload mechanism required by the Monday.com file upload API.✨ Changes
New Features
ItemModule.upload_file_to_column()- New method to upload files to a file column on an itemMondayGraphQL.execute_multipart()- New method for executing GraphQL mutations with file uploads using multipart/form-dataFileInputdataclass - New type for encapsulating file upload parametersImplementation Details
FILE_UPLOAD_URL = "https://api.monday.com/v2/file")FileNotFoundErrorfor missing files📦 Files Changed
src/monday_sdk/modules/items.pyupload_file_to_column()methodsrc/monday_sdk/graphql_handler.pyexecute_multipart()methodsrc/monday_sdk/types/file_input.pyFileInputdataclasssrc/monday_sdk/types/__init__.pyFileInputsrc/monday_sdk/constants.pyFILE_UPLOAD_URLconstant📖 Usage Example
🔧 API Response
The
upload_file_to_column()method returns a dictionary containing the uploaded asset information:{ "data": { "add_file_to_column": { "id": "123456789", "name": "file.mp4", "url": "https://files.monday.com/...", "file_extension": "mp4", "file_size": 1048576 } } }/v2/file) than other SDK methodsboard_idis not required for file uploads - onlyitem_idandcolumn_id