Autional Autional
API Reference GitHub autional.com →

POST /admin/communication/templates/{template_id}/preview

Render a specified template with provided variable values, returning the rendered subject, content, and plain text version for preview before sending. Supports both simple and go-template formats. References: ePrivacy Directive 2002/58/EC, CAN-SPAM Act.

Communication Service `bearerAuth` application/json

Request Parameters

NameInTypeRequiredDefaultExampleConstraintsDescription
id path string Yes Template ID

Request Body

Accepts an empty JSON object {}

Responses

StatusDescriptionSchema
200Render successfuldto.DataResponse-dto_PreviewTemplateResponse
400Invalid request parametersdto.SimpleResponse
401Unauthenticated or invalid tokendto.SimpleResponse
403Insufficient permissions to access this resourcedto.SimpleResponse
404Template not founddto.SimpleResponse
500Internal server errordto.SimpleResponse

Referenced Schemas

dto.DataResponse-dto_PreviewTemplateResponse

FieldTypeRequiredExampleConstraintsDescription
code integer No
data dto.PreviewTemplateResponse No
message string No
timestamp string No

dto.PreviewTemplateResponse

Template preview rendering result, including channel, subject, body, and plain text rendering effect.

FieldTypeRequiredExampleConstraintsDescription
channel string No sms
code string No verify_code
content dto.RenderedContent No
content_type string No text
name string No Verification code template
subject dto.RenderedContent No
text_content dto.RenderedContent No

dto.RenderedContent

FieldTypeRequiredExampleConstraintsDescription
error string No
rendered string No Your verification code is 123456, valid for 5 minutes.

dto.SimpleResponse

FieldTypeRequiredExampleConstraintsDescription
code integer No
message string No
timestamp string No