Webhook PHP Script Example

  • Profile Image
    Winston Negron
    Asked on July 06, 2013 at 09:14 AM

    This is will simplify things for me and my websites where I need feedback. All I have to do now is set up a "PHP" scheme. Do you by any chance have any sample code for this? This would be great and save me time.



    This is a re-post of a comment on Send Instant Submission Notifications with Webhooks

  • Profile Image
    Elton
    Answered on July 06, 2013 at 11:23 AM

    Hi Winston,

    We will get back to you with this with an example. We will provide it to you later today.

    Thanks for using Jotform!

  • Profile Image
    Winston
    Answered on July 06, 2013 at 12:52 PM
    I'm really grateful for your time and effort.

    _____
  • Profile Image
    Elton
    Answered on July 07, 2013 at 07:59 PM

    @Winston

    My apologies for getting back to you so late. Here's an example PHP script that you may try on WebHook.

    http://pastebin.com/raw.php?i=1SZyZ4uM

    This is a simple mail sender script that sends the form data to your email. You have to replace the two emails found on the script with your email, sender and recipient.

    To test, submit a sample data on this form to received a notification containing your submitted data. http://form.jotformpro.com/form/31840709231954?. Make sure to use your real email.

    That code works with this form: http://form.jotformpro.com/form/31840709231954?, you can clone this form and setup a webhook on the cloned form.

    For your reference, if you're going to setup webhook on your forms, you can easily inspect HTTP request using http://requestb.in/.

    Let us know if you have further questions. Thanks!

  • Profile Image
    Elton
    Answered on July 08, 2013 at 03:59 AM

    Sorry, my first script was deleted on that page for some reason. Get it here instead: http://pastebin.com/raw.php?i=1SZyZ4uM

    Thanks!

  • Profile Image
    Eric
    Answered on November 13, 2013 at 03:41 PM
    When it comes to Webhooks, I can't seem to get them working. Is the code you posted (http://pastebin.com/raw.php?i=1SZyZ4uM) the ONLY code you need in the PHP file you point to for your webhook? Or is there any other authentication or processing that needs to happen in that file? I'm totally new to the whole webhook process. Thanks!