{"id":13509465,"url":"https://github.com/dnsimple/dnsimple-elixir","last_synced_at":"2025-04-04T13:12:27.920Z","repository":{"id":3424017,"uuid":"44564329","full_name":"dnsimple/dnsimple-elixir","owner":"dnsimple","description":"The DNSimple API client for Elixir.","archived":false,"fork":false,"pushed_at":"2025-03-11T00:33:40.000Z","size":893,"stargazers_count":50,"open_issues_count":5,"forks_count":15,"subscribers_count":9,"default_branch":"main","last_synced_at":"2025-03-28T12:08:57.597Z","etag":null,"topics":["api","api-client","dnsimple","dnsimple-api","dnsimple-policy-eng","dnsimple-policy-group-apiclient","dnsimple-policy-triage-application","elixir"],"latest_commit_sha":null,"homepage":"https://developer.dnsimple.com/","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dnsimple.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-10-19T21:10:59.000Z","updated_at":"2025-03-11T00:31:41.000Z","dependencies_parsed_at":"2023-02-10T03:16:23.796Z","dependency_job_id":"8e338ee2-0d26-41f4-b1b3-c60096e22086","html_url":"https://github.com/dnsimple/dnsimple-elixir","commit_stats":{"total_commits":636,"total_committers":24,"mean_commits":26.5,"dds":0.4355345911949685,"last_synced_commit":"58209c2883fa7f4bac254009f743020789a366ae"},"previous_names":[],"tags_count":29,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dnsimple%2Fdnsimple-elixir","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dnsimple%2Fdnsimple-elixir/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dnsimple%2Fdnsimple-elixir/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dnsimple%2Fdnsimple-elixir/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dnsimple","download_url":"https://codeload.github.com/dnsimple/dnsimple-elixir/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247182401,"owners_count":20897381,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","api-client","dnsimple","dnsimple-api","dnsimple-policy-eng","dnsimple-policy-group-apiclient","dnsimple-policy-triage-application","elixir"],"created_at":"2024-08-01T02:01:08.192Z","updated_at":"2025-04-04T13:12:27.904Z","avatar_url":"https://github.com/dnsimple.png","language":"Elixir","funding_links":[],"categories":["Third Party APIs"],"sub_categories":[],"readme":"# DNSimple Elixir Client\n\n[![Build Status](https://github.com/dnsimple/dnsimple-elixir/actions/workflows/ci.yml/badge.svg)](https://github.com/dnsimple/dnsimple-elixir/actions/workflows/ci.yml)\n[![Module Version](https://img.shields.io/hexpm/v/dnsimple.svg)](https://hex.pm/packages/dnsimple)\n[![Hex Docs](https://img.shields.io/badge/hex-docs-lightgreen.svg)](https://hexdocs.pm/dnsimple/)\n[![Total Download](https://img.shields.io/hexpm/dt/dnsimple.svg)](https://hex.pm/packages/dnsimple)\n[![License](https://img.shields.io/hexpm/l/dnsimple.svg)](https://github.com/dnsimple/dnsimple-elixir/blob/main/LICENSE.md)\n[![Last Updated](https://img.shields.io/github/last-commit/dnsimple/dnsimple-elixir.svg)](https://github.com/dnsimple/dnsimple-elixir/commits/main)\n\nAn Elixir client for the [DNSimple API v2](https://developer.dnsimple.com/v2/).\n\n## Requirements\n\n* Elixir: 1.14+\n* OTP: 25.0+\n\n## Installation\n\nYou will have to add the `:dnsimple` app to your `mix.exs` file as a dependency:\n\n```elixir\ndef deps do\n  [\n    {:dnsimple, \"~\u003e 3.4.0\"}, #...\n  ]\nend\n```\n\nAnd then add it to the list of applications that should be started:\n\n```elixir\ndef application do\n  [applications: [\n    :dnsimple, #...\n  ]]\nend\n```\n\n### Usage\n\n#### From iex\n\n```elixir\n# Create a client passing the proper settings\niex\u003e client = %Dnsimple.Client{access_token: \"TOKEN\", base_url: \"https://api.sandbox.dnsimple.com/\"}\n\n# Check the login\niex\u003e {:ok, response} = Dnsimple.Identity.whoami(client)\niex\u003e response.data\n# =\u003e %{\"account\" =\u003e %{\"created_at\" =\u003e \"2014-05-19T14:20:32.263Z\",\n# =\u003e   \"email\" =\u003e \"example-account@example.com\", \"id\" =\u003e 1,\n# =\u003e   \"updated_at\" =\u003e \"2015-04-01T10:07:47.559Z\"}, \"user\" =\u003e nil}\n```\n\n#### From an .exs file\n\n```elixir\n# Start Dnsimple app\nDnsimple.start\n\n# Create a client passing the proper settings\nclient = %Dnsimple.Client{access_token: \"TOKEN\", base_url: \"https://api.sandbox.dnsimple.com/\"}\n\n# Check the login\nDnsimple.Identity.whoami(client)\n```\n\n## Documentation\n\n### Useful links\n\n* [`dnsimple-elixir` hex.pm docs](https://hexdocs.pm/dnsimple/readme.html).\n* [DNSimple API documentation](https://developer.dnsimple.com).\n* [DNSimple API examples repository](https://github.com/dnsimple/dnsimple-api-examples).\n* [DNSimple support documentation](https://support.dnsimple.com).\n\n### Sandbox Environment\n\nWe highly recommend testing against our [sandbox environment](https://developer.dnsimple.com/sandbox/) before using our production environment. This will allow you to avoid real purchases, live charges on your credit card, and reduce the chance of your running up against rate limits.\n\nThe client supports both the production and sandbox environment. To switch to sandbox pass the sandbox API host using the `base_url` option when you construct the client:\n\n```elixir\nclient = %Dnsimple.Client{base_url: \"https://api.sandbox.dnsimple.com\", access_token: \"a1b2c3\"}\n```\n\nYou will need to ensure that you are using an access token created in the sandbox environment. Production tokens will *not* work in the sandbox environment.\n\n### Configuration\n\nYou can configure DNSimple inside of your app's `config.exs`. For example, if you have a development config, inside `dev.exs`:\n\n```elixir\nconfig :dnsimple, base_url: \"https://api.sandbox.dnsimple.com\"\nconfig :dnsimple, access_token: \"secret\"\nconfig :dnsimple, user_agent: \"my-app\"\n```\n\nNow you can simply call `client = Dnsimple.Client.new_from_env()`.\n\n### Logging\n\nThe client logs the requests made to the DNSimple API:\n\n```elixir\niex(2)\u003e Dnsimple.Identity.whoami(client)\n\n09:45:08.229 [debug] [dnsimple] GET https://api.sandbox.dnsimple.com/v2/whoami\n{:ok,\n %Dnsimple.Response{data: %Dnsimple.Whoami{account: %Dnsimple.Account{email: \"javier@dnsimple.com\",\n    id: 63, plan_identifier: \"dnsimple-professional\"}, user: nil},\n  http_response: %HTTPoison.Response{...},\n  pagination: nil, rate_limit: 2400, rate_limit_remaining: 2398,\n  rate_limit_reset: 1482745464}}\n```\n\nThe log level used for this is `debug`. If you want to disable it you will have to configure the logging level of your app (as it's set to `debug` level by default).\n\n```elixir\nconfig :logger, level: :info\n```\n\n### Examples\n\n#### Authentication\n\n```elixir\nclient = %Dnsimple.Client{base_url: \"https://api.sandbox.dnsimple.com\", access_token: \"a1b2c3\"}\n{:ok, response } = Dnsimple.Identity.whoami(client)\n```\n\nYou can get your `account_id` from the response, if you don't know it.\n\n```elixir\naccount_id = response.data.account.id\n```\n\n#### Setting a custom `User-Agent` header\n\nYou customize the `User-Agent` header for the calls made to the DNSimple API:\n\n```elixir\nclient = %Dnsimple.Client{user_agent: \"my-app\", access_token: \"a1b2c3\"}\n```\n\nThe value you provide will be appended to the default `User-Agent` the client uses. For example, if you use `my-app`, the final header value will be `dnsimple-elixir/1.0 my-app` (note that it will vary depending on the client version).\n\n#### Creating a domain\n\nYou will need:\n\n* The `account_id` of the account you want to create the domain for.\n* The `registrant_id` which is the ID of a contact of the corresponding account.\n\n```elixir\nclient = %Dnsimple.Client{base_url: \"https://api.sandbox.dnsimple.com\", access_token: \"a1b2c3\"}\n{:ok, response} = Dnsimple.Domains.create_domain(client, account_id = 1010, %{name: \"example.com\", registrant: registrant_id = 123})\n```\n\n#### Creating a record\n\nYou will need:\n\n* The `account_id` of the account you want to create the domain for.\n* The `zone_id` (can be the numeric ID or the name eg. \"example.com\").\n\n```elixir\nclient = %Dnsimple.Client{base_url: \"https://api.sandbox.dnsimple.com\", access_token: \"a1b2c3\"}\n{:ok, response} = Dnsimple.Zones.create_zone_record(client, account_id = 1010, zone_id = \"example.com\", %{\n  type: \"CNAME\",\n  name: \"provider\",\n  content: \"dnsimple.com\"\n})\n```\n\n## License\n\nCopyright (c) 2015-2025 DNSimple Corporation. This is Free Software distributed under the MIT license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdnsimple%2Fdnsimple-elixir","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdnsimple%2Fdnsimple-elixir","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdnsimple%2Fdnsimple-elixir/lists"}