Render a declared template workspace fixture
Renders one of the named inputs the template declares against the current effective workspace tree.
POST
Renders one of the named inputs the template declares against the current effective workspace tree. Only declared fixtures render here; arbitrary input renders against a publication.
apiKeyheader
x-api-key<token>id*stringMatch
^tmpl_[0-9a-hjkmnp-tv-z]{16,24}$application/json- body
expectedRevision*stringfixture*stringLength
1 <= length <= 128Success
application/json- response
projectId*TemplateProjectIdMatch
^tproj_[0-9a-hjkmnp-tv-z]{16,24}$revision*stringentryPath*|declaration*|nullissue?diagnostics*array<>incompatibilities*array<>fixture*stringLength
1 <= length <= 128rendered*|nullwhatsapp*|nullpage?|nullimport { createClient } from "samva";
const samva = createClient({ apiKey: process.env.SAMVA_API_KEY! });
const result = await samva.templates.renderWorkspaceFixture({
"id": "example",
"expectedRevision": "example",
"fixture": "example"
});Example Response
{
"projectId": "string",
"revision": "string",
"entryPath": "string",
"declaration": {
"codeDigest": "string",
"templateId": "string",
"input": {
"schema": {
"property1": "string",
"property2": "string"
},
"schemaDigest": "string",
"contractDigest": "string"
},
"fixtures": [
"string"
]
},
"issue": {
"path": "string",
"frontmatter": {
"title": "string",
"date": "string",
"slug": "string",
"topic": "string",
"preheader": "string",
"seo": {
"title": "string",
"description": "string",
"image": "string"
},
"gate": {
"leadIn": 0
}
}
},
"diagnostics": [
{
"code": "string",
"severity": "error",
"message": "string",
"origins": [
{
"fileName": "string",
"lineNumber": 1,
"columnNumber": 1
}
],
"clients": [
"string"
],
"notes": "string",
"provenance": "string",
"fixtures": [
"string"
],
"occurrences": [
[
{
"fileName": "string",
"lineNumber": 1,
"columnNumber": 1
}
]
],
"compatibility": {
"assessment": "risk",
"title": "string"
}
}
],
"incompatibilities": [
{
"code": "string",
"severity": "error",
"message": "string",
"origins": [
{
"fileName": "string",
"lineNumber": 1,
"columnNumber": 1
}
],
"clients": [
"string"
],
"notes": "string",
"provenance": "string",
"fixtures": [
"string"
],
"occurrences": [
[
{
"fileName": "string",
"lineNumber": 1,
"columnNumber": 1
}
]
],
"compatibility": {
"assessment": "risk",
"title": "string"
}
}
],
"fixture": "string",
"rendered": {
"subject": "string",
"preheader": "string",
"html": "string",
"text": "string",
"selections": [
{
"instancePath": "string",
"tag": "string",
"origins": [
{
"fileName": "string",
"lineNumber": 1,
"columnNumber": 1
}
],
"authored": true,
"occurrence": 1,
"occurrences": 1,
"parentPath": "string",
"start": 0,
"end": 0
}
],
"sentBytes": -9007199254740991,
"previewBytes": -9007199254740991
},
"whatsapp": {
"language": "string",
"category": "string",
"header": {
"type": "text",
"text": "string"
},
"body": "string",
"footer": "string",
"buttons": [
{
"type": "quick-reply",
"text": "string"
}
]
},
"page": {
"kind": "page",
"html": "string",
"selections": [
{
"instancePath": "string",
"tag": "string",
"origins": [
{
"fileName": "string",
"lineNumber": 1,
"columnNumber": 1
}
],
"authored": true,
"occurrence": 1,
"occurrences": 1,
"parentPath": "string",
"start": 0,
"end": 0
}
]
}
}