Use these functions to create and get comments for Box files.

box_comment_create(file_id = NULL, message, comment_id = NULL)

box_comment_get(file_id)

Arguments

file_id

numeric or character, file ID at Box.

message

character contents of comment. Note: tagging people with the @user pattern is not yet supported.

comment_id

numeric or character, comment ID at Box.

Value

box_comment_create()

Object with S3 class boxr_comment.

box_comment_get()

Object with S3 class boxr_comment_list.

Details

When you create a comment using box_comment_create(), you have to specify a file_id or a comment_id. If you specify a comment_id, the comment will be posted as a reply to that comment.

Use box_comment_get() to retrieve comments in bulk. This gets all the comments associated with a file, thus you can specify only a file_id.

Examples

if (FALSE) {
  file_id <- 12345
  
  # create comments
  x <- box_comment_create(file_id, "Report is ready.")
  box_comment_create(comment_id = x$id, message = "Response to a comment")
  
  # get comments
  box_comment_get(file_id)
}