Query AEM data using a web service call? | Community
Skip to main content
Level 4
January 8, 2016
Solved

Query AEM data using a web service call?

  • January 8, 2016
  • 6 replies
  • 2308 views

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.
Best answer by smacdonald2008

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
January 8, 2016

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. 

Level 4
January 8, 2016

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?

smacdonald2008
smacdonald2008Accepted solution
Level 10
January 8, 2016

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.

Level 4
January 8, 2016

That makes perfect sense. Thanks 

Lokesh_Shivalingaiah
Level 10
January 8, 2016

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

joerghoh
Adobe Employee
Adobe Employee
January 8, 2016

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

kind regards,
Jörg