DNSimple Elixir Client
An Elixir client for the DNSimple API v2.
Installation
You will have to add the dnsimple app to your mix.exs file as a dependency:
def deps do
[
{:dnsimple, "~> 1.0.0"}, #...
]
end
And then add it to the list of applications that should be started:
def application do
[applications: [
:dnsimple, #...
]]
end
Usage
From iex
# Create a client passing the proper settings
iex> client = %Dnsimple.Client{access_token: "TOKEN", base_url: "https://api.sandbox.dnsimple.com/"}
# Check the login
iex> {:ok, response} = Dnsimple.Identity.whoami(client)
iex> response.data
# => %{"account" => %{"created_at" => "2014-05-19T14:20:32.263Z",
# => "email" => "example-account@example.com", "id" => 1,
# => "updated_at" => "2015-04-01T10:07:47.559Z"}, "user" => nil}
From an .exs file
# Start Dnsimple app
Dnsimple.start
# Create a client passing the proper settings
client = %Dnsimple.Client{access_token: "TOKEN", base_url: "https://api.sandbox.dnsimple.com/"}
# Check the login
Dnsimple.Identity.whoami(client)
License
Copyright (c) 2015-2016 Aetrion LLC. This is Free Software distributed under the MIT license.