DocSpring provides an API that helps you fill out and sign PDF templates.
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: 2.0.1
- Generator version: 7.11.0
- Build package: org.openapitools.codegen.languages.GoClientCodegen
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")
Default configuration comes with Servers
field that contains server objects as defined in the OpenAPI specification.
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 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.
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",
},
})
All URIs are relative to https://sync.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 | 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 | CreateDataRequestEvent | Post /data_requests/{data_request_id}/events | Creates a new event for emailing a signee a request for signature |
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?endpoint_description=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?endpoint_description=cached_upload | Create a new PDF template from a cached presign upload |
PDFAPI | DeleteFolder | Delete /folders/{folder_id} | Delete a folder |
PDFAPI | DeleteTemplate | Delete /templates/{template_id} | Delete a template |
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 | GeneratePdfForHtmlTemplate | Post /templates/{template_id}/submissions?endpoint_description=html_templates | Generates a new PDF for an HTML template |
PDFAPI | GeneratePreview | Post /submissions/{submission_id}/generate_preview | Generated a preview PDF for partially completed data requests |
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 | ListCombinedSubmissions | Get /combined_submissions | Get a list of all combined submissions |
PDFAPI | ListFolders | Get /folders/ | Get a list of all folders |
PDFAPI | ListSubmissions | Get /submissions | List all submissions |
PDFAPI | ListTemplateSubmissions | 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 |
- AddFieldsData
- BatchGeneratePdfs201Response
- CombinePdfsData
- CombinedSubmission
- CombinedSubmissionAction
- CombinedSubmissionData
- CopyTemplateOptions
- CreateCombinedSubmissionResponse
- CreateCustomFileData
- CreateCustomFileResponse
- CreateFolderData
- CreateHtmlSubmissionData
- CreateHtmlTemplate
- CreatePdfSubmissionData
- CreatePdfTemplate
- CreateSubmissionDataRequestData
- CreateSubmissionDataRequestEventRequest
- CreateSubmissionDataRequestEventResponse
- CreateSubmissionDataRequestResponse
- CreateSubmissionDataRequestTokenResponse
- CreateSubmissionResponse
- CustomFile
- ErrorResponse
- Folder
- JsonSchema
- ListSubmissionsResponse
- MoveFolderData
- MoveTemplateData
- MultipleErrorsResponse
- RenameFolderData
- Submission
- SubmissionAction
- SubmissionBatch
- SubmissionBatchData
- SubmissionBatchWithSubmissions
- SubmissionDataRequest
- SubmissionDataRequestEvent
- SubmissionDataRequestShow
- SubmissionDataRequestToken
- SubmissionPreview
- SuccessErrorResponse
- SuccessMultipleErrorsResponse
- Template
- TemplateAddFieldsResponse
- TemplatePreview
- UpdateHtmlTemplate
- UpdateSubmissionDataRequestData
- UploadPresignResponse
Authentication schemes defined for the API:
- 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)
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