Skip to content

DocSpring/docspring-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go API client for docspring

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

Overview

This API client was generated by the OpenAPI Generator project. By using the OpenAPI-spec from a remote server, you can easily generate an API client.

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

Installation

Install the following dependencies:

go get github.com/stretchr/testify/assert
go get golang.org/x/net/context

Put the package under your project folder and add the following in import:

import docspring "github.com/GIT_USER_ID/GIT_REPO_ID"

To use a proxy, set the environment variable HTTP_PROXY:

os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port")

Configuration of Server URL

Default configuration comes with Servers field that contains server objects as defined in the OpenAPI specification.

Select Server Configuration

For using other server than the one defined on index 0 set context value docspring.ContextServerIndex of type int.

ctx := context.WithValue(context.Background(), docspring.ContextServerIndex, 1)

Templated Server URL

Templated server URL is formatted using default variables from configuration or from context value docspring.ContextServerVariables of type map[string]string.

ctx := context.WithValue(context.Background(), docspring.ContextServerVariables, map[string]string{
	"basePath": "v2",
})

Note, enum values are always validated and all unused variables are silently ignored.

URLs Configuration per Operation

Each operation can use different server URL defined using OperationServers map in the Configuration. An operation is uniquely identified by "{classname}Service.{nickname}" string. Similar rules for overriding default operation server index and variables applies by using docspring.ContextOperationServerIndices and docspring.ContextOperationServerVariables context maps.

ctx := context.WithValue(context.Background(), docspring.ContextOperationServerIndices, map[string]int{
	"{classname}Service.{nickname}": 2,
})
ctx = context.WithValue(context.Background(), docspring.ContextOperationServerVariables, map[string]map[string]string{
	"{classname}Service.{nickname}": {
		"port": "8443",
	},
})

Documentation for API Endpoints

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

Class Method HTTP request Description
ClientAPI AddFieldsToTemplate Put /templates/{template_id}/add_fields Add new fields to a Template
ClientAPI BatchGeneratePdfs Post /submissions/batches Generate multiple PDFs
ClientAPI CombinePdfs Post /combined_submissions Merge submission PDFs, template PDFs, or custom files
ClientAPI CopyTemplate Post /templates/{template_id}/copy Copy a template
ClientAPI CreateCustomFileFromUpload Post /custom_files Create a new custom file from a cached S3 upload
ClientAPI CreateDataRequestEvent Post /data_requests/{data_request_id}/events Create a new event for emailing a signee a request for signature
ClientAPI CreateDataRequestToken Post /data_requests/{data_request_id}/tokens Create a new data request token for form authentication
ClientAPI CreateFolder Post /folders/ Create a folder
ClientAPI CreateHtmlTemplate Post /templates?endpoint_variant=create_html_template Create a new HTML template
ClientAPI CreatePdfTemplate Post /templates Create a new PDF template with a form POST file upload
ClientAPI CreatePdfTemplateFromUpload Post /templates?endpoint_variant=create_template_from_cached_upload Create a new PDF template from a cached S3 file upload
ClientAPI DeleteFolder Delete /folders/{folder_id} Delete a folder
ClientAPI DeleteTemplate Delete /templates/{template_id} Delete a template
ClientAPI ExpireCombinedSubmission Delete /combined_submissions/{combined_submission_id} Expire a combined submission
ClientAPI ExpireSubmission Delete /submissions/{submission_id} Expire a PDF submission
ClientAPI GeneratePdf Post /templates/{template_id}/submissions Generate a PDF
ClientAPI GeneratePreview Post /submissions/{submission_id}/generate_preview Generate a preview PDF for partially completed data requests
ClientAPI GetCombinedSubmission Get /combined_submissions/{combined_submission_id} Check the status of a combined submission (merged PDFs)
ClientAPI GetDataRequest Get /data_requests/{data_request_id} Look up a submission data request
ClientAPI GetFullTemplate Get /templates/{template_id}?full=true Fetch the full attributes for a PDF template
ClientAPI GetPresignUrl Get /uploads/presign Get a presigned S3 URL for direct file upload
ClientAPI GetSubmission Get /submissions/{submission_id} Check the status of a PDF
ClientAPI GetSubmissionBatch Get /submissions/batches/{submission_batch_id} Check the status of a submission batch job
ClientAPI GetTemplate Get /templates/{template_id} Check the status of an uploaded template
ClientAPI GetTemplateSchema Get /templates/{template_id}/schema Fetch the JSON schema for a template
ClientAPI ListCombinedSubmissions Get /combined_submissions Get a list of all combined submissions
ClientAPI ListFolders Get /folders/ Get a list of all folders
ClientAPI ListSubmissions Get /submissions List all submissions
ClientAPI ListTemplateSubmissions Get /templates/{template_id}/submissions List all submissions for a given template
ClientAPI ListTemplates Get /templates Get a list of all templates
ClientAPI MoveFolderToFolder Post /folders/{folder_id}/move Move a folder
ClientAPI MoveTemplateToFolder Post /templates/{template_id}/move Move Template to folder
ClientAPI PublishTemplateVersion Post /templates/{template_id}/publish_version Publish a template version
ClientAPI RenameFolder Post /folders/{folder_id}/rename Rename a folder
ClientAPI RestoreTemplateVersion Post /templates/{template_id}/restore_version Restore a template version
ClientAPI TestAuthentication Get /authentication Test authentication
ClientAPI UpdateDataRequest Put /data_requests/{data_request_id} Update a submission data request
ClientAPI UpdateTemplate Put /templates/{template_id} Update a Template
ClientAPI UpdateTemplateDocument Put /templates/{template_id}?endpoint_variant=update_template_pdf_with_form_post Update a template's document with a form POST file upload
ClientAPI UpdateTemplateDocumentFromUpload 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

Example

auth := context.WithValue(context.Background(), docspring.ContextBasicAuth, docspring.BasicAuth{
	UserName: "username",
	Password: "password",
})
r, err := client.Service.Operation(auth, args)

Documentation for Utility Methods

Due to the fact that model structure members are all pointers, this package contains a number of utility functions to easily obtain pointers to values of basic types. Each of these functions takes a value of the given basic type and returns a pointer to it:

  • PtrBool
  • PtrInt
  • PtrInt32
  • PtrInt64
  • PtrFloat
  • PtrFloat32
  • PtrFloat64
  • PtrString
  • PtrTime

Author

About

Go client for the DocSpring API (docspring.com)

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages