# docspring DocSpring - the Ruby gem for the API v1 DocSpring is a service that helps you fill out and sign PDF templates. This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - API version: v1 - Package version: 1.3.1 - Build package: com.docspring.codegen.DocSpringRubyClientCodegen ## Installation ### Build a gem To build the Ruby code into a gem: ```shell gem build docspring.gemspec ``` Then either install the gem locally: ```shell gem install ./docspring-1.3.1.gem ``` (for development, run `gem install --dev ./docspring-1.3.1.gem` to install the development dependencies) or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/). Finally add this to the Gemfile: gem 'docspring', '~> 1.3.1' ### 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: ```shell ruby -Ilib script.rb ``` ## Getting Started Please follow the [installation](#installation) procedure and then run the following code: ```ruby # 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::PDFApi.new template_id = 'tpl_000000000000000002' # String | add_fields_data = DocSpring::AddFieldsData.new # AddFieldsData | begin #Add new fields to a Template result = api_instance.add_fields_to_template(template_id, add_fields_data) p result rescue DocSpring::ApiError => e puts "Exception when calling PDFApi->add_fields_to_template: #{e}" end ``` ## Documentation for API Endpoints All URIs are relative to *https://api.docspring.com/api/v1* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- *DocSpring::PDFApi* | [**add_fields_to_template**](docs/PDFApi.md#add_fields_to_template) | **PUT** /templates/{template_id}/add_fields | Add new fields to a Template *DocSpring::PDFApi* | [**batch_generate_pdf_v1**](docs/PDFApi.md#batch_generate_pdf_v1) | **POST** /templates/{template_id}/submissions/batch | Generates multiple PDFs *DocSpring::PDFApi* | [**batch_generate_pdfs**](docs/PDFApi.md#batch_generate_pdfs) | **POST** /submissions/batches | Generates multiple PDFs *DocSpring::PDFApi* | [**combine_pdfs**](docs/PDFApi.md#combine_pdfs) | **POST** /combined_submissions?v=2 | Merge submission PDFs, template PDFs, or custom files *DocSpring::PDFApi* | [**combine_submissions**](docs/PDFApi.md#combine_submissions) | **POST** /combined_submissions | Merge generated PDFs together *DocSpring::PDFApi* | [**create_custom_file_from_upload**](docs/PDFApi.md#create_custom_file_from_upload) | **POST** /custom_files | Create a new custom file from a cached presign upload *DocSpring::PDFApi* | [**create_data_request_token**](docs/PDFApi.md#create_data_request_token) | **POST** /data_requests/{data_request_id}/tokens | Creates a new data request token for form authentication *DocSpring::PDFApi* | [**create_folder**](docs/PDFApi.md#create_folder) | **POST** /folders/ | Create a folder *DocSpring::PDFApi* | [**create_html_template**](docs/PDFApi.md#create_html_template) | **POST** /templates?desc=html | Create a new HTML template *DocSpring::PDFApi* | [**create_pdf_template**](docs/PDFApi.md#create_pdf_template) | **POST** /templates | Create a new PDF template with a form POST file upload *DocSpring::PDFApi* | [**create_pdf_template_from_upload**](docs/PDFApi.md#create_pdf_template_from_upload) | **POST** /templates?desc=cached_upload | Create a new PDF template from a cached presign upload *DocSpring::PDFApi* | [**delete_folder**](docs/PDFApi.md#delete_folder) | **DELETE** /folders/{folder_id} | Delete a folder *DocSpring::PDFApi* | [**expire_combined_submission**](docs/PDFApi.md#expire_combined_submission) | **DELETE** /combined_submissions/{combined_submission_id} | Expire a combined submission *DocSpring::PDFApi* | [**expire_submission**](docs/PDFApi.md#expire_submission) | **DELETE** /submissions/{submission_id} | Expire a PDF submission *DocSpring::PDFApi* | [**generate_pdf**](docs/PDFApi.md#generate_pdf) | **POST** /templates/{template_id}/submissions | Generates a new PDF *DocSpring::PDFApi* | [**get_combined_submission**](docs/PDFApi.md#get_combined_submission) | **GET** /combined_submissions/{combined_submission_id} | Check the status of a combined submission (merged PDFs) *DocSpring::PDFApi* | [**get_data_request**](docs/PDFApi.md#get_data_request) | **GET** /data_requests/{data_request_id} | Look up a submission data request *DocSpring::PDFApi* | [**get_presign_url**](docs/PDFApi.md#get_presign_url) | **GET** /uploads/presign | Get a presigned URL so that you can upload a file to our AWS S3 bucket *DocSpring::PDFApi* | [**get_submission**](docs/PDFApi.md#get_submission) | **GET** /submissions/{submission_id} | Check the status of a PDF *DocSpring::PDFApi* | [**get_submission_batch**](docs/PDFApi.md#get_submission_batch) | **GET** /submissions/batches/{submission_batch_id} | Check the status of a submission batch job *DocSpring::PDFApi* | [**get_template**](docs/PDFApi.md#get_template) | **GET** /templates/{template_id} | Get a single template *DocSpring::PDFApi* | [**get_template_schema**](docs/PDFApi.md#get_template_schema) | **GET** /templates/{template_id}/schema | Fetch the JSON schema for a template *DocSpring::PDFApi* | [**list_folders**](docs/PDFApi.md#list_folders) | **GET** /folders/ | Get a list of all folders *DocSpring::PDFApi* | [**list_templates**](docs/PDFApi.md#list_templates) | **GET** /templates | Get a list of all templates *DocSpring::PDFApi* | [**move_folder_to_folder**](docs/PDFApi.md#move_folder_to_folder) | **POST** /folders/{folder_id}/move | Move a folder *DocSpring::PDFApi* | [**move_template_to_folder**](docs/PDFApi.md#move_template_to_folder) | **POST** /templates/{template_id}/move | Move Template to folder *DocSpring::PDFApi* | [**rename_folder**](docs/PDFApi.md#rename_folder) | **POST** /folders/{folder_id}/rename | Rename a folder *DocSpring::PDFApi* | [**test_authentication**](docs/PDFApi.md#test_authentication) | **GET** /authentication | Test Authentication *DocSpring::PDFApi* | [**update_data_request**](docs/PDFApi.md#update_data_request) | **PUT** /data_requests/{data_request_id} | Update a submission data request *DocSpring::PDFApi* | [**update_template**](docs/PDFApi.md#update_template) | **PUT** /templates/{template_id} | Update a Template ## Documentation for Models - [DocSpring::AddFieldsData](docs/AddFieldsData.md) - [DocSpring::AddFieldsTemplateResponse](docs/AddFieldsTemplateResponse.md) - [DocSpring::AuthenticationError](docs/AuthenticationError.md) - [DocSpring::AuthenticationSuccessResponse](docs/AuthenticationSuccessResponse.md) - [DocSpring::CombinePdfsData](docs/CombinePdfsData.md) - [DocSpring::CombinedSubmission](docs/CombinedSubmission.md) - [DocSpring::CombinedSubmissionAction](docs/CombinedSubmissionAction.md) - [DocSpring::CombinedSubmissionData](docs/CombinedSubmissionData.md) - [DocSpring::CreateCombinedSubmissionResponse](docs/CreateCombinedSubmissionResponse.md) - [DocSpring::CreateCustomFileData](docs/CreateCustomFileData.md) - [DocSpring::CreateCustomFileResponse](docs/CreateCustomFileResponse.md) - [DocSpring::CreateFolderData](docs/CreateFolderData.md) - [DocSpring::CreateHtmlTemplateData](docs/CreateHtmlTemplateData.md) - [DocSpring::CreateSubmissionBatchResponse](docs/CreateSubmissionBatchResponse.md) - [DocSpring::CreateSubmissionBatchSubmissionsResponse](docs/CreateSubmissionBatchSubmissionsResponse.md) - [DocSpring::CreateSubmissionDataRequestData](docs/CreateSubmissionDataRequestData.md) - [DocSpring::CreateSubmissionDataRequestTokenResponse](docs/CreateSubmissionDataRequestTokenResponse.md) - [DocSpring::CreateSubmissionDataRequestTokenResponseToken](docs/CreateSubmissionDataRequestTokenResponseToken.md) - [DocSpring::CreateSubmissionResponse](docs/CreateSubmissionResponse.md) - [DocSpring::CreateTemplateFromUploadData](docs/CreateTemplateFromUploadData.md) - [DocSpring::CustomFile](docs/CustomFile.md) - [DocSpring::Error](docs/Error.md) - [DocSpring::Folder](docs/Folder.md) - [DocSpring::FoldersFolder](docs/FoldersFolder.md) - [DocSpring::HtmlTemplateData](docs/HtmlTemplateData.md) - [DocSpring::InvalidRequest](docs/InvalidRequest.md) - [DocSpring::MoveFolderData](docs/MoveFolderData.md) - [DocSpring::MoveTemplateData](docs/MoveTemplateData.md) - [DocSpring::PendingTemplate](docs/PendingTemplate.md) - [DocSpring::RenameFolderData](docs/RenameFolderData.md) - [DocSpring::Submission](docs/Submission.md) - [DocSpring::SubmissionAction](docs/SubmissionAction.md) - [DocSpring::SubmissionBatch](docs/SubmissionBatch.md) - [DocSpring::SubmissionBatchData](docs/SubmissionBatchData.md) - [DocSpring::SubmissionData](docs/SubmissionData.md) - [DocSpring::SubmissionDataBatchRequest](docs/SubmissionDataBatchRequest.md) - [DocSpring::SubmissionDataRequest](docs/SubmissionDataRequest.md) - [DocSpring::Template](docs/Template.md) - [DocSpring::TemplateData](docs/TemplateData.md) - [DocSpring::TemplatestemplateIdaddFieldsFields](docs/TemplatestemplateIdaddFieldsFields.md) - [DocSpring::UpdateDataRequestResponse](docs/UpdateDataRequestResponse.md) - [DocSpring::UpdateSubmissionDataRequestData](docs/UpdateSubmissionDataRequestData.md) - [DocSpring::UpdateTemplateData](docs/UpdateTemplateData.md) - [DocSpring::UpdateTemplateResponse](docs/UpdateTemplateResponse.md) - [DocSpring::UploadTemplateData](docs/UploadTemplateData.md) - [DocSpring::UploadTemplateDataDocument](docs/UploadTemplateDataDocument.md) - [DocSpring::UploadTemplateDataDocumentMetadata](docs/UploadTemplateDataDocumentMetadata.md) ## Documentation for Authorization ### api_token_basic - **Type**: HTTP basic authentication