Skip to content
This repository has been archived by the owner on Apr 18, 2023. It is now read-only.

Latest commit

 

History

History
61 lines (44 loc) · 1.85 KB

README.md

File metadata and controls

61 lines (44 loc) · 1.85 KB

ExPersona

Build Status Hex pm API Docs

This is an Elixir library for interacting with the Persona platform.

Installation

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.

Usage

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.

Running Tests

To run tests:

$ mix test

Reporting Issues

Please report all issues on github.