Skip to content

DocSpring/docspring-ruby

Repository files navigation

docspring

DocSpring - the Ruby gem for the DocSpring API

Use DocSpring's API to programmatically fill out PDF forms, convert HTML to PDFs, merge PDFs, or request legally binding e-signatures.

This SDK is automatically generated by the OpenAPI Generator project:

  • API version: v1
  • Package version: 3.2.0
  • Generator version: 7.16.0-DOCSPRING
  • Build package: org.openapitools.codegen.languages.RubyClientCodegen

Installation

Build a gem

To build the Ruby code into a gem:

gem build docspring.gemspec

Then either install the gem locally:

gem install ./docspring-3.2.0.gem

(for development, run gem install --dev ./docspring-3.2.0.gem to install the development dependencies)

or publish the gem to a gem hosting service, e.g. RubyGems.

Finally add this to the Gemfile:

gem 'docspring', '~> 3.2.0'

Install from Git

If the Ruby gem is hosted at a git repository: https://github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile:

gem 'docspring', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git'

Include the Ruby code directly

Include the Ruby code directly using -I as follows:

ruby -Ilib script.rb

Getting Started

Please follow the installation procedure and then run the following code:

# Load the gem
require 'docspring'

# Setup authorization
DocSpring.configure do |config|
  # Configure HTTP basic authorization: api_token_basic
  config.username = 'YOUR_USERNAME'
  config.password = 'YOUR_PASSWORD'
end

api_instance = DocSpring::Client.new
template_id = 'tpl_1234567890abcdef02' # String | 
data = DocSpring::AddFieldsData.new({fields: [3.56]}) # AddFieldsData | 

begin
  #Add new fields to a Template
  result = api_instance.add_fields_to_template(template_id, data)
  p result
rescue DocSpring::ApiError => e
  puts "Exception when calling Client->add_fields_to_template: #{e}"
end

Documentation for API Endpoints

All URIs are relative to https://sync.api.docspring.com/api/v1

Class Method HTTP request Description
DocSpring::Client add_fields_to_template PUT /templates/{template_id}/add_fields Add new fields to a Template
DocSpring::Client batch_generate_pdfs POST /submissions/batches Generate multiple PDFs
DocSpring::Client combine_pdfs POST /combined_submissions Merge submission PDFs, template PDFs, or custom files
DocSpring::Client copy_template POST /templates/{template_id}/copy Copy a template
DocSpring::Client create_custom_file_from_upload POST /custom_files Create a new custom file from a cached S3 upload
DocSpring::Client create_data_request_event POST /data_requests/{data_request_id}/events Create a new event for emailing a signee a request for signature
DocSpring::Client create_data_request_token POST /data_requests/{data_request_id}/tokens Create a new data request token for form authentication
DocSpring::Client create_folder POST /folders/ Create a folder
DocSpring::Client create_html_template POST /templates?endpoint_variant=create_html_template Create a new HTML template
DocSpring::Client create_pdf_template POST /templates Create a new PDF template with a form POST file upload
DocSpring::Client create_pdf_template_from_upload POST /templates?endpoint_variant=create_template_from_cached_upload Create a new PDF template from a cached S3 file upload
DocSpring::Client delete_folder DELETE /folders/{folder_id} Delete a folder
DocSpring::Client delete_template DELETE /templates/{template_id} Delete a template
DocSpring::Client expire_combined_submission DELETE /combined_submissions/{combined_submission_id} Expire a combined submission
DocSpring::Client expire_submission DELETE /submissions/{submission_id} Expire a PDF submission
DocSpring::Client generate_pdf POST /templates/{template_id}/submissions Generate a PDF
DocSpring::Client generate_preview POST /submissions/{submission_id}/generate_preview Generate a preview PDF for partially completed data requests
DocSpring::Client get_combined_submission GET /combined_submissions/{combined_submission_id} Check the status of a combined submission (merged PDFs)
DocSpring::Client get_data_request GET /data_requests/{data_request_id} Look up a submission data request
DocSpring::Client get_full_template GET /templates/{template_id}?full=true Fetch the full attributes for a PDF template
DocSpring::Client get_presign_url GET /uploads/presign Get a presigned S3 URL for direct file upload
DocSpring::Client get_submission GET /submissions/{submission_id} Check the status of a PDF
DocSpring::Client get_submission_batch GET /submissions/batches/{submission_batch_id} Check the status of a submission batch job
DocSpring::Client get_template GET /templates/{template_id} Check the status of an uploaded template
DocSpring::Client get_template_schema GET /templates/{template_id}/schema Fetch the JSON schema for a template
DocSpring::Client list_combined_submissions GET /combined_submissions Get a list of all combined submissions
DocSpring::Client list_folders GET /folders/ Get a list of all folders
DocSpring::Client list_submissions GET /submissions List all submissions
DocSpring::Client list_template_submissions GET /templates/{template_id}/submissions List all submissions for a given template
DocSpring::Client list_templates GET /templates Get a list of all templates
DocSpring::Client move_folder_to_folder POST /folders/{folder_id}/move Move a folder
DocSpring::Client move_template_to_folder POST /templates/{template_id}/move Move Template to folder
DocSpring::Client publish_template_version POST /templates/{template_id}/publish_version Publish a template version
DocSpring::Client rename_folder POST /folders/{folder_id}/rename Rename a folder
DocSpring::Client restore_template_version POST /templates/{template_id}/restore_version Restore a template version
DocSpring::Client test_authentication GET /authentication Test authentication
DocSpring::Client update_data_request PUT /data_requests/{data_request_id} Update a submission data request
DocSpring::Client update_template PUT /templates/{template_id} Update a Template
DocSpring::Client update_template_document PUT /templates/{template_id}?endpoint_variant=update_template_pdf_with_form_post Update a template's document with a form POST file upload
DocSpring::Client update_template_document_from_upload PUT /templates/{template_id}?endpoint_variant=update_template_pdf_with_cached_upload Update a template's document with a cached S3 file upload

Documentation for Models

Documentation for Authorization

Authentication schemes defined for the API:

api_token_basic

  • Type: HTTP basic authentication

About

Ruby API Client for DocSpring

Resources

License

Stars

Watchers

Forks

Packages

No packages published