Comments
Complete reference for comment-related methods and models.
Methods
post_comment
post_comment(
document_id: str,
content: str,
file_ids: List[str] = None,
reply_to: str = None
) -> PostCommentResponse
Post a comment to a document.
Parameters:
document_id- Document ID to comment oncontent- Comment content (HTML supported)file_ids- Optional list of file IDs to attachreply_to- Optional parent comment ID for replies
Returns: PostCommentResponse with created comment
get_comments
get_comments(document_id: str) -> GetCommentsResponse
Get all comments for a document.
Parameters:
document_id- Document ID
Returns: GetCommentsResponse with list of comments
edit_comment
edit_comment(
comment_id: str,
content: str,
add_file_ids: List[str] = None,
order_file_ids: List[str] = None,
remove_file_ids: List[str] = None
) -> EditCommentResponse
Edit comment content and manage files.
Parameters:
comment_id- Comment ID to editcontent- New contentadd_file_ids- Files to addorder_file_ids- New file orderremove_file_ids- Files to remove
Returns: EditCommentResponse with updated comment
delete_comment
delete_comment(comment_id: str) -> DeleteCommentResponse
Soft delete a comment.
Parameters:
comment_id- Comment ID to delete
Returns: DeleteCommentResponse with deleted comment
add_reaction
add_reaction(
comment_id: str,
reaction: CommentReactionType
) -> ReactToCommentResponse
Add a popular emoji reaction.
Parameters:
comment_id- Comment IDreaction- Reaction type (THUMBS_UP, HEART, etc.)
Returns: ReactToCommentResponse with reactions
react_to_comment
react_to_comment(
comment_id: str,
emoji_id: str,
emoji_name: str,
emoji_native: str,
emoji_unified: str,
emoji_keywords: List[str] = None,
emoji_shortcodes: str = None
) -> ReactToCommentResponse
Add custom emoji reaction.
Parameters:
comment_id- Comment IDemoji_id- Emoji identifieremoji_name- Human-readable nameemoji_native- Emoji character (e.g., "😙")emoji_unified- Unicode code (e.g., "1f619")emoji_keywords- Search keywordsemoji_shortcodes- Shortcode (e.g., "😄")
Returns: ReactToCommentResponse with reactions
Models
Comment
Main comment model representing a comment in the system.
class Comment:
id: str # Comment ID
content: str # HTML content
author_id: str # Author user ID
document_id: str # Document ID
created_at: datetime # Creation timestamp
updated_at: datetime # Last update timestamp
edited_at: Optional[datetime] # Edit timestamp
deleted_at: Optional[datetime] # Deletion timestamp
reply_to: Optional[str] # Parent comment ID
files: List[UploadedFile] # Attached files
reactions: List[CommentReaction] # Reactions
has_removed_files: bool # Whether files were removed
CommentReaction
class CommentReaction:
reaction_db_id: str # Reaction database ID
emoji_id: str # Emoji ID
native: Optional[str] # Emoji character
member_ids: List[str] # Members who reacted
Request Models
PostCommentRequest
class PostCommentRequest:
document_id: str # Required - Document ID
content: str # Required - Comment content (HTML)
file_ids: List[str] # File IDs to attach
reply_to: Optional[str] # Parent comment ID for replies
GetCommentsRequest
class GetCommentsRequest:
document_id: str # Required - Document ID
EditCommentRequest
class EditCommentRequest:
comment_id: str # Required - Comment ID
content: str # Required - New comment content (HTML)
add_file_ids: List[str] # File IDs to add
order_file_ids: List[str] # Order of file IDs
remove_file_ids: List[str] # File IDs to remove
DeleteCommentRequest
class DeleteCommentRequest:
comment_id: str # Required - Comment ID to delete
ReactToCommentRequest
class ReactToCommentRequest:
comment_id: str # Required - Comment ID
id: str # Required - Emoji ID (e.g., "kissing_smiling_eyes")
name: str # Required - Human readable name
native: str # Required - Emoji character (e.g., "😙")
unified: str # Required - Unicode codepoint (e.g., "1f619")
keywords: List[str] # Keywords for the emoji
shortcodes: str # Required - Shortcode (e.g., ":kissing_smiling_eyes:")
Response Models
PostCommentResponse
class PostCommentResponse:
type: str # Response type ("PostComment")
payload: Dict[str, Comment] # Response payload
@property
def comment(self) -> Comment: # Convenience property
...
GetCommentsResponse
class GetCommentsResponse:
type: str # Response type ("GetComments")
payload: Dict[str, List[Comment]] # Response payload
@property
def comments(self) -> List[Comment]: # Convenience property
...
EditCommentResponse
class EditCommentResponse:
type: str # Response type ("EditComment")
payload: Dict[str, Comment] # Response payload
@property
def comment(self) -> Comment: # Convenience property
...
DeleteCommentResponse
class DeleteCommentResponse:
type: str # Response type ("DeleteComment")
payload: Dict[str, Comment] # Response payload
@property
def comment(self) -> Comment: # Convenience property
...
ReactToCommentResponse
class ReactToCommentResponse:
type: str # Response type ("ReactToComment")
payload: Dict[str, List[CommentReaction]] # Response payload
@property
def reactions(self) -> List[CommentReaction]: # Convenience property
...
See Also
- Comments Guide - Usage examples and patterns
- Enums - CommentReactionType and other enums
- Files - File attachment methods