Integration - DocTemplate

Single Step Integration

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

Endpoint: https://app.docscloud.io/api/v1/documentgeneration

Method: POST

Request Body:

{
    "auth_id": "available in the profile section",
    "auth_token": "available in the profile section",
    "template_code": "xxxxxxxxxx",
    "attribute-1": "value",
    "attribute-2": "value",
...
}

auth_id: Account identification which remains static for your account.

auth_token: Consider this as a password for your account.

template_code: Unique code for template identification.

attribute: Variables/Images present in your template.

Response:

{
    "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: Date on which the generated document will get deleted from DocsCloud server.

 

Multi Step Integration

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

Step 1: User Authentication

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

Method: POST

Request Query Param:


"auth_id" - "available in the profile section"
"auth_token" - "available in the profile section"

auth_id: Account identification which remains static for your account.

auth_token: Consider this as a password for your account.

Response:

{
    "success": true,
    "data": {
       "auth_user": "xxx"
    },
   "message": "User authentication successful."
}

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

Step 2: Get All Templates

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

Method: POST

Request Header:


"X-AUTH-ID" - "available in the profile section"
"X-AUTH-TOKEN" - "available in the profile section"

X-AUTH-ID: (auth_id) Account identification which remains static for your account.

X-AUTH-TOKEN: (auth_token) Consider this as a password for your account.

Response:

[
    {
       "id": xx,
       "template_title": "xx xxx xxxxxxxx"
    },
...
]

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

Step 3: Generate Document

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

Method: POST

Request Header:


"X-AUTH-ID" - "available in the profile section"
"X-AUTH-TOKEN" - "available in the profile section"

X-AUTH-ID: (auth_id) Account identification which remains static for your account.

X-AUTH-TOKEN: (auth_token) Consider this as a password for your account.

Request Body:

{
  "template_id":"xx",
   "request_variable":{
"attribute-1": "value", "attribute-2": "value",
...
   }
}

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

attribute: Variables present in your template.

Response:

{
    "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: Date on which the generated document will get deleted from DocsCloud server.

 

API Response code

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:

  1. 2xx success status codes confirm that your request worked as expected
  2. 4xx error status codes indicate an error because of the information provided (e.g., a required parameter was omitted)
  3. 5xx error status codes are rare and indicate an error with DocsCloud servers.
Code Message
200

OK - Everything worked as expected.

400

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

401

Unauthorized - 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.