Bad Request Error when invoking third party Restful web services via .json | Community
Skip to main content
New Participant
August 30, 2016
Solved

Bad Request Error when invoking third party Restful web services via .json

  • August 30, 2016
  • 14 replies
  • 11604 views

Hi 

We are trying to call the third party REST service in AEM 6.1 and following the example as per below URL.

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

This example is working when we are creating the template and render the component that uses template. But when we are trying to create the separate component and using that component in some other template the it is not working and throwing the error like "Unable to retrieve data Bad request 400 (Bad Request)" (see the attached screenshot). Any idea what we are missing? or it will work only in case of render component that uses the template only not with separate component?

Thanks

~S

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

Here is the best way to interact with a 3rd party Restful service in AEM - use HTL -- https://helpx.adobe.com/experience-manager/using/restful_htl.html

14 replies

New Participant
August 30, 2016

Yes Scott, we are calling exactly same way. it is very strange. when calling from separate component then only getting below attached error. You can see the attached screen shot.

 GET http://localhost:4502/content/aemexample/en/restservicecomponent/_jcr_content.query.json 400 (Bad Request)  granite.js:229

Thanks

~S

smacdonald2008
New Participant
August 30, 2016

In the new component, are you calling the back end the same way? It does not make sense that it works when called from a page component but not from a separate component.

New Participant
August 30, 2016

Hi Kautuk,

Yes the bundle is in active states, even it is working when we are keeping the same code in render component that uses the template. it is not working when keeping it in new component and dropping the component on same template.

Thanks

~S

kautuk_sahni
Employee
August 30, 2016

Hi, Can you please check if OSGI bundle is in active state? 

~kautuk

Kautuk Sahni