Templates
Templates are used for presenting verifiable credentials to the user in a a pretty, readable and informative way. They can be used on the persisted credentials web view in Truvera workspace or for downloading credentials as PDF document. We have a Designer function in the Truvera Workspace for creating Design templates.
We also have a library https://github.com/docknetwork/prettyvc that can be used to create templates and has samples of templates for users that want more customisation for their designs or use the same principal for their wallet credential display.
The HTML content of the template
The CSS content of the template
The name of the template
template has been created
Error creating template
Transaction limit reached or upgrade required to proceed
User does not own template DID
POST /templates HTTP/1.1
Host: api-testnet.truvera.io
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 42
{
"html": "text",
"css": "text",
"name": "text"
}
{
"id": "text",
"html": "text",
"css": "text",
"name": "text",
"metadata": {}
}
How many items to offset by for pagination
0
How many items to return at one time (max 64)
64
A paged array of templates
Application error
GET /templates HTTP/1.1
Host: api-testnet.truvera.io
Authorization: Bearer JWT
Accept: */*
[
{
"id": "text",
"html": "text",
"css": "text",
"name": "text",
"metadata": {}
}
]
The template ID
Expected response to a valid request
Error getting template
template was not found
GET /templates/{id} HTTP/1.1
Host: api-testnet.truvera.io
Authorization: Bearer JWT
Accept: */*
{
"id": "text",
"html": "text",
"css": "text",
"name": "text",
"metadata": {}
}
A template ID
The HTML content of the template
The CSS content of the template
The name of the template
Template has been updated
Error creating template
Transaction limit reached or upgrade required to proceed
PATCH /templates/{id} HTTP/1.1
Host: api-testnet.truvera.io
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 42
{
"html": "text",
"css": "text",
"name": "text"
}
{
"id": "text",
"html": "text",
"css": "text",
"name": "text",
"metadata": {}
}
A template ID
Template deleted
Error deleting template
template was not found
DELETE /templates/{id} HTTP/1.1
Host: api-testnet.truvera.io
Authorization: Bearer JWT
Accept: */*
No content
Last updated
Was this helpful?