| CommentsEndpoint | R Documentation |
Handle all comments operations in the Notion API
Note: Access this endpoint through the client instance, e.g., notion$comments. Not to be instantiated directly.
A list containing the parsed API response.
new()Initialise comments endpoint.
Not to be called directly, e.g., use notion$comments instead.
CommentsEndpoint$new(client)
clientNotion Client instance
create()Create a comment
CommentsEndpoint$create( rich_text, parent = NULL, discussion_id = NULL, attachments = NULL, display_name = NULL )
rich_textList of lists (JSON array) (required). Rich text object(s) representing the content of the comment.
parentList (JSON object). The parent of the comment. This can be a page or a block.
Required if discussion_id is not provided.
discussion_idCharacter. The ID of the discussion to comment on.
Required if parent is not provided.
attachmentsList of lists (JSON array). An array of files to attach to the comment. Maximum of 3 allowed.
display_nameNamed list (JSON object). Display name for the comment.
retrieve()Retrieve comments for a block
CommentsEndpoint$retrieve(comment_id)
comment_idCharacter (required). The ID of the comment to retrieve.
list()List comments
CommentsEndpoint$list(block_id, start_cursor = NULL, page_size = NULL)
block_idCharacter (required). The ID for a Notion block or page.
start_cursorCharacter. For pagination. If provided, returns results starting from this cursor. If NULL, returns the first page of results.
page_sizeInteger. Number of items to return per page (1-100). Defaults to 100.
notion <- notion_client()
# ----- Create comment
notion$comments$create(
parent = list(
page_id = "34033ea0-c1e4-81c4-afa0-d1ec98de4bec"
),
rich_text = list(
list(
text = list(
content = "Hello world!"
)
)
)
)
# ----- Retrieve comment
notion$comments$retrieve("34033ea0-c1e4-8193-a220-001d29ae83c5")
# ----- List un-resolved comments from a page or block
notion$comments$list("34033ea0-c1e4-81c4-afa0-d1ec98de4bec")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.