-
Notifications
You must be signed in to change notification settings - Fork 11
Public API: Get a Template
Isaiah Fisher edited this page Dec 5, 2024
·
2 revisions
The following endpoint lets you retrieve a specific template.
GET https://api.pneumatic.app/templates/<ID>
You need to supply the template's id, which you can find in its url:
![Screenshot 2024-12-05 at 1 35 09 PM](https://private-user-images.githubusercontent.com/187033577/392794495-981a84b0-7746-4cea-a725-8f43f6bace9f.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk1OTc5NDMsIm5iZiI6MTczOTU5NzY0MywicGF0aCI6Ii8xODcwMzM1NzcvMzkyNzk0NDk1LTk4MWE4NGIwLTc3NDYtNGNlYS1hNzI1LThmNDNmNmJhY2U5Zi5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjE1JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIxNVQwNTM0MDNaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1lMmJiNDEzZGI0OWFmYmZiYjY2NGFiNGUwNjIwMzM2ZmM1YzcxNjUyYWEyMjVhOWE2MmM0YzQ1Nzc3NGRlMTMwJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.3wQSHnZj1ityBkNX-DlvqcUKWwYqF8-wqAbhgdZDoV4)
This is what it looks like in python:
import requests
api_key = 'your_api_key'
headers = {
'Authorization': f'Bearer {api_key}'
}
template_id = 42588
r = requests.get(f'https://api.pneumatic.app/templates/{template_id}', headers=headers)
The request returns a json describing the retrieved template in excruciating detail:
{
"id": "int",
"name": "str",
"description": "str",
"is_active": "bool",
"is_public": "bool",
"public_url": "str | null",
"public_url": "str | null",
"public_success_url": "str | null",
"is_embedded": "?bool, // default: false"
"embed_url": "str | null",
"finalizable": "bool",
"date_updated": "str", //" ISO 8601 format: YYYY-MM-DDThh:mm:ss[.SSS]"
"updated_by": "int",
"template_owners": ["int"],
"tasks_count": "int",
"performers_count": "int",
"kickoff": {
"id": "int",
"description": "str",
"fields": [
{
"id": "int",
"order": "int",
"name": "str",
"type": "str",
"is_required": "bool",
"description": "str",
"default": "str",
"api_name": "str",
"selections": [ // these are only passed in for radio button checkbox and dropdown fields
{
"id": "int",
"value": "str"
}
]
}
]
},
"tasks": [
{
"id": "int",
"number": "int",
"name": "str",
"description": "str",
"delay": "str", // null if the formal is not aset as: '[DD] [[hh:]mm:]ss'
"require_completion_by_all": "bool",
"raw_due_date": {
"api_name": "str",
"duration": "str",
"duration_months": "int, default 0",
"rule": "str",
"source_id": "?str | null"
},
"raw_performers": [
{
"id": "int",
"type": "user|field|workflow_starter",
"source_id": "?str", // id the id of a user, group or the api name of the field or null
"label": "str" // this is a read only parameter: the user name, group name or field name
},
],
"checklists": ?[
{
"api_name": "str",
"selecions": [
{
"api_name": "str",
"value": "str"
}
]
}
]
"fields": ?[
{
"id": "int",
"order": "int",
"name": "str",
"type": "str",
"is_required": "bool",
"description": "str",
"default": "str",
"api_name": "str",
"selections": [ // these are only passed in for radio button checkbox and dropdown fields
{
"id": "int",
"value": "str"
}
]
}
],
"conditions": ?[
{
"id": "int",
"action": "str", // end_process, skip_task, start_task
"order": "int",
"api_name": "str",
"rules": [
{
"id": "int",
"api_name": "str",
"predicates": [
{
"id": "int",
"field_type": "str",
"value": "Optional[str]",
"api_name": "str",
"field": "str", // the api_name of the field being used
"operator": "str" // equals, not_equals, exists, not_exists, contains, not_contains, more_than, less_than
}
]
}
]
}
]
}
]
}
Here null represents empty values for strings and numbers, [] represents empty values for lists and false is the default value for booleans.