IBM Speech to Text v0.3.0 IBMSpeechToText.Token View Source
This module provides a way to get IAM tokens used for authenticated requests to IBM Cloud Services
Link to this section Summary
Functions
Creates "Authorization" header using token that can be used when making requests to IBM Cloud Service API
Gets access token for the given IAM API key
Checks if the token should be refreshed
Link to this section Types
Link to this type
t()
View Source
t()
View Source
t() :: %IBMSpeechToText.Token{
expiration: non_neg_integer(),
scope: String.t(),
token: String.t(),
type: String.t()
}
t() :: %IBMSpeechToText.Token{ expiration: non_neg_integer(), scope: String.t(), token: String.t(), type: String.t() }
Link to this section Functions
Link to this function
auth_header(token)
View Source
auth_header(token)
View Source
auth_header(IBMSpeechToText.Token.t()) :: {String.t(), iodata()}
auth_header(IBMSpeechToText.Token.t()) :: {String.t(), iodata()}
Creates "Authorization" header using token that can be used when making requests to IBM Cloud Service API
Link to this function
get(api_key \\ System.get_env("SPEECH_TO_TEXT_IAM_APIKEY")) View Source
Gets access token for the given IAM API key
If the API key is not provided, it is taken from environment variable
SPEECH_TO_TEXT_IAM_APIKEY
More info on tokens and authentication can be found here
Link to this function
should_refresh?(token) View Source
Checks if the token should be refreshed