Skip to main content
Level 4
Jan 8, 2016 1:23 PM UTC
Solved

Query AEM data using a web service call?

We are storing some information in AEM which we want to "read" and display in our internal systems. Can we query AEM via endpoints that are exposed or we just use a .json OOB selector for the nodes.

 

What is an ideal way to read data in AEM from an external system

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
smacdonald2008
smacdonald2008Accepted solution
Level 10
Jan 8, 2016 1:56 PM UTC

AEM supports REST. Write a custom sling servlet that uses QueryBuilder API or JCR SQL to produce a result set. Then have your external system perform a GET request to get JCR data.  The servlet will be on pub instance as well.

6 replies

Feike_Visser1
Adobe Employee
Adobe Employee
Jan 8, 2016 1:27 PM UTC

Have a look here: https://docs.adobe.com/docs/en/aem/6-1/develop/search/querybuilder-api.html

Via REST you can get everything you want in AEM. 

Translate
Level 4
Jan 8, 2016 1:43 PM UTC

But typically the 4502 port is not open for outside world. Our AEM instance in EC2 cloud and we are quering from outside. I am guessing we are only allowed access through dispatcher.

 

Is that the only way?

Translate
smacdonald2008
smacdonald2008Accepted solution
Level 10
Jan 8, 2016 1:56 PM UTC

AEM supports REST. Write a custom sling servlet that uses QueryBuilder API or JCR SQL to produce a result set. Then have your external system perform a GET request to get JCR data.  The servlet will be on pub instance as well.

Translate
Level 4
Jan 8, 2016 1:59 PM UTC

That makes perfect sense. Thanks 

Translate
Lokesh_Shivalingaiah
Level 10
Jan 8, 2016 2:00 PM UTC

If you are using it internally, we can go with Query but however if it has to be consumed by an external system its better to expose it as a json via a service

Translate
joerghoh
Adobe Employee
Adobe Employee
Jan 8, 2016 2:58 PM UTC

The default .json rendition is a good starting point. Everything on top depends pretty much on the requirements you have.

kind regards,
Jörg

Translate