---
title: "Test template"
method: POST
path: "/v1/optimize/messages/test"
tags: ["Optimizer"]
---

# Test template

`POST /v1/optimize/messages/test`

## Request

- Base URL: `https://api.1nce.com/management-api`
- URL: `https://api.1nce.com/management-api/v1/optimize/messages/test`
- Auth: HTTP bearer

Test a template with a sample input message.

## Request body

- Postschema4: Test a translation template with a sample input message request.
  - `template` string, required: A stringified JSON template.
  - `payload` string, required: Sample input used to test the template (base64).

## Response `200`

OK

- PostResponseschema1: Response to the test a translation template with a sample input message request.
  - `translatedPayload` string, required: A stringified JSON message (result from applying template to the sample input).
  - `reducedBytes` number, required: The number of bytes that the device didn't have to send over the network by using the translation template.
  - `energyUsageReduction` number, required: The energy saved on data transfer using provided template in percent.

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `403`: Forbidden
- `500`: Internal Server Error

---

[API](https://skmtc.dev/1nce/apis/1nce-os.md) - [All operations](https://skmtc.dev/1nce/apis/1nce-os/llms.txt) - [OpenAPI document](https://skmtc.dev/1nce/apis/1nce-os/revisions/f1aabbc6aeea?raw)
