Skip to content

wing328/docspring-java

Repository files navigation

docspring-java

API v1

  • API version: v1
    • Build date: 2022-03-07T00:51:44.596816+08:00[Asia/Hong_Kong]

DocSpring is a service that helps you fill out and sign PDF templates.

Automatically generated by the OpenAPI Generator

Requirements

Building the API client library requires:

  1. Java 1.8+
  2. Maven (3.8.3+)/Gradle (7.2+)

Installation

To install the API client library to your local Maven repository, simply execute:

mvn clean install

To deploy it to a remote Maven repository instead, configure the settings of the repository and execute:

mvn clean deploy

Refer to the OSSRH Guide for more information.

Maven users

Add this dependency to your project's POM:

<dependency>
  <groupId>com.docspring</groupId>
  <artifactId>docspring-java</artifactId>
  <version>0.1.2</version>
  <scope>compile</scope>
</dependency>

Gradle users

Add this dependency to your project's build file:

  repositories {
    mavenCentral()     // Needed if the 'docspring-java' jar has been published to maven central.
    mavenLocal()       // Needed if the 'docspring-java' jar has been published to the local maven repo.
  }

  dependencies {
     implementation "com.docspring:docspring-java:0.1.2"
  }

Others

At first generate the JAR by executing:

mvn clean package

Then manually install the following JARs:

  • target/docspring-java-0.1.2.jar
  • target/lib/*.jar

Getting Started

Please follow the installation instruction and execute the following Java code:

// Import classes:
import com.docspring.client.ApiClient;
import com.docspring.client.ApiException;
import com.docspring.client.Configuration;
import com.docspring.client.auth.*;
import com.docspring.client.models.*;
import com.docspring.client.api.PdfApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://api.docspring.com/api/v1");
    
    // Configure HTTP basic authorization: api_token_basic
    HttpBasicAuth api_token_basic = (HttpBasicAuth) defaultClient.getAuthentication("api_token_basic");
    api_token_basic.setUsername("YOUR USERNAME");
    api_token_basic.setPassword("YOUR PASSWORD");

    PdfApi apiInstance = new PdfApi(defaultClient);
    String templateId = "tpl_000000000000000002"; // String | 
    AddFieldsData data = new AddFieldsData(); // AddFieldsData | 
    try {
      AddFieldsTemplateResponse result = apiInstance.addFieldsToTemplate(templateId, data);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling PdfApi#addFieldsToTemplate");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Documentation for API Endpoints

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

Class Method HTTP request Description
PdfApi addFieldsToTemplate PUT /templates/{template_id}/add_fields Add new fields to a Template
PdfApi batchGeneratePdfV1 POST /templates/{template_id}/submissions/batch Generates multiple PDFs
PdfApi batchGeneratePdfs POST /submissions/batches Generates multiple PDFs
PdfApi combinePdfs POST /combined_submissions?v=2 Merge submission PDFs, template PDFs, or custom files
PdfApi combineSubmissions POST /combined_submissions Merge generated PDFs together
PdfApi copyTemplate POST /templates/{template_id}/copy Copy a Template
PdfApi createCustomFileFromUpload POST /custom_files Create a new custom file from a cached presign upload
PdfApi createDataRequestToken POST /data_requests/{data_request_id}/tokens Creates a new data request token for form authentication
PdfApi createFolder POST /folders/ Create a folder
PdfApi createHTMLTemplate POST /templates?desc=html Create a new HTML template
PdfApi createPDFTemplate POST /templates Create a new PDF template with a form POST file upload
PdfApi createPDFTemplateFromUpload POST /templates?desc=cached_upload Create a new PDF template from a cached presign upload
PdfApi deleteFolder DELETE /folders/{folder_id} Delete a folder
PdfApi expireCombinedSubmission DELETE /combined_submissions/{combined_submission_id} Expire a combined submission
PdfApi expireSubmission DELETE /submissions/{submission_id} Expire a PDF submission
PdfApi generatePDF POST /templates/{template_id}/submissions Generates a new PDF
PdfApi getCombinedSubmission GET /combined_submissions/{combined_submission_id} Check the status of a combined submission (merged PDFs)
PdfApi getDataRequest GET /data_requests/{data_request_id} Look up a submission data request
PdfApi getFullTemplate GET /templates/{template_id}?full=true Fetch the full template attributes
PdfApi getPresignUrl GET /uploads/presign Get a presigned URL so that you can upload a file to our AWS S3 bucket
PdfApi getSubmission GET /submissions/{submission_id} Check the status of a PDF
PdfApi getSubmissionBatch GET /submissions/batches/{submission_batch_id} Check the status of a submission batch job
PdfApi getTemplate GET /templates/{template_id} Check the status of an uploaded template
PdfApi getTemplateSchema GET /templates/{template_id}/schema Fetch the JSON schema for a template
PdfApi listFolders GET /folders/ Get a list of all folders
PdfApi listSubmissions GET /submissions List all submissions
PdfApi listSubmissionsForTemplate GET /templates/{template_id}/submissions List all submissions for a given template
PdfApi listTemplates GET /templates Get a list of all templates
PdfApi moveFolderToFolder POST /folders/{folder_id}/move Move a folder
PdfApi moveTemplateToFolder POST /templates/{template_id}/move Move Template to folder
PdfApi renameFolder POST /folders/{folder_id}/rename Rename a folder
PdfApi testAuthentication GET /authentication Test Authentication
PdfApi updateDataRequest PUT /data_requests/{data_request_id} Update a submission data request
PdfApi updateTemplate PUT /templates/{template_id} Update a Template

Documentation for Models

Documentation for Authorization

Authentication schemes defined for the API:

api_token_basic

  • Type: HTTP basic authentication

Recommendation

It's recommended to create an instance of ApiClient per thread in a multithreaded environment to avoid any potential issues.

Author

About

DocSpring Java SDK

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages