Custom form with RESTful submit event


(Mahearnpad) #1

Hi

 

I've set up a custom form asset. I've set up a submission action on the form, to submit to a REST resource. The REST resource posts to an RESTful API on an external server.

 

I've set up the request body of the REST resource to send the form data in the following format: 

First=%response_248645_q1%&Last=%response_248645_q2%&Usercategory=%response_248645_q7%

Are the keywords I've used here correct for the questions on my form (assume I've got the assetids correct)?

 

I've tested the REST resource, and it reaches the API and saves data to the external db OK.  However, when I use the HTML form to send the data, it does not reach the external API, in fact the REST resource does not seem to be called at all. I do get the thank you page with the form responses correctly displayed following submit however.

 

Any thoughts on what might be the problem?  Any ideas on how we can debug this?  I can't use the browser, because after I form submit, the action is happening on the matrix server.

 

TIA

Michael

 

 


(Joel Porgand) #2

I've used http://requestb.in/ (well, a defunct equivalent) for debugging REST stuff in the past.

 

I think %response_X% should be the right keyword but you could also try %question_answer_X%


(Mahearnpad) #3

Thanks JP. That has confirmed that everything is working as expected at the Matrix end - and %response_X% is correct.  Communication to requestbin successful.  Problem resolved.