Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

6 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.1
  • 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

ClassMethodHTTP requestDescription
ClientAPIAddFieldsToTemplatePut /templates/{template_id}/add_fieldsAdd new fields to a Template
ClientAPIBatchGeneratePdfsPost /submissions/batchesGenerate multiple PDFs
ClientAPICombinePdfsPost /combined_submissionsMerge submission PDFs, template PDFs, or custom files
ClientAPICopyTemplatePost /templates/{template_id}/copyCopy a template
ClientAPICreateCustomFileFromUploadPost /custom_filesCreate a new custom file from a cached S3 upload
ClientAPICreateDataRequestEventPost /data_requests/{data_request_id}/eventsCreate a new event for emailing a signee a request for signature
ClientAPICreateDataRequestTokenPost /data_requests/{data_request_id}/tokensCreate a new data request token for form authentication
ClientAPICreateFolderPost /folders/Create a folder
ClientAPICreateHtmlTemplatePost /templates?endpoint_variant=create_html_templateCreate a new HTML template
ClientAPICreatePdfTemplatePost /templatesCreate a new PDF template with a form POST file upload
ClientAPICreatePdfTemplateFromUploadPost /templates?endpoint_variant=create_template_from_cached_uploadCreate a new PDF template from a cached S3 file upload
ClientAPIDeleteFolderDelete /folders/{folder_id}Delete a folder
ClientAPIDeleteTemplateDelete /templates/{template_id}Delete a template
ClientAPIExpireCombinedSubmissionDelete /combined_submissions/{combined_submission_id}Expire a combined submission
ClientAPIExpireSubmissionDelete /submissions/{submission_id}Expire a PDF submission
ClientAPIGeneratePdfPost /templates/{template_id}/submissionsGenerate a PDF
ClientAPIGeneratePreviewPost /submissions/{submission_id}/generate_previewGenerate a preview PDF for partially completed data requests
ClientAPIGetCombinedSubmissionGet /combined_submissions/{combined_submission_id}Check the status of a combined submission (merged PDFs)
ClientAPIGetDataRequestGet /data_requests/{data_request_id}Look up a submission data request
ClientAPIGetFullTemplateGet /templates/{template_id}?full=trueFetch the full attributes for a PDF template
ClientAPIGetPresignUrlGet /uploads/presignGet a presigned S3 URL for direct file upload
ClientAPIGetSubmissionGet /submissions/{submission_id}Check the status of a PDF
ClientAPIGetSubmissionBatchGet /submissions/batches/{submission_batch_id}Check the status of a submission batch job
ClientAPIGetTemplateGet /templates/{template_id}Check the status of an uploaded template
ClientAPIGetTemplateSchemaGet /templates/{template_id}/schemaFetch the JSON schema for a template
ClientAPIListCombinedSubmissionsGet /combined_submissionsGet a list of all combined submissions
ClientAPIListFoldersGet /folders/Get a list of all folders
ClientAPIListSubmissionsGet /submissionsList all submissions
ClientAPIListTemplateSubmissionsGet /templates/{template_id}/submissionsList all submissions for a given template
ClientAPIListTemplatesGet /templatesGet a list of all templates
ClientAPIMoveFolderToFolderPost /folders/{folder_id}/moveMove a folder
ClientAPIMoveTemplateToFolderPost /templates/{template_id}/moveMove Template to folder
ClientAPIPublishTemplateVersionPost /templates/{template_id}/publish_versionPublish a template version
ClientAPIRenameFolderPost /folders/{folder_id}/renameRename a folder
ClientAPIRestoreTemplateVersionPost /templates/{template_id}/restore_versionRestore a template version
ClientAPITestAuthenticationGet /authenticationTest authentication
ClientAPIUpdateDataRequestPut /data_requests/{data_request_id}Update a submission data request
ClientAPIUpdateTemplatePut /templates/{template_id}Update a Template
ClientAPIUpdateTemplateDocumentPut /templates/{template_id}?endpoint_variant=update_template_pdf_with_form_postUpdate a template's document with a form POST file upload
ClientAPIUpdateTemplateDocumentFromUploadPut /templates/{template_id}?endpoint_variant=update_template_pdf_with_cached_uploadUpdate 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

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages