nettskjema_save_attachment: Save Nettskjema attachments to file

View source: R/nettskjema-attachments.R

nettskjema_save_attachmentR Documentation

Save Nettskjema attachments to file

Description

The Nettskjema forms has an option to upload attachments with forms. These can be retrieved by this function. Recommended workflow is to first call nettskjema_list_attachments, and use the output of this to pass along to the function. This function is called by nettskjema_get_form_attachments, but you can use it to define your own output file names.

Usage

nettskjema_save_attachment(path, output, token_name, ...)

Arguments

path

Nettskjema API path where the attachment is

output

output file name

token_name

character. Name to give the token, defaults to 'NETTSKJEMA_API_TOKEN'

...

arguments passed to GET

Value

nothing. saves attachments to file.

Examples

## Not run: 
submission_id <- c(22222, 1232, 21555)
attach_dt <- nettskjema_list_attachments(submission_id)
nettskjema_save_attachment(path = attach_dt$path, output = attach_dt$standardized)

## End(Not run)

LCBC-UiO/nettskjemar documentation built on Aug. 24, 2023, 5:44 p.m.