confl_attachment {conflr}R Documentation

CRUD Operations for Attachments on Content

Description

CRUD Operations for Attachments on Content

Usage

confl_list_attachments(
  id,
  filename = NULL,
  mediaType = NULL,
  start = 0,
  limit = 50,
  expand = NULL
)

confl_post_attachment(id, path)

confl_update_attachment_metadata(id, attachmentId, ...)

confl_update_attachment_data(id, attachmentId, path, ...)

Arguments

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. ⁠body.storage,history⁠).

path

Path to a file to upload.

attachmentId

The ID of an attachment.

...

Other arguments passed to 'query'.

Value

The API response as a list.

Examples

## Not run: 
# 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

## End(Not run)


[Package conflr version 0.1.1 Index]