Documentation of the Open-Xchange HTTP API which is used by the new AJAX GUI.
To install the required dependencies and to build the elixir project, run:
mix local.hex --force
mix do deps.get, compile
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.
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)