
Get a valid token for Plug API
plug_get_valid_token.RdThis function checks if a valid global token exists for the Plug API. If no valid token is found,
it generates a new token using the stored global credentials by sending a properly formatted request.
If it fails to retrieve the token (for example, due to missing credentials or network issues),
it will not throw an error but will display a message in English ("No valid credentials found.") and return NULL.
Usage
plug_get_valid_token(
validity_time = 3600,
endpoint = "https://plug.der.pe.gov.br/MadrixApi/authenticate/"
)