DocSpring is a service 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: 2.0.0
- Generator version: 7.11.0
- Build package: com.docspring.codegen.DocSpringCSharpClientCodegen
- .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://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_000000000000000002; // string |
var data = new AddFieldsData(); // AddFieldsData |
try
{
// Add new fields to a Template
AddFieldsTemplateResponse 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://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 | 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?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 | 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 | 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 | 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.AddFieldsTemplateResponse
- Model.AuthenticationError
- Model.AuthenticationSuccessResponse
- Model.CombinePdfsData
- Model.CombinedSubmission
- Model.CombinedSubmissionAction
- Model.CombinedSubmissionData
- Model.CopyTemplateData
- Model.CreateCombinedSubmissionResponse
- Model.CreateCustomFileData
- Model.CreateCustomFileResponse
- Model.CreateFolderAttributes
- Model.CreateFolderData
- Model.CreateHtmlTemplateData
- Model.CreateSubmissionBatchResponse
- Model.CreateSubmissionBatchSubmissionsResponse
- Model.CreateSubmissionData
- Model.CreateSubmissionDataRequestData
- Model.CreateSubmissionDataRequestEventRequest
- Model.CreateSubmissionDataRequestEventResponse
- Model.CreateSubmissionDataRequestTokenResponse
- Model.CreateSubmissionResponse
- Model.CreateTemplateFromUploadData
- Model.DataRequestToken
- Model.DeleteTemplateResponse
- Model.ErrorResponse
- Model.Folder
- Model.FullTemplate
- Model.HtmlTemplateData
- Model.HtmlTemplateDataWebhookOptions
- Model.InvalidRequest
- Model.InvalidRequestSingleError
- Model.ListSubmissionsResponse
- Model.MoveFolderData
- Model.MoveTemplateData
- Model.PendingTemplate
- Model.PreviewPdfResponse
- Model.PublishTemplateVersion404Response
- Model.PublishTemplateVersion422Response
- Model.PublishTemplateVersionResponse
- Model.PublishTemplateVersionResponseResult
- Model.PublishVersionData
- Model.RenameFolderData
- Model.RestoreTemplateVersionResponse
- Model.RestoreVersionData
- Model.Submission
- Model.SubmissionAction
- Model.SubmissionBatch
- Model.SubmissionBatchData
- Model.SubmissionData
- Model.SubmissionDataBatchRequest
- Model.SubmissionDataRequest
- Model.SubmissionDataRequestEvent
- Model.Template
- Model.TemplateData
- Model.TemplateDefaults
- Model.TemplateDocument
- Model.TemplateDocumentMetadata
- Model.TemplateSchema
- Model.UpdateDataRequestResponse
- Model.UpdateSubmissionDataRequestData
- Model.UpdateTemplateData
- Model.UpdateTemplateResponse
- Model.UploadPresign
- Model.UploadTemplateData
Authentication schemes defined for the API:
- Type: HTTP basic authentication