Unable to call rest API of publish via web server | Community
Skip to main content
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 BrianKasingli

Typically, publishers are not set up to be directly accessed by public users in a production environment. It's protected behind a dispatcher (web server). The dispatcher has some configuration which restricts public users from making such requests to paths and combinations of path and extensions; if your dispatcher does not allow you to access API's supported by AEM, then chances are, your requests are being blocked.

I say turn on the dispatcher logging (set as trace), and then reveal why you cannot call API's from the AEM publish instances. 

5 replies

Pradeep_Kumar_Srivastav
Community Advisor
Community Advisor
August 25, 2022

Can you please provide few more details. Which API you are calling.

Manu_Mathew_
Community Advisor
Community Advisor
August 25, 2022

@manishaa5646486 Can you elaborate a bit more, on what exactly are you trying here?

BrianKasingli
Community Advisor and Adobe Champion
BrianKasingliCommunity Advisor and Adobe ChampionAccepted solution
Community Advisor and Adobe Champion
August 25, 2022

Typically, publishers are not set up to be directly accessed by public users in a production environment. It's protected behind a dispatcher (web server). The dispatcher has some configuration which restricts public users from making such requests to paths and combinations of path and extensions; if your dispatcher does not allow you to access API's supported by AEM, then chances are, your requests are being blocked.

I say turn on the dispatcher logging (set as trace), and then reveal why you cannot call API's from the AEM publish instances. 

arunpatidar
Community Advisor
Community Advisor
August 26, 2022

Is it post request or get?

check blog from @briankasingli on POST request enablement at https://sourcedcode.com/blog/aem/in-aem-what-is-the-apache-sling-referrer-filter-osgi-configuration 

Arun Patidar
Level 2
August 26, 2022

We tried this as well. No luck. Request is post

Level 2
August 26, 2022

We have developed ui were fetch data and store it through rest API. 

We are calling via domain assign to webserver where dispatcher is configured. We get 404 error as webserver is finding the rest API locally instead connecting with publisher.

BrianKasingli
Community Advisor and Adobe Champion
Community Advisor and Adobe Champion
August 26, 2022

What's the API being called?

Level 2
September 9, 2022

We have developed a OSGI bundle and uploaded it on the publish instance as a jar file. In the OSGI bundle, a servlet is mapped to Servlet URL which is called from the domain via the web server.