Creating Content Fragments programmatically - AEM Headless (React) | Community
Skip to main content
Level 2
February 5, 2024
Solved

Creating Content Fragments programmatically - AEM Headless (React)

  • February 5, 2024
  • 2 replies
  • 797 views

Is there a current best practice to create content fragments programmatically AEM Headless (using React)?

Would it be through the Assets API? Anything to take into account?

 

i assume it would be similar to here:

https://experienceleague.adobe.com/docs/experience-manager-65/content/assets/extending/assets-api-content-fragments.html?lang=en#create

 

 

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by EstebanBustamante

Hi, 


Correct, you can use the Assets API, here is the swagger with some clarifications; https://developer.adobe.com/experience-manager/reference-materials/6-5/assets-api-content-fragments/index.html#/%7BcfParentPath%7D/createContentFragment. The only thing you need to make sure is to map correctly the ":type", you could first try in something like postman and then just mimic the same request in React. It should not be a problem

Hope this helps

2 replies

EstebanBustamante
Community Advisor and Adobe Champion
EstebanBustamanteCommunity Advisor and Adobe ChampionAccepted solution
Community Advisor and Adobe Champion
February 5, 2024

Hi, 


Correct, you can use the Assets API, here is the swagger with some clarifications; https://developer.adobe.com/experience-manager/reference-materials/6-5/assets-api-content-fragments/index.html#/%7BcfParentPath%7D/createContentFragment. The only thing you need to make sure is to map correctly the ":type", you could first try in something like postman and then just mimic the same request in React. It should not be a problem

Hope this helps

Esteban Bustamante
MoSa1Author
Level 2
February 6, 2024

Thanks. Great link as well. 

ChitraMadan
Community Advisor
Community Advisor
February 6, 2024