https://github.com/infinitered/eversign
Elixir wrapper for Eversign API
https://github.com/infinitered/eversign
Last synced: 11 months ago
JSON representation
Elixir wrapper for Eversign API
- Host: GitHub
- URL: https://github.com/infinitered/eversign
- Owner: infinitered
- Created: 2017-06-14T20:34:04.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-04-24T17:44:47.000Z (over 7 years ago)
- Last Synced: 2025-01-09T04:51:51.951Z (about 1 year ago)
- Language: Elixir
- Size: 13.7 KB
- Stars: 2
- Watchers: 11
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Eversign
Package for interacting with [Eversign's API](https://eversign.com/api/documentation).
## Installation
If [available in Hex](https://hex.pm/docs/publish), the package can be installed
by adding `eversign` to your list of dependencies in `mix.exs`:
```elixir
def deps do
[{:eversign, "~> 0.1.0"}]
end
```
## Usage
In your config file:
```elixir
## In prod/dev config
config :eversign,
access_key: {:system, "EVERSIGN_ACCESS_KEY"},
business_id: {:system, "EVERSIGN_BUSINESS_ID"},
api_module: Eversign.API.HTTP
## In test config:
config :eversign,
access_key: {:system, "EVERSIGN_ACCESS_KEY"},
business_id: {:system, "EVERSIGN_BUSINESS_ID"},
api_module: Eversign.API.Mock
```
Create document using a template:
```elixir
def create_eversign(opts) do
%{ address: address, client: client } = opts
params = %{
template_id: "TemplateIDHere",
title: "My Template Title",
message: "Please sign this document for our records.",
signers: [%{
role: "Client",
name: client.full_name,
email: client.email,
}, %{
role: "Account Manager",
name: "Jamon Holmgren",
email: "jamon@infinite.red",
}],
fields: [%{
identifier: "full-name",
value: client.full_name
},
%{
identifier: "street-address",
value: "#{address.line_1}, #{address.line_2}"
},
%{
identifier: "city-state-zip",
value: "#{address.city}, #{address.state}, #{address.zip_code}"
}]
}
%{ :ok, _data } = Evernote.use_template(params)
end
```
Retrieve a document using a document ID:
```elixir
document = Eversign.get_document("document ID here")
```
_TODO: Add rest of API, more examples._