Save: the drawing exported to your storage
POST /save/{format} exports the drawing as Export does, in any of its formats, and saves
the file to one of your registered storages instead of returning it. The answer says where it went.
The body is that of Export (the template or its source, values, options), and:
destination: where to save it, a storage and a key:{ "storage": "main", "key": "drawings/box-500.pdf" }. A key ending with/is a folder: the file is saved in it asdrawing.and the format's extension.overwrite: replace a file already there. Unless this istrue, a file already there is refused (409).
Example
POST /save/pdf
X-API-KEY: your-api-key
Content-Type: application/json
{
"source": { "storage": "main", "key": "templates/box.piq" },
"values": { "L": 500, "W": 250 },
"destination": { "storage": "main", "key": "drawings/box-500.pdf" }
}
201 Created:
{
"storage": "main",
"key": "drawings/box-500.pdf",
"contentType": "application/pdf",
"size": 1311,
"eTag": "\"fb867be5ca2d368a0127f37964ba0c70\"",
"warnings": 0
}
The destination is checked before the drawing is made: an unknown storage is answered 404, a key that can't be
used (one starting with /, or with .. in it) 400. A storage that can't be reached, or refuses its keys, is
answered 502.
Saving the drawing as piq makes a template of it in your storage, with the values given as its own: one way to
keep variants.
See also: API, Export, Register a storage.