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
@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
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}
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}}}}