token_ws: Request a token from the Environment and Climate Change...

View source: R/webservice_functions.R

token_wsR Documentation

Request a token from the Environment and Climate Change Canada [EXPERIMENTAL]

Description

Request a token from the Environment and Climate Change Canada [EXPERIMENTAL]

Usage

token_ws(username = NULL, password = NULL)

Arguments

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.

Details

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.

Value

The token as a string that should be supplied the realtime_ws function.

See Also

Other realtime functions: realtime_ws()


bcgov/tidyhydat.ws documentation built on June 2, 2025, 5:06 a.m.