RingCentral.OAuth.get_token
You're seeing just the function
get_token
, go back to RingCentral.OAuth module for more information.
Specs
get_token(RingCentral.t(), map()) :: {:error, RingCentral.Error.t()} | {:ok, String.t()}
Get the access token and refresh token.
params
is a map contains the options described in
the official documentation
Example
ringcentral = %RingCentral{
client_id: "the-client-id",
client_secret: "the-client-secret",
http_client: RingCentral.HTTPClient.DefaultClient,
server_url: "https://platform.ringcentral.com",
token_info: nil
}
{:ok, token_info} = RingCentral.OAuth.get_token(ringcentral, %{
grant_type: "authorization_code",
code: "U0pDMDFQMDRQQVMwMnxBQUFGTVUyYURGYi0wUEhEZ2VLeGFiamFvZlNMQlZ5TExBUHBlZVpTSVlhWk",
redirect_uri: "https://ringcentral-elixir.test"
})
# {:ok, %{"access_token": "...", "token_type": "bearer", "refresh_token": "..."}}