Invoke REST API - AEM 6.3 Forms | Community
Skip to main content
Level 4
June 20, 2017

Invoke REST API - AEM 6.3 Forms

  • June 20, 2017
  • 1 reply
  • 14929 views

Hi Guru's ,

I'm currently exploring AEM 6.3 forms and trying out a usecase to invoke a rest endpoint on click of a button .

I achieved this use case in AEM 6.2 via code editor where on click event I was excuting a peice of java script code which would make a ajax style call to rest API and render the response .

I'm trying to see if there is any better way to acheive this in AEM 6.3 .

I do not have the swagger file for the REST API and it is a third party service . Will i still be able to use Forms data integrations ? Or Is there any GuideUtils API to invoke rest based endpoints or java script way is the best to go  ? I found the article below  to execute SOAP based services , however couldn't find any thing similar for rest based calls ?

AEM 6.2 Forms Help | API to invoke web services from adaptive forms

Thanks in advance

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

1 reply

smacdonald2008
Level 10
June 20, 2017

Here is a general AEM article on how to invoke a 3rd party Restful web service: Scott's Digital Community: Creating Adobe Experience Manager services that invoke third party Restful web services

You can write an AEM OSGi service that contains Java logic that sends a request and handles the response.

KrisgumAuthor
Level 4
June 20, 2017

Thanks Scott.

I'm aware of osgi way of invoking services or javascript but i'm after the way to effectively leverage AEM forms.

Being a consumer of third party rest api , dont have swagger file to create a Form data model.

Wondering if there is any other mechanism in AEM forms apart from using plain javascript in code editor of rules section ?

cheers

January 4, 2018

>> Yes, Currently test UI handles limited set of error cases but if service invocation is failing due to some reason complete details will be available in error log file.

How do you tell the difference between an error and a zero result set when you publish the form into production? The end users won't have access to the error log file. They will just think their search returned zero results. You can't tell using any of the available form APIs either so you can't handle this programmatically.

This is not a small issue - it prevents the whole FDM being used in a real live environment until we can tell the difference.


Hi Darren,

Did you get any response from Adobe on the response from the service? We have started on forms now and we have similar requirements, could you please confirm on the outcome? Thanks