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
  • 14926 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

jasons25523625
August 31, 2018

Edit - I just found the ApiResponse Object in the DEFAULT_SCHEMA. Nothing found on how to use it so I'll have to figure it out

Edit 2 - Ok it seems this is provided by the Swagger PetStore test API and not AEM Forms. Doesn't seem to be useable - Adobe?


This is a worrying shortcoming of the solution. We're new to AEM Forms and REST integration will be essential and I really need to recognise success vs error responses and handle them appropriately.