Preview: a picture of the drawing
POST /preview?width=800 runs the template with the values given and returns a PNG picture of it, width
pixels across (16 to 4000; 800 unless given), the height in proportion, on white. It is a quick look at what the
values make: for a product configurator's preview, say. For more control over the picture, use
Export with png, jpeg or webp.
The body is a template (as template, or as source from one of your storages) and values for its labelled variables, as described on the API page.
Example
POST /preview?width=400
X-API-KEY: your-api-key
Content-Type: application/json
{
"template": "L=400,\"Length\"\nW=300,\"Width\"\nP1=[L,0]\nP2=[L,W]\nP3=[0,W]\nPOLYLINE @1,[P0,P1,P2,P3],TRUE,0",
"values": { "L": 500, "W": 250 }
}
The answer is the PNG (image/png).