Expand my Community achievements bar.

Elevate your expertise and be recognized as a true influencer! Nominations for the exclusive Adobe Community Advisor program 2023 are now OPEN.

Sling GET servlet


Level 1

Hi All,

Can someone share the example of How to write the REST API GET method in AEM where data can be shared in the form of  JSON when any client make the rest api call .


1 Accepted Solution


Correct answer by
Level 1
4 Replies




To write REST Get/post method, you need to create a JAVA Sling Servlet.


// Here is the example for this.

Package :- https://helpx.adobe.com/experience-manager/using/custom-sling-servlets/_jcr_content/main-pars/downlo...

Here we are submitting data to POST method via AJAX call:-

         type: 'POST',   
         data:'id='+ claimId+'&firstName='+ myFirst+'&lastName='+ myLast+'&address='+ address+'&cat='+ cat+'&state='+ state+'&details='+ details+'&date='+ date+'&city='+ city,
         success: function(msg){
           alert(msg); //display the data returned by the servlet

Here URL is the path for request.


If you want to integrate or invoke 3rd party restful web service, see this

Link:- https://helpx.adobe.com/experience-manager/using/restful-services.html

// Creating Adobe Experience Manager bundles that invoke third party Restful web services

I hope this would help you.



Level 1

Hi kautuk,

Can you share the example of custom JAVA Sling Servlet using the GET method where the data is entered by the author using the classic dialog is return in json format when the rest api get method request is made.



Correct answer by
Level 1