Access Page Manager API with postman

iamjeeva

20-09-2020

I have AEM's instance hosted something like this https://author.dev.demo.adobecqms.net, this is AEM 6.5 version.

I want to create and delete pages on this author instance using AEM's page manager API with any automation tool like JMeter or RestAssured but I have no idea, how to do it.

After spending some time on the internet (hitting in the dark), I am able to at settings.xml in .m2/settings.xml from this post - https://www.aemquickstart.in/2017/04/cannot-create-maven-project.html 

Also, I have below posts

  1. Publish/Unpublish Adobe AEM page from Java AEM Replicator API
  2. Using PageManager API in AEM6/CQ5 page Manager API
  3. https://www.codota.com/code/java/methods/com.day.cq.wcm.api.Page/getParent page Manager API

But how do I implement them? I don't have any AEM coding experience.

Any reference, tutorial, GitHub project, sample code which can help me in understanding how to API APIs on hosted AEM application?

View Entire Topic

ChitraMadan

MVP

20-09-2020

Hi @iamjeeva ,

 

In order to create/delete a page in AEM programatically, take a look at Page Manager API

https://helpx.adobe.com/experience-manager/6-5/sites/developing/using/reference-materials/javadoc/co...

 

Code Snippet to create a page in AEM:

 

private void createPage (ResourceResolver resolver) throws Exception {

        String path      =  "/content/whatever" ;

        String pageName  = "testpage";

        String pageTitle = "Test Page";

        String template  = "/apps/sample/templates/test";

        Page testPage = null;

        PageManager pageManager = resolver.adaptTo(PageManager.class);

        if (pageManager != null) {

                testPage = pageManager.create(path, pageName, template, pageTitle);        

        }

}