I am trying to create content fragment using Assets API via POST request. Here's how my JSON looks like:
Solved! Go to Solution.
Views
Replies
Total Likes
Hi @spidey1405,
In general, it looks some information are missing in your JSON, e.g. cq:model property which is mandatory. Please have a look under below documentation:
According to above, this is how correct JSON structure looks like for CF creation:
{ "properties": { "cq:model": "/conf/path/to/model", "title": "string", "description": "string", "metadata": { "additionalProp1": "string", "additionalProp2": "string", "additionalProp3": "string" }, "elements": { "{element1Name}": { "value": "<p>The HTML content of the element.</p>", ":type": "text/html", "variations": { "{variation1Name}": { "value": "<p>The HTML content of the element.</p>", ":type": "text/html" }, "{variation2Name}": { "value": "<p>The HTML content of the element.</p>", ":type": "text/html" }, "{elementNName}": { "value": "<p>The HTML content of the element.</p>", ":type": "text/html" } } }, "{element2Name}": { "value": "<p>The HTML content of the element.</p>", ":type": "text/html", "variations": { "{variation1Name}": { "value": "<p>The HTML content of the element.</p>", ":type": "text/html" }, "{variation2Name}": { "value": "<p>The HTML content of the element.</p>", ":type": "text/html" }, "{elementNName}": { "value": "<p>The HTML content of the element.</p>", ":type": "text/html" } } }, "{elementNName}": { "value": "<p>The HTML content of the element.</p>", ":type": "text/html", "variations": { "{variation1Name}": { "value": "<p>The HTML content of the element.</p>", ":type": "text/html" }, "{variation2Name}": { "value": "<p>The HTML content of the element.</p>", ":type": "text/html" }, "{elementNName}": { "value": "<p>The HTML content of the element.</p>", ":type": "text/html" } } } } } }
Hi @spidey1405,
In general, it looks some information are missing in your JSON, e.g. cq:model property which is mandatory. Please have a look under below documentation:
According to above, this is how correct JSON structure looks like for CF creation:
{ "properties": { "cq:model": "/conf/path/to/model", "title": "string", "description": "string", "metadata": { "additionalProp1": "string", "additionalProp2": "string", "additionalProp3": "string" }, "elements": { "{element1Name}": { "value": "<p>The HTML content of the element.</p>", ":type": "text/html", "variations": { "{variation1Name}": { "value": "<p>The HTML content of the element.</p>", ":type": "text/html" }, "{variation2Name}": { "value": "<p>The HTML content of the element.</p>", ":type": "text/html" }, "{elementNName}": { "value": "<p>The HTML content of the element.</p>", ":type": "text/html" } } }, "{element2Name}": { "value": "<p>The HTML content of the element.</p>", ":type": "text/html", "variations": { "{variation1Name}": { "value": "<p>The HTML content of the element.</p>", ":type": "text/html" }, "{variation2Name}": { "value": "<p>The HTML content of the element.</p>", ":type": "text/html" }, "{elementNName}": { "value": "<p>The HTML content of the element.</p>", ":type": "text/html" } } }, "{elementNName}": { "value": "<p>The HTML content of the element.</p>", ":type": "text/html", "variations": { "{variation1Name}": { "value": "<p>The HTML content of the element.</p>", ":type": "text/html" }, "{variation2Name}": { "value": "<p>The HTML content of the element.</p>", ":type": "text/html" }, "{elementNName}": { "value": "<p>The HTML content of the element.</p>", ":type": "text/html" } } } } } }