Get Template
Retrieve details of a specific image template by its ID.
You will need to authenticate to use this API. See authentication.
Request
GET https://api.ojo.so/v1/template/:templateIdPath Parameters
| Parameter | Type | Description |
|---|---|---|
| templateId | string | The unique identifier of the template |
cURL
curl --request GET \
--url https://api.ojo.so/v1/template/<Replace with template ID> \
--header 'Authorization: Bearer <your API key>'Response
200
Successfully retrieved the template details.
{
"id": "template-uuid-1",
"name": "Template 1",
"description": "Monthly invoice",
"html": "<h1>{{issuer.name}}</h1>{{#each items}}<p>{{title}}</p>{{/each}}<p>{{recipient_name}}</p>",
"variables": {
"issuer": { "name": "Acme Inc." },
"items": [{ "title": "Consulting" }],
"recipient_name": "Jane Sample"
},
"inputs": ["issuer.name", "items[].title", "recipient_name"],
"createdAt": "2023-08-30T12:34:56Z",
"updatedAt": "2023-08-30T12:34:56Z"
}variables are the saved values. inputs are the data paths the HTML reads, sorted: items[].title
is the title of each item of items. Send these in modify when you render.