View source: R/getAuthenticationToken.R
| getAuthenticationToken | R Documentation |
Authenticates a user to a DistillerSR instance using a personal access key. The function returns a valid authentication token that can be used to access protected DistillerSR API endpoints.
getAuthenticationToken(
distillerInstanceUrl = Sys.getenv("DISTILLER_INSTANCE_URL"),
distillerKey = Sys.getenv("DISTILLER_API_KEY"),
timeout = 1800
)
distillerInstanceUrl |
By default: Sys.getenv("DISTILLER_INSTANCE_URL"). |
distillerKey |
By default: Sys.getenv("DISTILLER_API_KEY"). |
timeout |
By default: 1800 seconds (30 minutes). |
By default, the personal access key and the instance URL are read from the
environment variables DISTILLER_API_KEY and DISTILLER_INSTANCE_URL.
A string containing a valid DistillerSR authentication token.
## Not run:
# If 'DISTILLER_INSTANCE_URL' and 'DISTILLER_API_KEY' are defined in your
# environment (e.g. .Renviron).
distillerToken_ <- getAuthenticationToken()
# If 'distillerInstanceUrl' and 'distillerKey' are to be specified manually.
distillerToken_ <- getAuthenticationToken(
distillerInstanceUrl = "https://url.to.distiller.instance",
distillerKey = "YOUR_API_KEY")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.