Name your layers
name has to match a layer name in the template. The match is exact, so Headline and headline are two different names.
To rename a layer, double-click it in the layers panel of the editor. To list the layer names of a template over the API, call Template list with includeLayers=true.
Two rules help when a value does not change:
- If no layer has the name, Bannerify ignores the modification and returns no error. Check the spelling first.
- If several layers share a name, they all get the same modification.
Fields
Bannerify ignores a field that does not fit the layer. For example,
src on a text layer does nothing, and color changes text layers only. It also ignores fields it does not know.
What each layer reads
A modification cannot change the canvas, a layer’s position or size, or a fill color. Change those in the editor.
Text
The new text replaces the whole text of the layer. A new line starts a new paragraph. The layer keeps its own style, such as font and size, but formatting inside the text, such as one bold word, is lost.Images
src must be a public URL of a PNG, JPEG, WebP, or SVG file. Bannerify downloads the file while it renders. A download waits up to 5 seconds and retries twice. If the download fails, or the file is another type, the request fails with FETCH_IMAGE_ERROR.
Tables
A table takescolumns and rows. Each row is an object keyed by column name. A cell holds a string, a number, a boolean, or null.
If you send
rows without columns, the table keeps the columns from the template, and each row needs the keys of those columns.
Charts
A chart takesrows. Send points for one series, or series for several.
label, a numeric value, and an optional color. A series has a name, its data points, and an optional color.
Key value
A key value layer takesrows with one entry for each line. value can be a string or a number, and Bannerify shows it as text.
Accepted formats
Themodifications field accepts four shapes, and all of them produce the same file.
In the object shape, a key names a layer. A string or number value sets
text, and an object value keeps its own fields.
"badge": false sets the text of the layer to false, and "badge": { "visible": false } hides it.
Check a request
An invalid modification returnsBAD_REQUEST. The message names the path of the field, for example modifications[0].text.
The Modification schema lists every field with its type.