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

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

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.
smacdonald2008
smacdonald2008Accepted solution
Level 10
September 6, 2016

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

Level 4
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

Translate
smacdonald2008
Level 10
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.

Translate
Level 4
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

Translate
kautuk_sahni
Employee
August 30, 2016

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

~kautuk

Translate
Kautuk Sahni