Skip to content

Latest commit

 

History

History
56 lines (45 loc) · 966 Bytes

README.md

File metadata and controls

56 lines (45 loc) · 966 Bytes

plaid_erl

An OTP application to integrate with the plaid API. Exports a gen_server compatible module, plaid_erl, which sits on top of an httpc client. The internal gen_server uses asynchronous calls against its internal httpc client to improve throughput.

Build

$ rebar3 compile

Test

$ rebar3 test

Usage

Initialization using plaid environment:

Init = #plaid_init{
  client_id=ClientID,
  secret=Secret,
  env=Env
},
{ok, Pid} = plaid_erl:start_link(Init)

Initialization using base url:

Init = #plaid_init{
  client_id=ClientID,
  secret=Secret,
  url=URL
},
{ok, Pid} = plaid_erl:start_link(Init)

Generic request:

UrlSuffix = <<"/item/get">>,
Values = #{ <<"access_token">> => AccessToken },
{ok, Res} = plaid_erl:request(Pid, UrlSuffix, Values)

Exported function request:

{ok, Res} = plaid_erl:item_get(Pid, AccessToken)

Stop:

plaid_erl:stop(Pid)