Expand my Community achievements bar.

Radically easy to access on brand approved content for distribution and omnichannel performant delivery. AEM Assets Content Hub and Dynamic Media with OpenAPI capabilities is now GA.
SOLVED

AEM Cloud - How to unpublish a page through API ?

Avatar

Level 1

Hi,

 

I have a servlet written with path and when executed I want it to unpublish a page in AEM Cloud. As AEM Cloud uses sling distribution and not replication agent anymore, I am not sure how to write the JAVA code to unpublish a page.

 

Below is the servlet path. I have the page hard-coded in the code for testing purposes. And I want to execute it only on Author and want the page to be unpublished.

 

Servlet path: http://localhost:4502/bin/deactivate

 

Could someone please help with sharing the java code snippet to unpublish the page in AEM cloud?. Thank you

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

@karthicksridharan  you can use the replication API.

The actual operation will look something like this - 

replicator.replicate(session,ReplicationActionType.DEACTIVATE,"/content/abc/def");

https://experienceleague.adobe.com/docs/experience-manager-cloud-service/content/operations/replicat...

 

View solution in original post

2 Replies

Avatar

Correct answer by
Community Advisor

@karthicksridharan  you can use the replication API.

The actual operation will look something like this - 

replicator.replicate(session,ReplicationActionType.DEACTIVATE,"/content/abc/def");

https://experienceleague.adobe.com/docs/experience-manager-cloud-service/content/operations/replicat...