Please advise me on this situation. I make a request to a specific server and get a JSON. After that, based on my data, I have to programmatically create a content fragment. This content fragment has a template. Maybe you have an example.
Thank you very much in advance.
There are multiple options to programmatically create Content Fragments in AEM.
1. You can use Assets HTTP API to create content fragments once you know what needs to go into the Fragment:
2. If you were already within AEM's context, you could also create content fragments programmatically as described in the following link: https://docs.adobe.com/content/help/en/experience-manager-65/developing/extending-aem/customizing-co...
You can refer to the Content Fragment API to create a Content Fragment programmatically:
The following document may also be helpful:
If you can use Experience Fragments instead of Content Fragment, would add lot of flexibility and easiness.Not sure about your use case though.
Sample code - https://aemdeveloper.wordpress.com/2017/08/22/create-access-the-content-fragment-programmatically/
@aliaksandr_hvoz What exactly is your ask ? You need a sample to create CF programmatically ?