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

New Participant
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
New Participant
August 26, 2022

What's the API being called?

New Participant
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.

arunpatidar
New Participant
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
New Participant
August 26, 2022

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

BrianKasingli
BrianKasingliAccepted solution
New Participant
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. 

Manu_Mathew_
New Participant
August 25, 2022

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

Pradeep_Kumar_Srivastav
New Participant
August 25, 2022

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