Templates API

Deprecation notice❗️

Below APIs are deprecated and new version of APIs are available at https://dashboard.docupilot.app/api-docs/swagger-ui/

Get list of Templates

GET https://api.docupilot.app/api/v1/templates

This endpoint allows you to get templates in home folder. You can add filter or folder query params for more desired results.

Query Parameters

NameTypeDescription

folder

number

Folder ID

filter

string

Possible Values are all | trash

Headers

NameTypeDescription

apikey

string

API Key

{
  "status": "success",
  "data": [
    {
      "id": 1170,
      "title": "Google Forms Dynamic Image",
      "description": "Students Certificate",
      "folder": null,
      "type": "docx",
      "document_status": "test",
      "created_time": "2018-11-07T17:26:10.375Z",
      "output_file_name": "Google Forms{{name}}",
      "output_type": "pdf",
      "timezone": "Pacific/Midway"
    },
    {
      "id": 1171,
      "title": "Zoho Forms",
      "description": "Students Certificate",
      "folder": null,
      "type": "pptx",
      "document_status": "test",
      "created_time": "2018-11-07T17:26:10.375Z",
      "output_file_name": "Google Forms{{name}}",
      "output_type": "pptx",
      "timezone": "Pacific/Midway"
    }
  ]
}

Get a Template

GET https://api.docupilot.app/api/v1/templates/:id

This endpoint allows you to get details of each template.

Path Parameters

NameTypeDescription

id

integer

Template ID

Headers

NameTypeDescription

apikey

string

API Key

{
  "status": "success",
  "data": {
    "id": 1170,
    "title": "Google Forms Dynamic Image",
    "description": "Students Certificate",
    "folder": null,
    "type": "docx",
    "document_status": "active",
    "created_time": "2018-11-07T17:26:10.375Z",
    "output_file_name": "certificate - {{name}}",
    "output_type": "pdf",
    "timezone": "Pacific/Midway"
  }
}

Create a new Template

POST https://api.docupilot.app/api/v1/templates

This endpoint allows you to create a new template.

Headers

NameTypeDescription

Content-Type

string

application/json

apikey

string

API Key

Request Body

NameTypeDescription

output_file_name

string

File name for the generated document. Example : Certificate - {{name}}

folder

string

Folder ID

document_status

string

Allowed values test | active. Default : test

description

string

Description for the template

type

string

Allowed values html | docx | pptx | xlsx | fillable_pdf Default : html

title

string

Title for the template

Update a Template

PUT https://api.docupilot.app/api/v1/templates/:id

This endpoint allows you to update a template

Headers

NameTypeDescription

apikey

string

API Key

Content-Type

string

application/json

Request Body

NameTypeDescription

title

string

Title for the template

description

string

Description for the template

document_status

string

Allowed values test | active

folder

string

Folder ID

output_file_name

string

File name for the generated document. Example : Certificate - {{name}}

Delete template

DELETE https://api.docupilot.app/api/v1/templates/:id

The template will be moved to Trash and will be deleted permanently after 30 days

Query Parameters

NameTypeDescription

id*

String

Template ID

Headers

NameTypeDescription

apikey*

String

API Key

{
    // Response
}

Add / Update Template Content

POST https://api.docupilot.app/api/v1/templates/:id/content

This end point allows you to add or update template content.

Path Parameters

NameTypeDescription

id

string

Template ID

Headers

NameTypeDescription

apikey

string

API Key

Request Body

NameTypeDescription

file

object

DOCX, PPTX, XlSX, Fillable_PDF file

{
  "status": "success",
  "data": null
}

Get Schema for a template

GET https://api.docupilot.app/api/v1/templates/:id/schema

This endpoint allows you to get token details of the template.

Path Parameters

NameTypeDescription

id

integer

Template ID

Headers

NameTypeDescription

apikey

string

API Key

{
  "status": "success",
  "data": {
    "schema": [
      {
        "name": "invoice_number",
        "type": "string"
      },
      {
        "name": "client_name",
        "type": "string"
      },
      {
        "name": "client_address",
        "type": "string"
      },
      {
        "name": "client_state",
        "type": "string"
      },
      {
        "name": "client_country",
        "type": "string"
      },
      {
        "name": "client_zipcode",
        "type": "string"
      },
      {
        "name": "status",
        "type": "string"
      },
      {
        "name": "orders",
        "type": "array",
        "fields": [
          {
            "name": "item",
            "type": "string"
          },
          {
            "name": "price",
            "type": "string"
          },
          {
            "name": "quantity",
            "type": "string"
          },
          {
            "name": "total",
            "type": "string"
          }
        ],
        "generics": "object"
      }
    ]
  }
}

Merge a document

POST https://api.docupilot.app/api/v1/templates/:id/merge

This endpoint allows you to create a new document from a template.

Path Parameters

NameTypeDescription

id

string

Template ID

Headers

NameTypeDescription

Content-Type

string

application/json

apikey

string

API Key

Request Body

NameTypeDescription

user_email

string

John@example.com

name

string

John

{
  "status": "success",
  "data": {
    "file_url": "https://docupilot-documents.s3.amazonaws.com/temp/1/e419595c-d709-455b-9acd-1109eb09baec/certificate%20-%202019-04-05.docx?AWSAccessKeyId=AKIAJTKZBQI56EOPGLFQ&Signature=PRedVHdjK0oE0oEYH5hi%2B8Ein%2FY%3D&Expires=1554549057",
    "file_name": "certificate - 2019-04-05.docx"
  }
}

The body parameters for Merge API depends on the tokens configured in the document.

Last updated