Akd v0.3.1 FreshbooksApiClient.Api View Source

This is an Example API (that can also be used to get started). If you have a need for multiple API credentials, you can create one API module per domain.

See the FreshbooksApiClient.ApiBase for available methods.

Configuration:

config :freshbooks_api_client, FreshbooksApiClient.Api,

caller: FreshbooksApiClient.Caller.HttpXml,
token: System.get_env("FRESHBOOKS_API_TOKEN"),
subdomain: System.get_env("FRESHBOOKS_API_SUBDOMAIN")

(prod.exs) config :freshbooks_api_client, FreshbooksApiClient.Api,

caller: FreshbooksApiClient.Caller.HttpXml,
load_from_system_env: true

NOTE: In Production (with runtime configuration) you must call FreshbooksApiClient.Api.init() before using the client. A Supervisor is a great place to do that! For example:

defmodule YourApplication.Supervisor do

use Supervisor

def start_link(opts) do
  Supervisor.start_link(__MODULE__, ..., opts)
end

def init(...) do
  FreshbooksApiClient.Api.init()

  children = [
    ...
  ]

  Supervisor.init(children, strategy: :one_for_one)
end

end

Usage:

FreshbooksApiClient.Api.list(FreshbooksApiClient.Interface.Clients)

Link to this section Summary

Link to this section Functions

Link to this function config(key, default \\ nil) View Source
Link to this function create(interface, params) View Source
Link to this function delete(interface, params) View Source
Link to this function list(interface, params \\ []) View Source
Link to this function update(interface, params) View Source