Submit to a Rest EndPoint

manass33544664 09-08-2017


I am evaluating the OOTB Form Template and Components for a requirement for a client.

We have to submit the Form to a Third Party REST API. We have no need to save the form data in AEM or any other persistent system.

What i have observed is if I configure the REST Endpoint in the Submit  action, the request first comes to AEM and then goes to a third party.

Is this the expected behavior?

Can i not send the Form Data directly to a third party API?



Accepted Solutions (1)

Accepted Solutions (1)

susheel 11-08-2017

Hi Manas,

You can do an ajax call to service endpoint from javascript or jquery or any library of your choice. But if you want to do something structural. Then you call the endpoint from Sling Models and map the response from the endpoint some Sling Models and use it via sightly(This might be useful in GET request). For post, put and delete I don't think you need extra AEM layer for external service endpoint its an option. Like if you want to hide your external endpoint url or something then you can use the AEM layer.


Answers (4)

Answers (4)

smacdonald2008 11-08-2017

Sending data to a 3rd party endpoint is a custom operation. The logic needs to be somewhere. 

In the case of a Form - when you do a submit operation - you need to submit the data where it can be read and then sent to a 3rd party endpoint.

To address this - Java is the best way. AEM is build to handle this type of operations. I would recommend using a Sling Servlet for this use case

manass33544664 11-08-2017

Thanks smacdonald2008.

I already went through those links.

But my question is slightly different.

In case i DO need to send something directly to an End Point, Do i still need to go via AEM?

I am thinking why to increase the LOAD on AEM when it does not need to process a request.