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.
BrianKasingli
BrianKasingliAccepted solution
New Participant
Aug 25, 2022 8:34 PM UTC

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. 

8 replies

Level 2
Aug 26, 2022 12:03 PM UTC

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.

Translate
BrianKasingli
New Participant
Aug 26, 2022 3:55 PM UTC

What's the API being called?

Translate
Level 2
Sep 9, 2022 9:39 AM UTC

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.

Translate
arunpatidar
New Participant
Aug 26, 2022 10:24 AM UTC

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 

Translate
Arun Patidar
Level 2
Aug 26, 2022 12:05 PM UTC

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

Translate
BrianKasingli
BrianKasingliAccepted solution
New Participant
Aug 25, 2022 8:34 PM UTC

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. 

Translate
Manu_Mathew_
New Participant
Aug 25, 2022 1:33 PM UTC

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

Translate
Pradeep_Kumar_Srivastav
New Participant
Aug 25, 2022 1:31 PM UTC

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

Translate