Documents

Documents (contracts) are the main object of the contract signing domain and are the backbone of Techsign DOC signing workflow. Techsign DOC API allows for complete management of documents (creating, updating, listing etc), thus with correct use and understanding of the corresponding API methods, a third party application can manage document workflows without touching the Techsign DOC Client interface.

Document Basics

A document is basically a PDF File that is uploaded to Techsign DOC to be signed by one or more recipients. Techsign DOC holds this document as a combination of meta data (document object) and the corresponding PDF File. At the end of the workflow, a signed PDF File is created, which can be downloaded for future use or can be queried from Techsign DOC using the document meta data.

_images/DocumentBasic.png

Getting and Listing Document Information

Every document in Techsign DOC has a corresponding UUID (universally unique identifier) and can be queried/handled using this UUID. Getting a document means getting the meta data of the document, ie getting the document data object, and can be completed using the following method:

GET /doc/{docId}

where docId means the UUID of the document. This method returns all relevant document data, which is explained below.

Curl request:

--- SHOW/HIDE ---

Returned data model:

--- SHOW/HIDE ---

Get method can be used when the UUID is known in the workflow, ie when the document is newly created or sent to the user for signing. However, this is not always the case. A user may want to list its documents, in order to select a document to continue with the workflow. In this case, the listing method can be used, with the route:

POST /doc/massdocuments

This route accepts the following data object as POST Body:

--- SHOW/HIDE ---

Curl request:

--- SHOW/HIDE ---

Returns the following result:

--- SHOW/HIDE ---

By adding necessary business filters, such as requesting SIGNED or READY documents with status column, this API method can be used for many different purposes in a typical API integration.

Creating and Updating Documents

Document creation is the first step of a document’s life cycle. A document shall be created before a PDF can be linked to it, and can be updated with recipients and a PDF template to start the signing process.

A document is created with the following method:

POST /doc/create

where a document object is sent as POST Body:

--- SHOW/HIDE ---

Curl request:

--- SHOW/HIDE ---

This method, if successful, returns the UUID of the newly created document, which can be used to further enhance document information or upload a PDF for the document. For document update, the following method is used with the same POST Body:

POST /doc/{docId}/update

Curl request:

--- SHOW/HIDE ---

Create Document From Template

Documents can be easily created by using templates.

The following method is used to create documents from previously created templates:

POST /doc/{templateId}/copyFromTemplate

Curl request:

--- SHOW/HIDE ---

The output of this method is “document id”. In previous parts, document update operation was explained in details. If anyone needs to change recipients or any other things on document, he/she may use document update method.

Managing Document Files (PDFs)

Every document shall be associated with a PDF file in order to be signed. PDF File is the universal carrier of signing proof and is a standalone entity to prove/disprove any signing claim. Signing process is completed on this PDF File and after signing the file can not be changed without marking the signatures invalid.

A PDF is created/updated for a document using the following method:

POST /doc/{docId}/pdf

Curl request:

--- SHOW/HIDE ---

which takes the UUID of the document as route parameter and the PDF File as multipart/form-data.

The current PDF of a document can be queried using the method:

GET /doc/{docId}/pdf

Which returns application/pdf as result.

Curl request:

--- SHOW/HIDE ---

Removing Documents

Documents can be deleted in case of an error or in order to free storage space. Note that after a document is deleted, it only lefts a mark on workflow history and can not be queried/fetched by any means. Both document metadata and PDF file are erased from Techsign DOC servers.

The following method is used to delete documents, with UUID:

DELETE /doc/{docId}

Curl request:

--- SHOW/HIDE ---