Junex.Auth.HTTP (Junex v0.1.0) View Source

Exposes the get_access_token function, to get the needed token to make all other requests

Link to this section Summary

Functions

Return a access_token to be used on other Junex requests

Link to this section Functions

Link to this function

get_access_token(client_id, client_secret, mode)

View Source

Specs

get_access_token(String.t(), String.t(), atom()) ::
  {:ok, String.t()} | {:error, atom() | {atom(), atom()}}

Return a access_token to be used on other Junex requests

You can get the client_id and client_secret on the Integration section on your Juno account and generate the pair!

Parameters

  • client_id: string
  • client_secret: string
  • mode: :prod | :sandbox

Examples

iex> Junex.Auth.get_access_token("client_id", "client_secret", true) {:error, {:unauthenticated, :wrong_credentials}}