Templates API

get
Get list of Templates

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.
Request
Response
Headers
apikey
required
string
API Key
Query Parameters
folder
optional
number
Folder ID
filter
optional
string
Possible Values are all | trash
200: OK
Cake successfully retrieved.
{
"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
Get a Template

https://api.docupilot.app/api/v1/templates/:id
This endpoint allows you to get details of each template.
Request
Response
Path Parameters
id
required
integer
Template ID
Headers
apikey
required
string
API Key
200: OK
{
"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"
}
}

post
Create a new Template

https://api.docupilot.app/api/v1/templates
This endpoint allows you to create a new template.
Request
Response
Headers
Content-Type
required
string
application/json
apikey
required
string
API Key
Body Parameters
output_file_name
optional
string
File name for the generated document. Example : Certificate - {{name}}
folder
optional
string
Folder ID
document_status
optional
string
Allowed values test | active. Default : test
description
optional
string
Description for the template
type
required
string
Allowed values html | docx | pptx | xlsx | fillable_pdf Default : html
title
required
string
Title for the template
200: OK

post
Add / Update Template Content

https://api.docupilot.app/api/v1/templates/:id/content
This end point allows you to add or update template content.
Request
Response
Path Parameters
id
required
string
Template ID
Headers
apikey
required
string
API Key
Form Data Parameters
file
required
object
DOCX, PPTX, XlSX, Fillable_PDF file
200: OK
{
"status": "success",
"data": null
}
400: Bad Request
{
"status": "error",
"data": "Invalid Helper used. Helper \"user\" does not exist\nDid you mean to write user_name"
}

post
Merge a document

https://api.docupilot.app/api/v1/templates/:id/merge
This endpoint allows you to create a new document from a template.
Request
Response
Path Parameters
id
required
string
Template ID
Headers
Content-Type
required
string
application/json
apikey
required
string
API Key
Body Parameters
user_email
optional
string
John@example.com
name
optional
string
John
200: OK
{
"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.