Published using Google Docs
DocsCloud - API Integration
Updated automatically every 5 minutes

API Specification Document

DocsCloud.io

Version

Date

Author

Description

2.0

10-July-2021

Docscloud Tech Team

Initial documentation

2.1

12-Aug-2021

Docscloud Tech Team

Revised documentation

2.2

27-Dec-2022

Docscloud Tech Team

Added dynamic table variable details

Document Generation - DocTemplate (With Authentication & Template Variable List)

DocsCloud allows users to opt for a more structured way to integrate their business applications.

User Authentication

Request Body

Method

URL            

POST

https://app.docscloud.io/api/v2/get-user-authentication

Type

Params

Values

POST

POST

auth_id

auth_token

string

string

mandatory

mandatory

auth_id: Authentication ID. This remains constant for your account. You can find this in your profile section.

auth_token: Authentication token. Consider this as a password for your account. You can find this in your profile section.

Response

Status

Response

200

{

    "success": true,

    "data": {

       "auth_user": "xxx"

    },

   "message": "User authentication successful."

}

On successful authentication, you will receive a success message else a failure message.

Get List of All Templates

Request Body

Method

URL            

POST

https://app.docscloud.io/api/v2/get-all-templates

Type

Params

Values

POST

POST

X-AUTH-ID

X-AUTH-TOKEN

string

string

mandatory

mandatory

X-AUTH-ID: Authentication ID. This remains constant for your account. You can find this in your profile section.

X-AUTH-TOKEN: Authentication token. Consider this as a password for your account. You can find this in your profile section.

Note: Pass these values in the header.

Response

Status

Response

200

[

    {

       "id": xx,

       "template_title": "xx xxx xxxxxxxx"

    },

   ...

]

List of all the active templates in an array. For each template, you will get a unique ID (numeric) and the template name.

Generate Document

Request Body

Method

URL            

POST

 https://app.docscloud.io/api/v2/documentgeneration-for-plugin

Type

Params

Values

POST

POST

template_id, attribute-1,attribute-2 & so on …

Example: -

 "attribute1",

 "attribute2",

 "attribute3",

 "table_variables.table1.0.var1",

 "table_variables.table1.0.var2",

 "table_variables.table1.0.var3",

 "table_variables.table1.1.var1",

 "table_variables.table1.1.var2",

 "table_variables.table1.1.var3",

 "table_variables.table2.0.var1",

 "table_variables.table2.0.var2",

 "table_variables.table2.0.var3"

string

String

For dynamic table you can follow the name

table_variables.tablename.rownumber.attributename

mandatory

mandatory

template_id: Unique template ID (received in step 2) for template identification.

attribute: Variables present in your template.

Response

Status

Response

200

{

    "success": true,

    "data": {

       "document_name": "xx.....x",

        "document_type": "pdf/docx/png/jpeg",

        "document_url": "https://.../xx.....x"

        "delete_date": "YYYY-MM-DD"

    },

    "message": "Document generated successfully."

}

document_name: Name of the generated document.

document_type: File type of the generated document. Valid values are - PDF, DOCX, PNG, JPEG

document_url: Public URL of the generated document.

delete_date: The date on which the generated copy will get deleted from the DocsCloud server.

Document Generation - DocTemplate (Single Step)

DocsCloud allows you to generate the filled document through a single API request.

Request Body

Method

URL            

POST

https://app.docscloud.io/api/v2/documentgeneration

Type

Params

Values

POST

POST

POST

POST

POST

auth_id

auth_token

template_code

reference_no

attribute-1, attribute-2 & so on …

Example: -

 "attribute1",

 "attribute2",

 "attribute13",

“table_variables.table1.0.var1”,

“table_variables.table1.0.var2”,

“table_variables.table1.0.var3”,

“table_variables.table1.1.var1”,

“table_variables.table1.1.var2”,

“table_variables.table1.1.var3”,

“table_variables.table2.0.var1”,

“table_variables.table2.0.var2”,

“table_variables.table2.0.var3”

string

string

string

string

string

For dynamic table you can follow the name

 table_variables.tablename.rownumber.attributename

mandatory

mandatory

mandatory

optional

mandatory

auth_id: Authentication ID. This remains constant for your account. You can find this in your profile section.

auth_token: Authentication token. Consider this as a password for your account. You can find this in your profile section.

template_code: Unique code for template identification.

reference_no: Optional - Reference Number of request identification. You will receive the same number in the output response.

attribute: Variables/Images present in your template.

Response

Status

Response

200

{

    "success": true,

    "data": {

        "document_name": "xxxxxxxx",

        "document_type": "xxxxx",

        "delete_date": "xxxxxxxx",

        "document_url": "xxxxxxx",

        "reference_no": "xxxx"

    },

    "message": "Document generated successfully."

}

Grouped Document Generation - DocTemplate

DocsCloud allows you to generate a group of the filled document through a single API request.

Request Body

Method

URL            

POST

https://app.docscloud.io/api/v2/groupdocumentgeneration

Type

Params

Values

POST

POST

POST

POST

POST

auth_id

auth_token

group_code

reference_no

attribute-1, attribute-2 & so on ...

Example: -

 "attribute1",

 "attribute2",

 "attribute13",

“table_variables.table1.0.var1”,

“table_variables.table1.0.var2”,

“table_variables.table1.0.var3”,

“table_variables.table1.1.var1”,

“table_variables.table1.1.var2”,

“table_variables.table1.1.var3”,

“table_variables.table2.0.var1”,

“table_variables.table2.0.var2”,

“table_variables.table2.0.var3”

string

string

string

string

string

For dynamic table you can follow name

table_variables.tablename.rownumber.attributename

mandatory

mandatory

mandatory

optional

mandatory

auth_id: Authentication ID. This remains constant for your account. You can find this in your profile section.

auth_token: Authentication token. Consider this as a password for your account. You can find this in your profile section.

group_code: Unique code for group identification.

reference_no: Optional - Reference Number of request identification. You will receive the same number in the output response.

attribute: Variables/Images present in your template.

Response

Status

Response

200

{

    "success": true,

    "data": {

    },

    "message": "Document generated successfully."

}

Text Extract - DocExtractor

DocCloud allows you to extract the data from input documents and POST the extracted data on a preferred WebhookBy design, the API response is asynchronous. We typically POST the information on the webhook provided in the input request within a couple of seconds. In API requests, a maximum document size of 10MB is allowed.

Request Body

Method

URL            

POST

https://app.docscloud.io/api/v2/documentextractor

Type

Params

Values

POST

POST

POST

POST

POST

POST

POST

POST

auth_id

auth_token

ref_no

file_path

select_pages

file_type

webhook_url

output_format

string

string

string

string

string

string

string

string

mandatory

mandatory

optional

mandatory

optional

mandatory

optional

optional

auth_id: Authentication ID. This remains constant for your account. You can find this in your profile section.

auth_token: Authentication token. Consider this as a password for your account. You can find this in your profile section.

ref_no: Optional - Reference Number of request identification. You will receive the same number in the output response.

file_path: An input file path.

 

select_pages: Comma separate page number for data extraction.

file_type: Input file formats. Valid values - png/pdf/jpeg.

webhook_url: Webhook when the output response should be delivered.

output_format: Required format of the output file.

Here is the list of output formats that can be requested along with the valid values,

Value: "1" - Output data in JSON,

Value: "2" - Output data in CSV,

Value: "3" - Output data in DOCX,

Value: "4" - Output data in HTML,

Value: "5" - Output data as ZIP folder (having JSON, CSV, DOCX & HTML files)

Asynchronous Response

Status

Response

200

response:{

    "success": true,

    "data": [],

    "message": "Task Completed Successfully."

}

Webhook Response

Status

Response

200

{

  "file_url": "xxxxx",

  "ref_no": "xxxx",

  "file_type": "xxxx",

  "delete_date": "xxxx"

}

Error Status Codes

DocsCloud uses HTTP response status codes to indicate the success or failure of your API requests. If your request fails, DocsCloud returns an error using the appropriate status code. In general, there are three status code ranges you can expect:

All status codes are standard HTTP status codes. The below ones are used in this API.

2XX - success status codes confirm that your request worked as expected

4XX - error status codes indicate an error because of the information provided (e.g., a required parameter was omitted)

5XX - error status codes are rare and indicate an error with DocsCloud servers.

Status Code

Description

200

OK - Everything worked as expected.

400

Bad Request - The request was unacceptable, often due to missing a required parameter.

401

Unauthorised - No valid API key provided.

402

Request Failed - The parameters were valid, but the request failed.

403

Forbidden - The API key doesn't have permissions to perform the request.

404

Not Found - The requested resource doesn't exist.

409

Conflict - The request conflicts with another request (perhaps due to using the same idempotent key).

429

Too Many Requests - Too many requests hit the API too quickly. We recommend an exponential backoff of your requests.

500/2/3/4

Server Errors - Something went wrong on DocsCloud's end.