BexioApiClient (bexio_api_client v0.2.17)

Base Module for the API Client.

The API Documentation for Bexio can be found under https://docs.bexio.com.

Fields or arguments with date time reference expect them in the time zone Europe/Zurich.

requirements

Requirements:

  • Tesla: the api client depends on Tesla. Every API call needs an instance of a Tesla.Client to be able to do the rest calls.any()

Link to this section Summary

Functions

Fetch a new access token for the given refresh token.

Create Tesla API Client.

Link to this section Functions

Link to this function

access_token(refresh_token, client_id, client_secret, adapter \\ nil)

@spec access_token(String.t(), String.t(), String.t(), any()) ::
  {:ok, map()} | {:error, any()}

Fetch a new access token for the given refresh token.

arguments

Arguments:

  • refresh_token -> the refresh token we need the access key for
  • client_id -> the client id of our application that also got the refresh token
  • client_secret -> the client secret of our application

response

Response

}

Link to this function

new(api_token, opts \\ [])

@spec new(
  String.t(),
  keyword()
) :: Tesla.Client.t()

Create Tesla API Client.

This must be given a token from https://office.bexio.com/admin/apiTokens#/ which will then be used as bearer token. The client can then be used everywhere where it's useful.

It also allows an optional setup for retrying to allow to limit if needed. The defaults are listed below:

options

Options:

  • :delay - Initial Delay for Backoff (Default: 500)
  • :max_retries - Maximal number of retries (Default: 10)
  • :max_delay - Maximal delay between requests (Default: 4_000)
  • :log_level - Log Level for Requests (Default: :info)
  • :debug - whether to include debug information (Default: false)
  • :adapter - Which adapter to use (Defalt: nil, recommended one with SSL support like Hackney)