Skip to content

DocSpring/docspring-python

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.

This Python 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.PythonClientCodegen

Requirements.

Python 3.9+

Installation & Usage

pip install

If the python package is hosted on a repository, you can install directly using:

pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git

(you may need to run pip with root permission: sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git)

Then import the package:

import docspring

Setuptools

Install via Setuptools.

python setup.py install --user

(or sudo python setup.py install to install the package for all users)

Then import the package:

import docspring

Tests

Execute pytest to run the tests.

Getting Started

Please follow the installation procedure and then run the following:

import docspring
from docspring.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://sync.api.docspring.com/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = docspring.Configuration(
    host = "https://sync.api.docspring.com/api/v1"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure HTTP basic authorization: api_token_basic
configuration = docspring.Configuration(
    username = os.environ["USERNAME"],
    password = os.environ["PASSWORD"]
)


# Enter a context with an instance of the API client
with docspring.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = docspring.Client(api_client)
    template_id = 'tpl_1234567890abcdef02' # str | 
    data = docspring.AddFieldsData() # AddFieldsData | 

    try:
        # Add new fields to a Template
        api_response = api_instance.add_fields_to_template(template_id, data)
        print("The response of Client->add_fields_to_template:\n")
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling Client->add_fields_to_template: %s\n" % e)

Documentation for API Endpoints

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

Class Method HTTP request Description
Client add_fields_to_template PUT /templates/{template_id}/add_fields Add new fields to a Template
Client batch_generate_pdfs POST /submissions/batches Generate multiple PDFs
Client combine_pdfs POST /combined_submissions Merge submission PDFs, template PDFs, or custom files
Client copy_template POST /templates/{template_id}/copy Copy a template
Client create_custom_file_from_upload POST /custom_files Create a new custom file from a cached S3 upload
Client create_data_request_event POST /data_requests/{data_request_id}/events Create a new event for emailing a signee a request for signature
Client create_data_request_token POST /data_requests/{data_request_id}/tokens Create a new data request token for form authentication
Client create_folder POST /folders/ Create a folder
Client create_html_template POST /templates?endpoint_variant=create_html_template Create a new HTML template
Client create_pdf_template POST /templates Create a new PDF template with a form POST file upload
Client create_pdf_template_from_upload POST /templates?endpoint_variant=create_template_from_cached_upload Create a new PDF template from a cached S3 file upload
Client delete_folder DELETE /folders/{folder_id} Delete a folder
Client delete_template DELETE /templates/{template_id} Delete a template
Client expire_combined_submission DELETE /combined_submissions/{combined_submission_id} Expire a combined submission
Client expire_submission DELETE /submissions/{submission_id} Expire a PDF submission
Client generate_pdf POST /templates/{template_id}/submissions Generate a PDF
Client generate_preview POST /submissions/{submission_id}/generate_preview Generate a preview PDF for partially completed data requests
Client get_combined_submission GET /combined_submissions/{combined_submission_id} Check the status of a combined submission (merged PDFs)
Client get_data_request GET /data_requests/{data_request_id} Look up a submission data request
Client get_full_template GET /templates/{template_id}?full=true Fetch the full attributes for a PDF template
Client get_presign_url GET /uploads/presign Get a presigned S3 URL for direct file upload
Client get_submission GET /submissions/{submission_id} Check the status of a PDF
Client get_submission_batch GET /submissions/batches/{submission_batch_id} Check the status of a submission batch job
Client get_template GET /templates/{template_id} Check the status of an uploaded template
Client get_template_schema GET /templates/{template_id}/schema Fetch the JSON schema for a template
Client list_combined_submissions GET /combined_submissions Get a list of all combined submissions
Client list_folders GET /folders/ Get a list of all folders
Client list_submissions GET /submissions List all submissions
Client list_template_submissions GET /templates/{template_id}/submissions List all submissions for a given template
Client list_templates GET /templates Get a list of all templates
Client move_folder_to_folder POST /folders/{folder_id}/move Move a folder
Client move_template_to_folder POST /templates/{template_id}/move Move Template to folder
Client publish_template_version POST /templates/{template_id}/publish_version Publish a template version
Client rename_folder POST /folders/{folder_id}/rename Rename a folder
Client restore_template_version POST /templates/{template_id}/restore_version Restore a template version
Client test_authentication GET /authentication Test authentication
Client update_data_request PUT /data_requests/{data_request_id} Update a submission data request
Client update_template PUT /templates/{template_id} Update a Template
Client update_template_document PUT /templates/{template_id}?endpoint_variant=update_template_pdf_with_form_post Update a template's document with a form POST file upload
Client update_template_document_from_upload PUT /templates/{template_id}?endpoint_variant=update_template_pdf_with_cached_upload Update 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

Author

About

Python API Client for DocSpring

Resources

License

Stars

Watchers

Forks

Packages

No packages published