confl_attachment: CRUD Operations for Attachments on Content

Description Usage Arguments Value Examples

Description

CRUD Operations for Attachments on Content

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## 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)

conflr documentation built on April 14, 2020, 7:04 p.m.