Templates

Create a template

POSThttps://api-testnet.truvera.io/templates
Body

Template JSON object

html*string

The HTML content of the template

css*string

The CSS content of the template

name*string

The name of the template

Response

template has been created

Body
id*string
htmlstring
cssstring
name*string
metadataobject
Request
const response = await fetch('https://api-testnet.truvera.io/templates', {
    method: 'POST',
    headers: {
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      "html": "text",
      "css": "text",
      "name": "text"
    }),
});
const data = await response.json();
Response
{
  "id": "text",
  "html": "text",
  "css": "text",
  "name": "text"
}

List all templates

GEThttps://api-testnet.truvera.io/templates
Query parameters
Response

A paged array of templates

Body
id*string
htmlstring
cssstring
name*string
metadataobject
Request
const response = await fetch('https://api-testnet.truvera.io/templates', {
    method: 'GET',
    headers: {},
});
const data = await response.json();
Response
[
  {
    "id": "text",
    "html": "text",
    "css": "text",
    "name": "text"
  }
]

Info for a specific template by DID

GEThttps://api-testnet.truvera.io/templates/{id}
Path parameters
id*string (uuid)

The template ID

Response

Expected response to a valid request

Body
id*string
htmlstring
cssstring
name*string
metadataobject
Request
const response = await fetch('https://api-testnet.truvera.io/templates/{id}', {
    method: 'GET',
    headers: {},
});
const data = await response.json();
Response
{
  "id": "text",
  "html": "text",
  "css": "text",
  "name": "text"
}

Update a template

PATCHhttps://api-testnet.truvera.io/templates/{id}
Path parameters
id*string

A template ID

Body

Template JSON object

html*string

The HTML content of the template

css*string

The CSS content of the template

name*string

The name of the template

Response

Template has been updated

Body
id*string
htmlstring
cssstring
name*string
metadataobject
Request
const response = await fetch('https://api-testnet.truvera.io/templates/{id}', {
    method: 'PATCH',
    headers: {
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      "html": "text",
      "css": "text",
      "name": "text"
    }),
});
const data = await response.json();
Response
{
  "id": "text",
  "html": "text",
  "css": "text",
  "name": "text"
}

Deletes a single template based on ID provided

DELETEhttps://api-testnet.truvera.io/templates/{id}
Path parameters
id*string

A template ID

Response

Template deleted

Request
const response = await fetch('https://api-testnet.truvera.io/templates/{id}', {
    method: 'DELETE',
    headers: {},
});
const data = await response.json();
Response
{
  "status": 0,
  "type": "text",
  "message": "text"
}

Last updated