ChartQuery

Label Validate

POST
/v1/label/validate

Validate printer commands. POST source (the raw commands) and language (tsc, zpl, epl, …).

Credit cost: 1 credit per call

Query Parameters

fields?string

Comma-separated list of response fields to return, with dot notation for nested fields (e.g. name,location.city).

is_async?boolean

Run the request as a background job: the API answers 202 with a job_id to poll on GET /v1/jobs/{id}.

Defaultfalse
soft_fail?boolean

Return HTTP 200 even when the request fails; the error is in the error field of the body.

Defaultfalse

Request Body

application/json
  1. body
source*string

Raw printer commands to validate. Also send language.

language*string

Language of the source commands. Example: tsc or zpl.

Default"tsc"
Value in"tsc""zpl""epl""cpcl""dpl""sbpl""ipl"

Response Body

Successful response

application/json
  1. response
infos?integer
valid?boolean
errors?integer
issues?array<>
warnings?integer
Example Request
curl -X POST 'https://api.chartquery.com/v1/label/validate' \  -H 'Content-Type: application/json' \  -d '{  "source": "string",  "language": "tsc"}'
Example Response
{  "infos": 0,  "valid": false,  "errors": 1,  "issues": [    {      "level": "error",      "command": "TEXT",      "message": "CLS must appear before label elements"    },    {      "level": "warning",      "message": "No GAP command found"    }  ],  "warnings": 1}