View Source Yousign.API.Documents (yousign_ex v0.2.0)

Link to this section Summary

Functions

Creates a new document and adds it to the given signature request

Creates a new document

Gets a single document by its id

List all documents

Link to this section Functions

Link to this function

add_to_signature_request(signature_request_id, body)

View Source
@spec add_to_signature_request(String.t(), %Yousign.DocumentInput{
  file: term(),
  initials: term(),
  nature: term(),
  parse_anchors: term(),
  password: term()
}) ::
  {:error, any()}
  | {:ok,
     %Yousign.Document{
       content_type: term(),
       created_at: term(),
       filename: term(),
       id: term(),
       initials: term(),
       is_locked: term(),
       is_protected: term(),
       is_signed: term(),
       nature: term(),
       sha256: term(),
       total_anchors: term(),
       total_pages: term()
     }}

Creates a new document and adds it to the given signature request

@spec create(%Yousign.DocumentInput{
  file: term(),
  initials: term(),
  nature: term(),
  parse_anchors: term(),
  password: term()
}) ::
  {:error, any()}
  | {:ok,
     %Yousign.Document{
       content_type: term(),
       created_at: term(),
       filename: term(),
       id: term(),
       initials: term(),
       is_locked: term(),
       is_protected: term(),
       is_signed: term(),
       nature: term(),
       sha256: term(),
       total_anchors: term(),
       total_pages: term()
     }}

Creates a new document

Link to this function

get(signature_request_id, id)

View Source
@spec get(String.t(), String.t()) :: {:error, any()} | {:ok, any()}

Gets a single document by its id

## Examples

  iex> Yousign.API.Documents.get("123")
  {:ok, %{"data" => %{"id" => "123", "name" => "test"}}}

  iex> Yousign.API.Documents.get("invalid")
  {:error, 404}
Link to this function

list(signature_request_id)

View Source
@spec list(String.t()) :: {:error, any()} | {:ok, any()}

List all documents

examples

Examples

iex> Yousign.API.Documents.list("123")
{:ok, %{"data" => [], "meta" => %{"pagination" => %{"total" => 0}}}}

iex> Yousign.API.Documents.list("123")
{:ok, %{"data" => [%{"id" => "123", "name" => "test"}], "meta" => %{"pagination" => %{"total" => 1}}}}