DocSpring provides an API that helps you fill out and sign PDF templates.
This C# SDK is automatically generated by the OpenAPI Generator project:
- API version: v1
- SDK version: 3.1.0
- Generator version: 7.11.0
- Build package: org.openapitools.codegen.languages.CSharpClientCodegen
- .NET Core >=1.0
- .NET Framework >=4.6
- Mono/Xamarin >=vNext
- RestSharp - 112.0.0 or later
- Json.NET - 13.0.2 or later
- JsonSubTypes - 1.8.0 or later
- System.ComponentModel.Annotations - 5.0.0 or later
The DLLs included in the package may not be the latest version. We recommend using NuGet to obtain the latest version of the packages:
Install-Package RestSharp
Install-Package Newtonsoft.Json
Install-Package JsonSubTypes
Install-Package System.ComponentModel.Annotations
NOTE: RestSharp versions greater than 105.1.0 have a bug which causes file uploads to fail. See RestSharp#742. NOTE: RestSharp for .Net Core creates a new socket for each api call, which can lead to a socket exhaustion problem. See RestSharp#1406.
Generate the DLL using your preferred tool (e.g. dotnet build)
Then include the DLL (under the bin folder) in the C# project, and use the namespaces:
using DocSpring.Client.Api;
using DocSpring.Client.Client;
using DocSpring.Client.Model;To use the API client with a HTTP proxy, setup a System.Net.WebProxy
Configuration c = new Configuration();
System.Net.WebProxy webProxy = new System.Net.WebProxy("http://myProxyUrl:80/");
webProxy.Credentials = System.Net.CredentialCache.DefaultCredentials;
c.Proxy = webProxy;using System.Collections.Generic;
using System.Diagnostics;
using DocSpring.Client.Api;
using DocSpring.Client.Client;
using DocSpring.Client.Model;
namespace Example
{
public class Example
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://sync.api.docspring.com/api/v1";
// Configure HTTP basic authorization: api_token_basic
config.Username = "YOUR_USERNAME";
config.Password = "YOUR_PASSWORD";
var apiInstance = new PDFApi(config);
var templateId = tpl_1234567890abcdef02; // string |
var data = new AddFieldsData(); // AddFieldsData |
try
{
// Add new fields to a Template
TemplateAddFieldsResponse result = apiInstance.AddFieldsToTemplate(templateId, data);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling PDFApi.AddFieldsToTemplate: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}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 attributes for a PDF template |
| 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 | PublishTemplateVersion | POST /templates/{template_id}/publish_version | Publish a template version |
| PDFApi | RenameFolder | POST /folders/{folder_id}/rename | Rename a folder |
| PDFApi | RestoreTemplateVersion | POST /templates/{template_id}/restore_version | Restore a template version |
| 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 |
- Model.AddFieldsData
- Model.BatchGeneratePdfs201Response
- Model.CombinePdfsData
- Model.CombinedSubmission
- Model.CombinedSubmissionAction
- Model.CombinedSubmissionData
- Model.CopyTemplateOptions
- Model.CreateCombinedSubmissionResponse
- Model.CreateCustomFileData
- Model.CreateCustomFileResponse
- Model.CreateFolderData
- Model.CreateHtmlSubmissionData
- Model.CreateHtmlTemplate
- Model.CreatePdfSubmissionData
- Model.CreatePdfTemplate
- Model.CreateSubmissionDataRequestData
- Model.CreateSubmissionDataRequestEventRequest
- Model.CreateSubmissionDataRequestEventResponse
- Model.CreateSubmissionDataRequestResponse
- Model.CreateSubmissionDataRequestTokenResponse
- Model.CreateSubmissionResponse
- Model.CustomFile
- Model.ErrorResponse
- Model.Folder
- Model.JsonSchema
- Model.ListSubmissionsResponse
- Model.MoveFolderData
- Model.MoveTemplateData
- Model.MultipleErrorsResponse
- Model.PublishVersionData
- Model.RenameFolderData
- Model.RestoreVersionData
- Model.Submission
- Model.SubmissionAction
- Model.SubmissionBatch
- Model.SubmissionBatchData
- Model.SubmissionBatchWithSubmissions
- Model.SubmissionDataRequest
- Model.SubmissionDataRequestEvent
- Model.SubmissionDataRequestShow
- Model.SubmissionDataRequestToken
- Model.SubmissionPreview
- Model.SuccessErrorResponse
- Model.SuccessMultipleErrorsResponse
- Model.Template
- Model.TemplateAddFieldsResponse
- Model.TemplateDeleteResponse
- Model.TemplatePreview
- Model.TemplatePublishVersionResponse
- Model.UpdateHtmlTemplate
- Model.UpdateSubmissionDataRequestData
- Model.UploadPresignResponse
Authentication schemes defined for the API:
- Type: HTTP basic authentication