Example 2: Adobe Campaign to AEM

AEM offers out of the box APIs to retrieve the objects available anywhere in the siteadmin explorer view.

chlimage_1-17

NOTE
For this example, see Geometrixx, which is available from Package Share.

For each node in the explorer, there is an API that is linked to it. For example, for the node :

The API is:

The end of the URL .1.json can be replaced by .2.json, .3.json, according to the number of sublevels you are interested in getting. To obtain all of them the keyword, infinity can be used:

To consume the API, AEM, by default, uses basic authentication.

A JS library that is named amcIntegration.js is available in 6.1.1 (build 8624 and higher) that implements that logic among several other ones.

AEM API call

loadLibrary("nms:amcIntegration.js");

var cmsAccountId = sqlGetInt("select iExtAccountId from NmsExtAccount where sName=$(sz)","aemInstance")
var cmsAccount = nms.extAccount.load(String(cmsAccountId));
var cmsServer = cmsAccount.server;

var request = new HttpClientRequest(cmsServer+"/content/campaigns/geometrixx.infinity.json")
aemAddBasicAuthentication(cmsAccount, request);
request.method = "GET"
request.header["Content-Type"] = "application/json; charset=UTF-8";
request.execute();
var response = request.response;

Experience Manager