Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Http submit button calling REST API

AEM_USER1
Level 3
Level 3

Ok so i have my REST API in iis. for testing based on @workflowuser advice was to use an HTTP submit button. so I built something simple. I hardcoded the REST API call and when i click the button I get...Capture.JPG

an http 405 error.

 

Capture1.JPG

 

@workflowuserdo you have any examples on how to actually build the call to a GET rest api? and lastly i would like the response to be into that textfield. Please help I am at a lost.

4 Replies
GirishBedekar
Level 9
Level 9

I am not sure on how to populate fields on the form using REST endpoint response 

what is your use case?

AEM_USER1
Level 3
Level 3

@GirishBedekar the use case is just to get a JSON String from a database. I wanted to use REST API instead of SOAP web service. I also wanted to use Workbench but I do not see a way for workbench to return a JSON string unless it is programming it with JAVA servlets.

 

So using a HTTP submit button is only for POST? not GET? please advice

 

Thanks

GirishBedekar
Level 9
Level 9

Yes http post is for submitting the pdf form

What do you intend to do with the response you get from the REST call?

have you considered using adaptive forms instead of pdf form

AEM_USER1
Level 3
Level 3

@GirishBedekar with the response I intent to prefill my pdf. We are not using adaptive forms for this. Just pdf. 

 

So REST API cannot be use with PDFs?