CommentsManager
June 20, 2025 ยท View on GitHub
List file comments
Retrieves a list of comments for a file.
This operation is performed by calling function get_file_comments.
See the endpoint docs at API Reference.
client.comments.get_file_comments(file_id)
Arguments
- file_id
str- The unique identifier that represents a file. The ID for any file can be determined by visiting a file in the web application and copying the ID from the URL. For example, for the URL
https://*.app.box.com/files/123thefile_idis123. Example: "12345"
- The unique identifier that represents a file. The ID for any file can be determined by visiting a file in the web application and copying the ID from the URL. For example, for the URL
- fields
Optional[List[str]]- A comma-separated list of attributes to include in the response. This can be used to request fields that are not normally returned in a standard response. Be aware that specifying this parameter will have the effect that none of the standard fields are returned in the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested.
- limit
Optional[int]- The maximum number of items to return per page.
- offset
Optional[int]- The offset of the item at which to begin the response. Queries with offset parameter value exceeding 10000 will be rejected with a 400 response.
- extra_headers
Optional[Dict[str, Optional[str]]]- Extra headers that will be included in the HTTP request.
Returns
This function returns a value of type Comments.
Returns a collection of comment objects. If there are no comments on this file an empty collection will be returned.
Get comment
Retrieves the message and metadata for a specific comment, as well as information on the user who created the comment.
This operation is performed by calling function get_comment_by_id.
See the endpoint docs at API Reference.
client.comments.get_comment_by_id(new_comment.id)
Arguments
- comment_id
str- The ID of the comment. Example: "12345"
- fields
Optional[List[str]]- A comma-separated list of attributes to include in the response. This can be used to request fields that are not normally returned in a standard response. Be aware that specifying this parameter will have the effect that none of the standard fields are returned in the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested.
- extra_headers
Optional[Dict[str, Optional[str]]]- Extra headers that will be included in the HTTP request.
Returns
This function returns a value of type CommentFull.
Returns a full comment object.
Update comment
Update the message of a comment.
This operation is performed by calling function update_comment_by_id.
See the endpoint docs at API Reference.
client.comments.update_comment_by_id(new_reply_comment.id, message=new_message)
Arguments
- comment_id
str- The ID of the comment. Example: "12345"
- message
Optional[str]- The text of the comment to update.
- fields
Optional[List[str]]- A comma-separated list of attributes to include in the response. This can be used to request fields that are not normally returned in a standard response. Be aware that specifying this parameter will have the effect that none of the standard fields are returned in the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested.
- extra_headers
Optional[Dict[str, Optional[str]]]- Extra headers that will be included in the HTTP request.
Returns
This function returns a value of type CommentFull.
Returns the updated comment object.
Remove comment
Permanently deletes a comment.
This operation is performed by calling function delete_comment_by_id.
See the endpoint docs at API Reference.
client.comments.delete_comment_by_id(new_comment.id)
Arguments
- comment_id
str- The ID of the comment. Example: "12345"
- extra_headers
Optional[Dict[str, Optional[str]]]- Extra headers that will be included in the HTTP request.
Returns
This function returns a value of type None.
Returns an empty response when the comment has been deleted.
Create comment
Adds a comment by the user to a specific file, or as a reply to an other comment.
This operation is performed by calling function create_comment.
See the endpoint docs at API Reference.
client.comments.create_comment(
message, CreateCommentItem(id=file_id, type=CreateCommentItemTypeField.FILE)
)
Arguments
- message
str- The text of the comment. To mention a user, use the
tagged_messageparameter instead.
- The text of the comment. To mention a user, use the
- tagged_message
Optional[str]- The text of the comment, including
@[user_id:name]somewhere in the message to mention another user, which will send them an email notification, letting them know they have been mentioned. Theuser_idis the target user's ID, where thenamecan be any custom phrase. In the Box UI this name will link to the user's profile. If you are not mentioning another user, usemessageinstead.
- The text of the comment, including
- item
CreateCommentItem- The item to attach the comment to.
- fields
Optional[List[str]]- A comma-separated list of attributes to include in the response. This can be used to request fields that are not normally returned in a standard response. Be aware that specifying this parameter will have the effect that none of the standard fields are returned in the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested.
- extra_headers
Optional[Dict[str, Optional[str]]]- Extra headers that will be included in the HTTP request.
Returns
This function returns a value of type CommentFull.
Returns the newly created comment object.
Not all available fields are returned by default. Use the fields query parameter to explicitly request any specific fields.