Skip to contents

[Stable]

Usage

attachment_url(
  uuid,
  fn,
  pid = get_default_pid(),
  fid = get_default_fid(),
  url = get_default_url()
)

Arguments

uuid

The UUID of one form submission, or a vector of UUIDs.

fn

The attachment filename, as per ODK form submission, or a vector of attachment filenames.

pid

The numeric ID of the project, e.g.: 2.

Default: get_default_pid.

Set default pid through ru_setup(pid="...").

See vignette("Setup", package = "ruODK").

fid

The alphanumeric form ID, e.g. "build_Spotlighting-0-8_1559885147".

Default: get_default_fid.

Set default fid through ru_setup(fid="...").

See vignette("Setup", package = "ruODK").

url

The ODK Central base URL without trailing slash.

Default: get_default_url.

Set default url through ru_setup(url="...").

See vignette("Setup", package = "ruODK").

Value

The inferred download URL.

Details

This is a helper function used by attachment_get. This function is vectorised and accepts single values or vectors for uuid and fn.

Examples

# See vignette("setup") for setup and authentication options
# ruODK::ru_setup(svc = "....svc", un = "me@email.com", pw = "...")

ruODK:::attachment_url(
  "uuid:d3bcefea",
  "filename.jpg",
  pid = 1,
  fid = "form1",
  url = "https://my.odkcentral.org"
)
#> https://my.odkcentral.org/v1/projects/1/forms/form1/submissions/uuid:d3bcefea/attachments/filename.jpg