get_token: Generate a token from the TB DEPOT tidy API

View source: R/setup.R

get_tokenR Documentation

Generate a token from the TB DEPOT tidy API

Description

get_token is a function that retrieves a token string from the API that is required as part of submitting a correct tidy_depot_api request in the token parameter.

Usage

get_token(email_address = get_secret_email(), secret = get_secret())

Arguments

email_address

email address associated with secret

secret

secret used for generating API token

Details

get_token should work as a function call without having to pass any user parameters provided the user has correctly run store_secret_credentials to save these credentials locally in an .Renviron file. get_token will then use that information to request a token string from the API and return this string. The string can then be used for the tidy_depot_api function int he token parameter to request data and validate the user's credentials.

Value

The token string used for Authentication header in API calls

Author(s)

Gabriel Rosenfeld, gabriel.rosenfeld@nih.gov


niaid/tbportals.depot.api documentation built on Feb. 22, 2025, 5:41 p.m.