Class: SignwellSDK::Resources::V1::Documents

Inherits:
Object
  • Object
show all
Defined in:
lib/signwell_sdk/resources/v1/documents.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Documents

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Documents.

Parameters:



366
367
368
# File 'lib/signwell_sdk/resources/v1/documents.rb', line 366

def initialize(client:)
  @client = client
end

Instance Method Details

#create(files:, recipients:, allow_decline: nil, allow_reassign: nil, api_application_id: nil, apply_signing_order: nil, attachment_requests: nil, checkbox_groups: nil, copied_contacts: nil, custom_requester_email: nil, custom_requester_name: nil, decline_redirect_url: nil, draft: nil, embedded_signing: nil, embedded_signing_notifications: nil, expires_in: nil, fields: nil, labels: nil, language: nil, message: nil, metadata: nil, name: nil, redirect_url: nil, reminders: nil, subject: nil, test_mode: nil, text_tags: nil, with_signature_page: nil, request_options: {}) ⇒ SignwellSDK::Models::V1::Document

Some parameter documentations has been truncated, see Models::V1::DocumentCreateParams for more details.

Creates and optionally sends a new document for signing. If ‘draft` is set to true the document will not be sent.

Parameters:

  • files (Array<SignwellSDK::Models::V1::DocumentFile>)

    Document files can be uploaded by specifying a file URL or base64 string. Either

  • recipients (Array<SignwellSDK::Models::V1::DocumentCreateParams::Recipient>)

    Document recipients are people that must complete and/or sign a document.

  • allow_decline (Boolean)

    Whether to allow recipients the option to decline signing a document. If multipl

  • allow_reassign (Boolean)

    In some cases a signer is not the right person to sign and may need to reassign

  • api_application_id (String)

    Unique identifier for API Application settings to use. API Applications are opti

  • apply_signing_order (Boolean)

    When set to ‘true` recipients will sign one at a time in the order of the `recip

  • attachment_requests (Array<SignwellSDK::Models::V1::AttachmentRequest>)

    Attachments that a recipient must upload to complete the signing process. Attach

  • checkbox_groups (Array<SignwellSDK::Models::V1::CheckboxGroup>)

    Checkbox fields that are placed on a document can be grouped with selection requ

  • copied_contacts (Array<SignwellSDK::Models::V1::CopiedContact>)

    Copied contacts are emailed the final document once it has been completed by all

  • custom_requester_email (String)

    Sets the custom requester email for the document. When set, this is the email us

  • custom_requester_name (String)

    Sets the custom requester name for the document. When set, this is the name used

  • decline_redirect_url (String)

    A URL that recipients are redirected to if the document is declined.

  • draft (Boolean)

    Whether the document can still be updated before sending a signature request. If

  • embedded_signing (Boolean)

    When set to ‘true` it enables embedded signing in your website/web application.

  • embedded_signing_notifications (Boolean)

    On embedding signing, document owners (and CC’d contacts) do not get a notificat

  • expires_in (Integer)

    Number of days before the signature request expires. Defaults to the account exp

  • fields (Array<Array<SignwellSDK::Models::V1::DocumentCreateParams::Field>>)

    Document fields placed on a document for collecting data or signatures from reci

  • labels (Array<SignwellSDK::Models::V1::Label>)

    Labels can be used to organize documents in a way that can make it easy to find

  • language (String)

    Sets the language for all recipients on the document and updates all recipient s

  • message (String)

    Email message for the signature request that recipients will see. Defaults to th

  • metadata (Hash{Symbol=>String})

    Optional key-value data that can be associated with the document. If set, will b

  • name (String)

    The name of the document.

  • redirect_url (String)

    A URL that recipients are redirected to after successfully signing a document.

  • reminders (Boolean)

    Whether to send signing reminders to recipients. Reminders are sent on day 3, da

  • subject (String)

    Email subject for the signature request that recipients will see. Defaults to th

  • test_mode (Boolean)

    Set to ‘true` to enable Test Mode. Documents created with Test Mode do not count

  • text_tags (Boolean)

    An alternative way (if you can’t use the recommended way) of placing fields in s

  • with_signature_page (Boolean)

    When set to ‘true` the document will have a signature page added to the end, and

  • request_options (SignwellSDK::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



76
77
78
79
80
81
82
83
84
85
# File 'lib/signwell_sdk/resources/v1/documents.rb', line 76

def create(params)
  parsed, options = SignwellSDK::V1::DocumentCreateParams.dump_request(params)
  @client.request(
    method: :post,
    path: "api/v1/documents",
    body: parsed,
    model: SignwellSDK::V1::Document,
    options: options
  )
end

#create_from_template(recipients:, allow_decline: nil, allow_reassign: nil, api_application_id: nil, apply_signing_order: nil, attachment_requests: nil, checkbox_groups: nil, copied_contacts: nil, custom_requester_email: nil, custom_requester_name: nil, decline_redirect_url: nil, draft: nil, embedded_signing: nil, embedded_signing_notifications: nil, expires_in: nil, fields: nil, files: nil, labels: nil, language: nil, message: nil, metadata: nil, name: nil, redirect_url: nil, reminders: nil, subject: nil, template_fields: nil, template_id: nil, template_ids: nil, test_mode: nil, text_tags: nil, with_signature_page: nil, request_options: {}) ⇒ SignwellSDK::Models::V1::DocumentCreateFromTemplateResponse

Some parameter documentations has been truncated, see Models::V1::DocumentCreateFromTemplateParams for more details.

Creates and optionally sends a new document for signing. If ‘draft` is set to true the document will not be sent.

:template_

Parameters:

  • recipients (Array<SignwellSDK::Models::V1::DocumentCreateFromTemplateParams::Recipient>)

    Document recipients are people that must complete and/or sign a document. Recipi

  • allow_decline (Boolean)

    Whether to allow recipients the option to decline signing a document. If multipl

  • allow_reassign (Boolean)

    In some cases a signer is not the right person to sign and may need to reassign

  • api_application_id (String)

    Unique identifier for API Application settings to use. API Applications are opti

  • apply_signing_order (Boolean)

    When set to ‘true` recipients will sign one at a time in the order of the `recip

  • attachment_requests (Array<SignwellSDK::Models::V1::AttachmentRequest>)

    Attachments that a recipient must upload to complete the signing process. Attach

  • checkbox_groups (Array<SignwellSDK::Models::V1::CheckboxGroup>)

    Checkbox fields that are placed on a document can be grouped with selection requ

  • copied_contacts (Array<SignwellSDK::Models::V1::CopiedContact>)

    Copied contacts are emailed the final document once it has been completed by all

  • custom_requester_email (String)

    Sets the custom requester email for the document. When set, this is the email us

  • custom_requester_name (String)

    Sets the custom requester name for the document. When set, this is the name used

  • decline_redirect_url (String)

    A URL that recipients are redirected to if the document is declined.

  • draft (Boolean)

    Whether the document can still be updated before sending a signature request. If

  • embedded_signing (Boolean)

    When set to ‘true` it enables embedded signing in your website/web application.

  • embedded_signing_notifications (Boolean)

    On embedding signing, document owners (and CC’d contacts) do not get a notificat

  • expires_in (Integer)

    Number of days before the signature request expires. Defaults to the account exp

  • fields (Array<Array<SignwellSDK::Models::V1::DocumentCreateFromTemplateParams::Field>>)

    Fields to be added to any appended files (not existing files). Document fields p

  • files (Array<SignwellSDK::Models::V1::DocumentCreateFromTemplateParams::File>)
  • labels (Array<SignwellSDK::Models::V1::Label>)

    Labels can be used to organize documents in a way that can make it easy to find

  • language (String)

    Sets the language for all recipients on the document and updates all recipient s

  • message (String)

    Email message for the signature request that recipients will see. Defaults to th

  • metadata (Hash{Symbol=>String})

    Optional key-value data that can be associated with the document. If set, will b

  • name (String)

    The name of the document.

  • redirect_url (String)

    A URL that recipients are redirected to after successfully signing a document.

  • reminders (Boolean)

    Whether to send signing reminders to recipients. Reminders are sent on day 3, da

  • subject (String)

    Email subject for the signature request that recipients will see. Defaults to th

  • template_fields (Array<SignwellSDK::Models::V1::DocumentCreateFromTemplateParams::TemplateField>)

    Fields of your template(s) that you can prepopulate with values. Signature and I

  • template_id (String)

    Use when you have to create a document from a single template. Either

  • template_ids (Array<String>)

    Use when you have to create a document from multiple templates. Either :template

  • test_mode (Boolean)

    Set to ‘true` to enable Test Mode. Documents created with Test Mode do not count

  • text_tags (Boolean)

    An alternative way (if you can’t use the recommended way) of placing fields in s

  • with_signature_page (Boolean)

    When set to ‘true` the document will have a signature page added to the end, and

  • request_options (SignwellSDK::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



230
231
232
233
234
235
236
237
238
239
# File 'lib/signwell_sdk/resources/v1/documents.rb', line 230

def create_from_template(params)
  parsed, options = SignwellSDK::V1::DocumentCreateFromTemplateParams.dump_request(params)
  @client.request(
    method: :post,
    path: "api/v1/document_templates/documents",
    body: parsed,
    model: SignwellSDK::Models::V1::DocumentCreateFromTemplateResponse,
    options: options
  )
end

#delete(id, request_options: {}) ⇒ nil

Deletes a document. Deleting a document will also cancel document signing (if in progress). Supply the unique document ID from either a Create Document request or document page URL.

Parameters:

Returns:

  • (nil)

See Also:



145
146
147
148
149
150
151
152
# File 'lib/signwell_sdk/resources/v1/documents.rb', line 145

def delete(id, params = {})
  @client.request(
    method: :delete,
    path: ["api/v1/documents/%1$s", id],
    model: NilClass,
    options: params[:request_options]
  )
end

#list(limit: nil, page: nil, request_options: {}) ⇒ SignwellSDK::Models::V1::DocumentListResponse

Returns a paginated list of documents for the authenticated account.

Parameters:

  • limit (Integer)

    The number of documents to fetch. Defaults to 10, max is 50.

  • page (Integer)

    The page number for pagination. Defaults to the first page.

  • request_options (SignwellSDK::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



121
122
123
124
125
126
127
128
129
130
# File 'lib/signwell_sdk/resources/v1/documents.rb', line 121

def list(params = {})
  parsed, options = SignwellSDK::V1::DocumentListParams.dump_request(params)
  @client.request(
    method: :get,
    path: "api/v1/documents",
    query: parsed,
    model: SignwellSDK::Models::V1::DocumentListResponse,
    options: options
  )
end

#remind(id, recipients: nil, request_options: {}) ⇒ nil

Some parameter documentations has been truncated, see Models::V1::DocumentRemindParams for more details.

Sends a reminder email to recipients that have not signed yet.

Parameters:

Returns:

  • (nil)

See Also:



257
258
259
260
261
262
263
264
265
266
# File 'lib/signwell_sdk/resources/v1/documents.rb', line 257

def remind(id, params = {})
  parsed, options = SignwellSDK::V1::DocumentRemindParams.dump_request(params)
  @client.request(
    method: :post,
    path: ["api/v1/documents/%1$s/remind", id],
    body: parsed,
    model: NilClass,
    options: options
  )
end

#retrieve(id, request_options: {}) ⇒ SignwellSDK::Models::V1::Document

Returns a document and all associated document data. Supply the unique document ID from either a document creation request or Document page URL.

Parameters:

Returns:

See Also:



99
100
101
102
103
104
105
106
# File 'lib/signwell_sdk/resources/v1/documents.rb', line 99

def retrieve(id, params = {})
  @client.request(
    method: :get,
    path: ["api/v1/documents/%1$s", id],
    model: SignwellSDK::V1::Document,
    options: params[:request_options]
  )
end

#retrieve_completed_pdf(id, audit_page: nil, file_format: nil, url_only: nil, request_options: {}) ⇒ SignwellSDK::Models::V1::DocumentRetrieveCompletedPdfResponse

Some parameter documentations has been truncated, see Models::V1::DocumentRetrieveCompletedPdfParams for more details.

Gets a completed document PDF or ZIP file. Supply the unique document ID from either a document creation request or document page URL.

Parameters:

  • id (String)

    Unique identifier for a completed document.

  • audit_page (Boolean)

    Whether to include the audit page as part of the document. Defaults to ‘true`

  • file_format (Symbol, SignwellSDK::Models::V1::DocumentRetrieveCompletedPdfParams::FileFormat)

    Format of the file to be downloaded. Supported formats are ‘pdf’ and ‘zip’.

  • url_only (Boolean)

    Whether to return the URL of the completed PDF or the actual PDF content. Defaul

  • request_options (SignwellSDK::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



289
290
291
292
293
294
295
296
297
298
# File 'lib/signwell_sdk/resources/v1/documents.rb', line 289

def retrieve_completed_pdf(id, params = {})
  parsed, options = SignwellSDK::V1::DocumentRetrieveCompletedPdfParams.dump_request(params)
  @client.request(
    method: :get,
    path: ["api/v1/documents/%1$s/completed_pdf", id],
    query: parsed,
    model: SignwellSDK::Models::V1::DocumentRetrieveCompletedPdfResponse,
    options: options
  )
end

#send_(id, allow_decline: nil, allow_reassign: nil, api_application_id: nil, apply_signing_order: nil, checkbox_groups: nil, custom_requester_email: nil, custom_requester_name: nil, decline_redirect_url: nil, embedded_signing: nil, embedded_signing_notifications: nil, expires_in: nil, labels: nil, message: nil, metadata: nil, name: nil, redirect_url: nil, reminders: nil, subject: nil, test_mode: nil, request_options: {}) ⇒ SignwellSDK::Models::V1::Document

Some parameter documentations has been truncated, see Models::V1::DocumentSendParams for more details.

Updates a draft document and sends it to be signed by recipients.

Parameters:

  • id (String)

    Unique identifier for a document.

  • allow_decline (Boolean)

    Whether to allow recipients the option to decline signing a document. If multipl

  • allow_reassign (Boolean)

    In some cases a signer is not the right person to sign and may need to reassign

  • api_application_id (String)

    Unique identifier for API Application settings to use. API Applications are opti

  • apply_signing_order (Boolean)

    When set to ‘true` recipients will sign one at a time in the order of the `recip

  • checkbox_groups (Array<SignwellSDK::Models::V1::CheckboxGroup>)

    Checkbox fields that are placed on a document can be grouped with selection requ

  • custom_requester_email (String)

    Sets the custom requester email for the document. When set, this is the email us

  • custom_requester_name (String)

    Sets the custom requester name for the document. When set, this is the name used

  • decline_redirect_url (String)

    A URL that recipients are redirected to if the document is declined.

  • embedded_signing (Boolean)

    When set to ‘true` it enables embedded signing in your website/web application.

  • embedded_signing_notifications (Boolean)

    On embedding signing, document owners (and CC’d contacts) do not get a notificat

  • expires_in (Integer)

    Number of days before the signature request expires. Defaults to the account exp

  • labels (Array<SignwellSDK::Models::V1::Label>)

    Labels can be used to organize documents in a way that can make it easy to find

  • message (String)

    Email message for the signature request that recipients will see. Defaults to th

  • metadata (Hash{Symbol=>String})

    Optional key-value data that can be associated with the document. If set, will b

  • name (String)

    The name of the document.

  • redirect_url (String)

    A URL that recipients are redirected to after successfully signing a document.

  • reminders (Boolean)

    Whether to send signing reminders to recipients. Reminders are sent on day 3, da

  • subject (String)

    Email subject for the signature request that recipients will see. Defaults to th

  • test_mode (Boolean)

    Set to ‘true` to enable Test Mode. Documents created with Test Mode do not count

  • request_options (SignwellSDK::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



352
353
354
355
356
357
358
359
360
361
# File 'lib/signwell_sdk/resources/v1/documents.rb', line 352

def send_(id, params = {})
  parsed, options = SignwellSDK::V1::DocumentSendParams.dump_request(params)
  @client.request(
    method: :post,
    path: ["api/v1/documents/%1$s/send", id],
    body: parsed,
    model: SignwellSDK::V1::Document,
    options: options
  )
end