List Templates
Lists document templates
Endpoint URL | SDK Method |
---|---|
N/A | Template.list() |
Request properties
Property | Type | Required | Description |
---|---|---|---|
page | Integer | No | The page of the list you want to pull. The default is 1 . |
page_size | Integer | No | The number of records to pull per page. The default is 25 . |
sort | String | No | The sort key. If the key is preceded with a - , the request will sort the records in descending order. Otherwise it will sort in ascending order. |
search | String | No | The search key. The request will only return records with this key. |
Response properties
items
items
Property | Type | Description |
---|---|---|
created_at | String | The date and time the template was created. |
created_by | Object | The user or API key that created the template. |
description | String | The description of the template. |
height | Float | The height of documents generated by the template if source equals html . |
id | String | The ID of the template. |
name | String | The name of the template. |
source | String | The source format of the template. Valid values are docx , html and pdf . |
unit | String | The unit of measurement for documents generated by the template. Valid values are in and cm . |
updated_at | String | The date and time the template was updated. |
version | Integer | The version number of the template. |
version_history | Object[] | The version history of the template. |
width | Float | The width of documents generated by the template if source equals html . |
created_by
created_by
Property | Type | Description |
---|---|---|
first_name | String | The first name of the user who created the template. |
last_name | String | The last name of the user who created the template. |
name | String | The name of the API key that created the template. |
version_history
version_history
Property | Type | Description |
---|---|---|
created_at | String | The date and time the template version was created. |
edited_by_first_name | String | The first name of the user who edited the template. |
edited_by_last_name | String | The last name of the user who edited the template. |
version | Integer | The template version number. |
Example request and response
# Import the Inkit Python package
import inkit
from inkit.exceptions import InkitResponseException
# Import json package
import json
# Replace the string below with your API key
inkit.api_token = "ENTER YOUR API KEY"
try:
# List all templates
resp = inkit.Template.list()
# Print the repsonse code of the API call
print(json.dumps(dict(resp.data), indent = 3))
except InkitResponseException as err:
# Print any error
print(err.response.data)
// Import the Inkit Node.js package
const Inkit = require("inkit");
// Replace the string below with your API key
Inkit.apiToken = "ENTER YOUR API KEY";
// Call list templates
listTemplates();
// List all templates
async function listTemplates() {
try {
const result = await Inkit.Template.list();
// Print the JSON response of the API call
console.log(JSON.stringify(result.data, null, 3));
} catch (error) {
// Print any error
console.error(error.response.status, error.response.statusText);
}
}
{
"items": [
{
"created_at": "2023-09-06T14:43:36.773986Z",
"description": "",
"height": 11.0,
"id": "tmpl_27i7Mb5bBIKzXVHOKfSedc",
"name": "Test",
"source": "html",
"unit": "in",
"updated_at": "2023-09-06T14:43:36.773997Z",
"version": 1,
"version_history": [
{
"created_at": "2023-09-06T14:43:36.773997Z",
"edited_by_first_name": "John",
"edited_by_last_name": "Doe",
"version": 1
}
],
"width": 8.5
}
],
"metadata": {
"pagination": {
"current_page": 1,
"next_page": null,
"page_count": 1,
"page_size": 25,
"prev_page": null,
"total_count": 1
},
"sort": {
"key": "updated_at",
"order": 1
}
}
}
Updated 11 months ago