wcPOST | R Documentation |
wcPOST
returns a response from a POST to the API
wcPOST(
wc.key = Sys.getenv("WCACCESSKEY"),
wc.secret = Sys.getenv("WCSECRETKEY"),
keyfile = NULL,
params = "action=get_deployments"
)
wc.key |
public access key (default retrieves from option value set in .Renviron) |
wc.secret |
secret access key (default retrieves from option value set in .Renviron) |
keyfile |
path to a json formatted keyfile with WCACCESSKEY and WCSECRETKEY |
params |
POST message (default returns a list of deployments) |
This function provides basic access to the API via POST. The params
value contains the
string to include in the body of the POST. The default action is to return a list of deployments
associated with your account . Most users will likely not call this function directly, but
instead, rely on other helper/wrapper functions within the package.
The Wildlife Computers Data Portal API uses a form of keyed-hash message authentication code for
secure access. Your 'Access Key' and 'Secret Key' can be obtained from the data portal website
(Account Settings > Web Services Security). For security reasons you should NOT include the keys
as plain text in any scripts. Instead, include the key values as within your
.Renviron
.
an httr
response object is returned. Content of the response can be obtained with
the httr::content()
function.
This option is a preferred option for storing keys,
passwords and other sensitive values. Your .Renviron
should be secured via OS
security/permissions (e.g. on Linux/OS X .Renviron
is stored within the home directory
which is only accessible by an authorized user. However, you should not share your
.Renviron
or include your .Renviron
in version control (e.g. git) if you use this
option. An alternative is to read values from a different file in the home directory or to use
OS level environment variables.
preformatted WCACCESSKEY = 'E4iZhsfdje7590JDNR/VARTEZyhfwb84485X5Xw86ow=' WCSECRETKEY = 'WIRJFYhfjdsuSEqKoE7WSDvXUHzVP0pHDJSscmeA7fw='
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.