PandaDoc (pandadoc.com API v0.1.1) View Source

Documentation for PandaDoc which provides an API for pandadoc.com.

Installation

If available in Hex, the package can be installed by adding pandadoc to your list of dependencies in mix.exs:

def deps do
  [
    {:pandadoc, "~> 0.1.1"}
  ]
end

Configuration

config :pandadoc, api_key: "<your api key>"

Link to this section Summary

Functions

Delete a document.

Get basic data about a document such as name, status, and dates.

Download a PDF of any document.

Download a signed PDF of a completed document.

List documents, optionally filter by a search query or tags.

Move a document to sent status and send an optional email.

Generate a link to share this document with a default expiry of one day.

Link to this section Functions

Link to this function

create_document(name, pdf_bytes, recipients, fields \\ %{}, tags \\ [], parse_form_fields \\ false)

View Source

Creates a new Document from the given PDF file.

Examples

iex> recipients = [
  %{email: "jane@example.com", first_name: "Jane", last_name: "Example", role: "signer1"}
]

iex> PandaDoc.create_document("Sample PandaDoc PDF.pdf", [] = pdf_bytes, recipients)
{:ok, "msFYActMfJHqNTKH8YSvF1"}

Delete a document.

Examples

iex> PandaDoc.delete_document("msFYActMfJHqNTKH8YSvF1")
:ok

Get basic data about a document such as name, status, and dates.

Examples

iex> PandaDoc.document_status("msFYActMfJHqNTKH8YSvF1")
{:ok,
  %{
    id: "msFYActMfJHqNTKH8YSvF1",
    name: "Sample Document",
    status: "document.draft",
    date_created: "2017-08-06T08:42:13.836022Z",
    date_modified: "2017-09-04T02:21:13.963750Z",
    expiration_date: nil,
    version: "1"
  }
}
Link to this function

download_document(id, query \\ [])

View Source

Download a PDF of any document.

Examples

iex> PandaDoc.download_document("msFYActMfJHqNTKH8YSvF1", watermark_text: "WATERMARKED")
{:ok, []}
Link to this function

download_protected_document(id, hard_copy_type \\ nil)

View Source

Download a signed PDF of a completed document.

Examples

iex> PandaDoc.download_protected_document("msFYActMfJHqNTKH8YSvF1")
{:ok, []}
Link to this function

list_documents(query \\ [])

View Source

List documents, optionally filter by a search query or tags.

Examples

iex> PandaDoc.list_documents()
{:ok,
  [
    %{
      id: "msFYActMfJHqNTKH8YSvF1",
      name: "Sample Document",
      status: "document.draft",
      date_created: "2017-08-06T08:42:13.836022Z",
      date_modified: "2017-09-04T02:21:13.963750Z",
      expiration_date: nil,
      version: "1"
    }
  ]
}
Link to this function

send_document(id, subject \\ nil, message \\ nil, silent \\ false)

View Source

Move a document to sent status and send an optional email.

Examples

iex> PandaDoc.send_document("msFYActMfJHqNTKH8YSvF1", "Document ready", "Hi there, please sign this document")
:ok
Link to this function

share_document(id, recipient_email, lifetime \\ 86400)

View Source

Generate a link to share this document with a default expiry of one day.

Examples

iex> PandaDoc.share_document("msFYActMfJHqNTKH8YSvF1", "jane@example.com", 900)
{:ok, "https://app.pandadoc.com/s/QYCPtavst3DqqBK72ZRtbF", ~U[2017-08-29T22:18:44.315Z]}