Files Methods

Method Name Method Type Description
get_assets(item_id) Getter Retrieves assets (files) associated with an item.
upload_file_to_column(item_id, column_id, filepath) Setter Uploads a local file to a file column.
add_file_to_update(update_id, file_path) Setter Uploads a local file to an update.

Method Details

get_assets()

get_assets(item_id)

Description: Retrieves assets (files) associated with an item.

Arguments:

  • item_id (int): The ID of the item.

Returns: List of dictionaries containing asset data. Returns None or a full error message if the request fails.

Example:

assets = monday.files.get_assets(1234567890)

upload_file_to_column()

upload_file_to_column(item_id, column_id, filepath)

Description: Uploads a local file to a file-type column of an item.

Arguments:

  • item_id (int): The ID of the item.
  • column_id (str): The column ID where the file will be uploaded.
  • filepath (str): The absolute path to the file on the local system.

Returns: UUID of the asset. Returns None or a full error message if the request fails.

Example:

file_id = monday.files.upload_file_to_column(1234567890, "file_column", "/path/to/file.pdf")

add_file_to_update()

add_file_to_update(update_id, file_path)

Description: Uploads a local file to an update.

Arguments:

  • update_id (int): The ID of the update.
  • file_path (str): The absolute path to the local file.

Returns: UUID of the asset. Returns None or a full error message if the request fails.

Example:

file_id = monday.files.add_file_to_update(987654321, "/path/to/file.pdf")