This is an Elixir library for interacting with the Persona platform.
The package can be installed by adding ex_persona
to your list of dependencies in mix.exs
:
def deps do
[
{:ex_persona, "~> 0.1"}
]
end
Check Hex to make sure you're using an up-to-date version number.
You'll need your API key (this can be found on your dashboard on withpersona.com). You should set this API key in your configuration:
config :ex_persona, api_key: "persona_production_123123123"
Then, you can build and send requests.
# To stream all inquiries, paginating behind the scenes:
ExPersona.Inquiry.list()
|> ExPersona.stream!()
|> Stream.take(100)
|> Enum.to_list()
# To get a specific inquiry by ID:
inq = ExPersona.Inquiry.get("inq_adsf123asfd") |> ExPersona.request!()
# Download all the front photos of the documents for an inquiry
inq
|> ExPersona.Inquiry.get_document_ids()
|> Enum.map(&ExPersona.Document.get/1)
|> Enum.map(&ExPersona.request!/1)
|> Enum.map(& ExPersona.Document.download_file(&1, "front_photo"))
See the list of modules for a list of the other types (Verifications, Accounts, Reports, etc) available.
To run tests:
$ mix test
Please report all issues on github.