Skip to content

Repository files navigation

DocSpring

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

Installation & Usage

Requirements

PHP 8.1 and later.

Composer

To install the bindings via Composer, add the following to composer.json:

{
"repositories": [
{
"type": "vcs",
"url": "https://github.com/docspring/docspring.git"
}
],
"require": {
"docspring/docspring": "*@dev"
}
}

Then run composer install

Manual Installation

Download the files and include autoload.php:

<?phprequire_once('/path/to/DocSpring/vendor/autoload.php');

Getting Started

Please follow the installation procedure and then run the following:

<?phprequire_once(__DIR__ . '/vendor/autoload.php');
// Configure HTTP basic authorization: api_token_basic$config = DocSpring\Configuration::getDefaultConfiguration()
->setUsername('YOUR_USERNAME')
->setPassword('YOUR_PASSWORD');
$apiInstance = newDocSpring\Api\Client(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.// This is optional, `GuzzleHttp\Client` will be used as default.newGuzzleHttp\Client(),
$config
);
$template_id = tpl_1234567890abcdef02; // string$data = new \DocSpring\Model\AddFieldsData(); // \DocSpring\Model\AddFieldsDatatry {
$result = $apiInstance->addFieldsToTemplate($template_id, $data);
print_r($result);
} catch (Exception$e) {
echo'Exception when calling Client->addFieldsToTemplate: ', $e->getMessage(), PHP_EOL;
}

API Endpoints

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

ClassMethodHTTP requestDescription
ClientaddFieldsToTemplatePUT /templates/{template_id}/add_fieldsAdd new fields to a Template
ClientbatchGeneratePdfsPOST /submissions/batchesGenerate multiple PDFs
ClientcombinePdfsPOST /combined_submissionsMerge submission PDFs, template PDFs, or custom files
ClientcopyTemplatePOST /templates/{template_id}/copyCopy a template
ClientcreateCustomFileFromUploadPOST /custom_filesCreate a new custom file from a cached S3 upload
ClientcreateDataRequestEventPOST /data_requests/{data_request_id}/eventsCreate a new event for emailing a signee a request for signature
ClientcreateDataRequestTokenPOST /data_requests/{data_request_id}/tokensCreate a new data request token for form authentication
ClientcreateFolderPOST /folders/Create a folder
ClientcreateHtmlTemplatePOST /templates?endpoint_variant=create_html_templateCreate a new HTML template
ClientcreatePdfTemplatePOST /templatesCreate a new PDF template with a form POST file upload
ClientcreatePdfTemplateFromUploadPOST /templates?endpoint_variant=create_template_from_cached_uploadCreate a new PDF template from a cached S3 file upload
ClientdeleteFolderDELETE /folders/{folder_id}Delete a folder
ClientdeleteTemplateDELETE /templates/{template_id}Delete a template
ClientexpireCombinedSubmissionDELETE /combined_submissions/{combined_submission_id}Expire a combined submission
ClientexpireSubmissionDELETE /submissions/{submission_id}Expire a PDF submission
ClientgeneratePdfPOST /templates/{template_id}/submissionsGenerate a PDF
ClientgeneratePreviewPOST /submissions/{submission_id}/generate_previewGenerate a preview PDF for partially completed data requests
ClientgetCombinedSubmissionGET /combined_submissions/{combined_submission_id}Check the status of a combined submission (merged PDFs)
ClientgetDataRequestGET /data_requests/{data_request_id}Look up a submission data request
ClientgetFullTemplateGET /templates/{template_id}?full=trueFetch the full attributes for a PDF template
ClientgetPresignUrlGET /uploads/presignGet a presigned S3 URL for direct file upload
ClientgetSubmissionGET /submissions/{submission_id}Check the status of a PDF
ClientgetSubmissionBatchGET /submissions/batches/{submission_batch_id}Check the status of a submission batch job
ClientgetTemplateGET /templates/{template_id}Check the status of an uploaded template
ClientgetTemplateSchemaGET /templates/{template_id}/schemaFetch the JSON schema for a template
ClientlistCombinedSubmissionsGET /combined_submissionsGet a list of all combined submissions
ClientlistFoldersGET /folders/Get a list of all folders
ClientlistSubmissionsGET /submissionsList all submissions
ClientlistTemplateSubmissionsGET /templates/{template_id}/submissionsList all submissions for a given template
ClientlistTemplatesGET /templatesGet a list of all templates
ClientmoveFolderToFolderPOST /folders/{folder_id}/moveMove a folder
ClientmoveTemplateToFolderPOST /templates/{template_id}/moveMove Template to folder
ClientpublishTemplateVersionPOST /templates/{template_id}/publish_versionPublish a template version
ClientrenameFolderPOST /folders/{folder_id}/renameRename a folder
ClientrestoreTemplateVersionPOST /templates/{template_id}/restore_versionRestore a template version
ClienttestAuthenticationGET /authenticationTest authentication
ClientupdateDataRequestPUT /data_requests/{data_request_id}Update a submission data request
ClientupdateTemplatePUT /templates/{template_id}Update a Template
ClientupdateTemplateDocumentPUT /templates/{template_id}?endpoint_variant=update_template_pdf_with_form_postUpdate a template's document with a form POST file upload
ClientupdateTemplateDocumentFromUploadPUT /templates/{template_id}?endpoint_variant=update_template_pdf_with_cached_uploadUpdate a template's document with a cached S3 file upload

Models

Authorization

Authentication schemes defined for the API:

api_token_basic

  • Type: HTTP basic authentication

Tests

To run the tests, use:

composer install
vendor/bin/phpunit

Author

About this package

This PHP package is automatically generated by the OpenAPI Generator project:

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

About

PHP API Client for DocSpring

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages