View source: R/webservice_functions.R
token_ws | R Documentation |
Request a token from the Environment and Climate Change Canada [EXPERIMENTAL]
token_ws(username = NULL, password = NULL)
username |
Supplied by ECCC. Defaults to NULL which will use WS_USRNM from .Renviron file |
password |
Supplied by ECCC. Defaults to NULL which will use WS_PWD from .Renviron file Request a token from the ECCC web service using the POST method. This token expires after 10 minutes. You can only have 5 tokens out at once. |
The username
and password
should be treated carefully and should never be entered directly into an r script or console.
Rather these credentials should be stored in your .Renviron
file. The .Renviron file can edited using file.edit("~/.Renviron")
.
In that file, which is only stored locally and is only available to you, you can assign your username
to WS_USRNM and password
to WS_PWD and then simply issue token_ws
. See ?realtime_ws
for examples.
The token as a string that should be supplied the realtime_ws
function.
Other realtime functions:
realtime_ws()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.