Unable to capture form fields with Webhook using JAVA

  • rakeshranjan01
    Asked on December 13, 2015 at 2:05 AM

    @POST

    @Path("/regdoc")

    @Consumes(MediaType.APPLICATION_FORM_URLENCODED)

    @Produces(MediaType.TEXT_PLAIN)

    public String registerDoctor( @Context HttpServletRequest request, @FormParam("mobileNumber") String mobileNumber)

    {

    logger.info("Regdoc invoked, Mob Num= "+mobileNumber); return mobileNumber; }

     

    Hello

    We are having a Java REST API in the backend to capture form submissions. However we are unable to capture form fields (mobileNumber as test field). Need help

    Cheers

    Rakesh Ranjan

  • Mike
    Replied on December 13, 2015 at 7:52 AM

    Thank you for contacting us.

    Since you use a http://requestb.in/ service. It looks like that the field name should be q15_mobileNumber in your case.

    Send Post Data is not required for our webhooks so you may consider switching it from Yes to No.

    Unable to capture form fields with Webhook using JAVA Image 1 Screenshot 20

    If you need any further assistance, please let us know.

  • rakeshranjan01
    Replied on December 14, 2015 at 1:59 AM

    Hello

    Thanks for sharing with me the instructions however I am still not able to fetch form field data in the REST service. Below is the code of REST webservice which does get invoked but is unable to fetch form data fields

    @POST

    @Path("/regdoc")

    @Consumes(MediaType.MULTIPART_FORM_DATA) 

    @Produces(MediaType.TEXT_PLAIN)

    public String registerDoctor(@Context HttpServletRequest request,

    @FormParam("q15_mobileNumber") String mobileNumber)

    {

    logger.info("Regdoc invoked, Mob Num= "+mobileNumber);

    return null;

    }

     

    Value of mobile number still remains null. I am not sure if I missing something.

     

    Cheers

    Rakesh

  • Mike
    Replied on December 14, 2015 at 9:29 AM

    Sorry, but I am not a programmer to debug your code. You may consider sending an email to api@jotform.com to see if some of our developers can take a look into this.

    We also have some webhook code samples in PHP which can be found on the following article, so you can check them out to get the general idea.

    Webhook Samples

    Thank you.