Zum Inhalt springen
StatusZu Brandhub

REST-API

Layout-Inhalt prüfen

POST
/layout/validate
curl --request POST \
--url https://beispielmarke.brandhub.de/api/v1/layout/validate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "template": "example", "product": "example", "variant": "example", "roles": { "additionalProperty": { "media": "example" } }, "params": "example" }'

Prüft einen Inhalt gegen eine Vorlage, ohne etwas anzulegen: Pflichtrollen, Zeichenlimits, Bilder, Parameter und, wenn verfügbar, ob die Texte im Layout Platz haben. Antwortet mit ok und issues (Code, Rolle, Meldung, fix), dieselben Codes wie der Layout-Editor. Fehlerhafte Eingaben (falsche Typen) beantwortet die API mit 422.

Media typeapplication/json
object
template
required

Schlüssel der Vorlage aus GET /layout/templates.

string
product
required

Produkt (Format) aus products der Vorlage, z. B. linkedin-post.

string
variant

Variante der Vorlage; ohne Angabe die Standard-Variante.

string | null
roles
required

Rolle → Wert. Texte als String, Bildrollen als {"media": "<public_id>"} mit der public_id eines Fotos aus GET /media.

object
key
additional properties
Any of:
string
params

Farb- oder Auswahl-Parameter, nur Werte aus allowed der Vorlage.

object | null
Examplegenerated
{
"template": "example",
"product": "example",
"variant": "example",
"roles": {
"additionalProperty": {
"media": "example"
}
},
"params": "example"
}
Media typeapplication/json
object
ok
required
boolean
checked
required
Array<string>
issues
required
Array<object>
object
key
additional properties
note
string
Examplegenerated
{
"ok": true,
"checked": [
"example"
],
"issues": [
{
"additionalProperty": "example"
}
],
"note": "example"
}
Media typeapplication/json
Array
Examplegenerated
[
"example"
]