ExDadata (ExDadata v0.1.0) View Source

ExDadata provides a wrapper for DaData API.

Example

Firs we need to define a configuration module.

defmodule MyApp.Dadata do
  use ExDadata, otp_app: :my_app
end

Then we can set our configuration in config.exs file:

config :my_app, MyApp.Dadata,
  api_key: "<api_key>",
  secret_key: "<secret_key>",
  http_adapter: ExDadata.HTTPoisonHTTPAdapter,
  json_adapter: Jason

And then we can use it to make requests to DaData API:

client = MyApp.Dadata.client()
{:ok, result} = ExDadata.Address.clean_address(client, ["мск сухонска 11/-89"])