CRUD Operations for Attachments on Content
confl_list_attachments( id, filename = NULL, mediaType = NULL, start = 0, limit = 50, expand = NULL ) confl_post_attachment(id, path, minor_edit = FALSE) confl_update_attachment_metadata(id, attachmentId, ...) confl_update_attachment_data(id, attachmentId, path, ..., minor_edit = FALSE)
id | The ID of a page that attachments belong to. |
---|---|
filename | Filter parameter to return only the Attachment with the matching file name. Optional. |
mediaType | Filter parameter to return only Attachments with a matching Media-Type. Optional. |
start | The start point of the collection to return. |
limit | The limit of the number of items to return, this may be restricted by fixed system limits. |
expand | A comma separated list of properties to expand. To refer the nested
contents, use periods. (e.g. |
path | Path to a file to upload. |
minor_edit | If |
attachmentId | The ID of an attachment. |
... | Other arguments passed to 'query'. |
The API response as a list.
if (FALSE) { # Create a dummy text file tmp_txt <- tempfile(fileext = ".txt") cat("foo", file = tmp_txt) # Upload the file to a page whose ID is "123" confl_post_attachment("123", tmp_txt) # Confirm the file is attatched to the page result <- confl_list_attachments("123", filename = basename(tmp_txt)) length(result$results) # should be 1 }