fastify-x-signwell
xsignwell.templates.getFields
Retrieve the field definitions placed on a SignWell template.
xsignwell.templates.getFields
Retrieve the field definitions (signature, date, text, etc.) placed on a SignWell template. Returns an empty array if no fields are defined.
Signature
fastify.xsignwell.templates.getFields(templateId: string): Promise<Array>
Params
| Name | Type | Required | Description |
|---|---|---|---|
templateId | string | Yes | The SignWell template ID. |
Returns
An Array of field definition objects from the template, or [] if none are defined.
Throws
[xSignwell] templates.getFields: templateId (string) is required— iftemplateIdis missing.- Re-throws SignWell API errors with
statusCodeandsignwellErrorproperties.
Examples
Inspect field definitions on a template
const fields = await fastify.xsignwell.templates.getFields("tmpl_abc123");
// [{ id: "customer_name", type: "text", required: true, ... }, ...]
See also
- templates.get — fetch the full template object
- templates.getRecipients — retrieve recipient placeholders
- documents.createFromTemplate — use fields when instantiating a document from a template
AI Context
package: "@xenterprises/fastify-xsignwell"
method: fastify.xsignwell.templates.getFields(templateId)
use-when: Inspect the field definitions (signature, text, date fields) placed on a SignWell template
returns: Array of field definition objects, or [] if none
