The DocuSeal Ruby library provides seamless integration with the DocuSeal API, allowing developers to interact with DocuSeal's electronic signature and document management features directly within Ruby applications. This library is designed to simplify API interactions and provide tools for efficient implementation.
Detailed documentation is available at DocuSeal API Docs.
To install the library, run:
gem install docuseal
Add the library to your Gemfile for projects using Bundler:
gem 'docuseal'
Set up the library with your DocuSeal API key based on your deployment. Retrieve your API key from the appropriate location:
API keys for the global cloud can be obtained from your Global DocuSeal Console.
require 'docuseal'
Docuseal.key = 'your_api_key_here'
API keys for the EU cloud can be obtained from your EU DocuSeal Console.
require 'docuseal'
Docuseal.key = 'your_api_key_here'
Docuseal.url = 'https://api.docuseal.eu'
For on-premises installations, API keys can be retrieved from the API settings page of your deployed application, e.g., https://yourdocusealapp.com/settings/api.
require 'docuseal'
Docuseal.key = 'your_api_key_here'
Docuseal.url = 'https://yourdocusealapp.com/api'
Provides the ability to retrieve a list of available submissions.
Docuseal.list_submissions(limit: 10)
Provides the functionality to retrieve information about a submission.
Docuseal.get_submission(1001)
This API endpoint allows you to create signature requests (submissions) for a document template and send them to the specified submitters (signers).
Related Guides:
Send documents for signature via API
Pre-fill PDF document form fields with API
Docuseal.create_submission({
template_id: 1000001,
send_email: true,
submitters: [
{
role: "First Party",
email: "[email protected]"
}
]
})
This API endpoint allows you to create submissions for a document template and send them to the specified email addresses. This is a simplified version of the POST /submissions API to be used with Zapier or other automation tools.
Docuseal.create_submission_from_emails({
template_id: 1000001,
emails: "[email protected], [email protected]"
})
Allows you to archive a submission.
Docuseal.archive_submission(1001)
Provides the ability to retrieve a list of submitters.
Docuseal.list_submitters(limit: 10)
Provides the functionality to retrieve information about a submitter.
Docuseal.get_submitter(500001)
Allows you to update submitter details, pre-fill or update field values and re-send emails.
Related Guides:
Automatically sign documents via API
Docuseal.update_submitter(500001, {
email: "[email protected]",
fields: [
{
name: "First Name",
default_value: "Acme"
}
]
})
Provides the ability to retrieve a list of available document templates.
Docuseal.list_templates(limit: 10)
Provides the functionality to retrieve information about a document template.
Docuseal.get_template(1000001)
Provides the functionality to create a fillable document template for existing Microsoft Word document. Use {{Field Name;role=Signer1;type=date}}
text tags to define fillable fields in the document. See https://www.docuseal.com/examples/fieldtags.docx for more text tag formats. Or specify the exact pixel coordinates of the document fields using fields
param.
Related Guides:
Use embedded text field tags to create a fillable form
Docuseal.create_template_from_docx({
name: "Test DOCX",
documents: [
{
name: "string",
file: "base64"
}
]
})
Provides the functionality to seamlessly generate a PDF document template by utilizing the provided HTML content while incorporating pre-defined fields.
Related Guides:
Create PDF document fillable form with HTML
Docuseal.create_template_from_html({
html: "<p>Lorem Ipsum is simply dummy text of the
<text-field
name=\"Industry\"
role=\"First Party\"
required=\"false\"
style=\"width: 80px; height: 16px; display: inline-block; margin-bottom: -4px\">
</text-field>
and typesetting industry</p>
",
name: "Test Template"
})
Allows you to merge multiple templates with documents and fields into a new combined template.
Docuseal.merge_templates({
template_ids: [
321,
432
],
name: "Merged Template"
})
Provides the functionality to create a fillable document template for existing PDF file. Use {{Field Name;role=Signer1;type=date}}
text tags to define fillable fields in the document. See https://www.docuseal.com/examples/fieldtags.pdf for more text tag formats. Or specify the exact pixel coordinates of the document fields using fields
param.
Related Guides:
Use embedded text field tags to create a fillable form
Docuseal.create_template_from_pdf({
name: "Test PDF",
documents: [
{
name: "string",
file: "base64",
fields: [
{
name: "string",
areas: [
{
x: 0,
y: 0,
w: 0,
h: 0,
page: 1
}
]
}
]
}
]
})
Allows you to clone existing template into a new template.
Docuseal.clone_template(1000001, {
name: "Cloned Template"
})
Provides the functionality to move a document template to a different folder and update the name of the template.
Docuseal.update_template(1000001, {
name: "New Document Name",
folder_name: "New Folder"
})
Allows you to add, remove or replace documents in the template with provided PDF/DOCX file or HTML content.
Docuseal.update_template_documents(1000001, {
documents: [
{
file: "string"
}
]
})
Allows you to archive a document template.
Docuseal.archive_template(1000001)
Set timeouts to avoid hanging requests:
Docuseal.open_timeout = 70
Docuseal.read_timeout = 90
For feature requests or bug reports, visit our GitHub Issues page.
The gem is available as open source under the terms of the MIT License.