Skip to content

mrmstn/open-xchange-client

Repository files navigation

OpenXchangeClient

Documentation of the Open-Xchange HTTP API which is used by the new AJAX GUI.

Building

To install the required dependencies and to build the elixir project, run:

mix local.hex --force
mix do deps.get, compile

Installation

If available in Hex, the package can be installed by adding open_xchange_client to your list of dependencies in mix.exs:

def deps do
  [{:open_xchange_client, "~> 0.1.0"}]
end

Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/open_xchange_client.

Usage

alias OpenXchangeClient.Api
alias OpenXchangeClient.Model

endpoint = "https://example.com/"
username = "[email protected]"
password = "secure-password"
conn = OpenXchangeClient.Connection.new(endpoint)

# Get a authenticated session for the current user
{:ok, %{session: session}} = Api.Login.do_login(conn, username, password)

# Use the session for authenticated requests
{:ok, data: %Model.CurrentUserData{ user_id: uid}} = Api.UserMe.get_current_user(conn, session)

# Don't forget to logout - otherwise you might hit a rate limit from OX
Api.Login.do_logout(conn, session)

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published