Skip to Content

Render a declared template workspace fixture

Renders one of the named inputs the template declares against the current effective workspace tree.

POST
/v1/templates/{id}/workspace/fixtures

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.

Authorization

apiKey
headerx-api-key<token>

Path Parameters

id*string
Match^tmpl_[0-9a-hjkmnp-tv-z]{16,24}$

Request Body

application/json
  1. body
expectedRevision*string
fixture*string
Length1 <= length <= 128

Response Body

Success

application/json
  1. response
projectId*TemplateProjectId
Match^tproj_[0-9a-hjkmnp-tv-z]{16,24}$
revision*string
entryPath*|
declaration*|null
issue?
diagnostics*array<>
incompatibilities*array<>
fixture*string
Length1 <= length <= 128
rendered*|null
whatsapp*|null
page?|null
Example Request
import { 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
      }
    ]
  }
}

Related documentation