zz_get {zzlite} | R Documentation |
Get file from Zamzar account
Description
Get file from Zamzar account provided a file id. Per default ‘zz_get()' assumes that you’re doing development, thus using a development endpoint. Set prod boolean to 'TRUE' to change this behavior.
Usage
zz_get(
id = NULL,
usr = NULL,
name = NULL,
extension = NULL,
overwrite = FALSE,
prod = FALSE
)
Arguments
id |
The target id for a previously passed file. Most likely returned from 'zz_get_info()'. |
usr |
The username/API key you are using. If not set, the function will check if a key exists as a 'ZAMZAR_USR' variable in '.Renviron' and use that. |
name |
The name of the file you are fetching from Zamzar. If a name is not assigned to the file, then the id of the file will be used as file name. |
extension |
The extension of the file you are fetching from Zamzar. |
overwrite |
Should 'zz_get()' overwrite if a file with the same name already exists in directory. Defaults to 'FALSE'. |
prod |
Boolean deciding whether to use a production endpoint or a development endpoint. Defaults to FALSE (That is, development endpoint). |
Details
On differences between endpoints, see: https://developers.zamzar.com/docs#section-Next_steps and https://developers.zamzar.com/docs#section-Rate_Limits
Please note that a Zamzar key passed as argument to 'usr' takes precedence over a Zamzar key extracted from an '.Renviron'.
Value
A file written to disk.
Examples
## Not run:
# An example of zz_get() utilized with hardcoded arguments
zz_get(id = 12345678, usr = "key", name = "my_avatar", extension = "png")
# An example of zz_get() used in conjunction with zz_get_info()
# Please note this example assumes a valid key in .Renviron
response <- zz_get_info(latest = TRUE)
zz_get(id = response$id, extension = response$extension, prod = TRUE)
## End(Not run)