Jotform API: how can i provide an update form for subscribers & integrate it with Jotform?

  • actors2014
    Asked on September 9, 2015 at 8:49 PM

    Many thanks in advance & apologies for basically asking the same question twice ;)

    I'm a Php Webdeveloper, and I've been asked to provide an pre-populated "update" form for the existing subscribers of my clients website that can pass entries to both JotForm's server and to my client's server.

    I'm a Jotform noob, but I've figured I need to use the API. Unfortunately, I'm stuggling to get my head around your documentation! I have very little time to do this (as usual) - hence the questions...

    Currently, the client's site has a Jotform, linked to Stripe, that takes various details from new subscribers, together with their credit card details.

    Now its planned, via a "Thank you" redirect to run a simple PhP script that passes the above details into a mysql DB.

    The problem is, this method can only work for new subscribers; how can we securely update the details for existing subscribers in a way that updates both jotform's and our DB info in "one go"?; I am aware we can set up autoresponder emails with "edit" links but all this will do is enable the subscriber details to be changed on Jotform and miss out our DB altogether.

    I know you can pass details via URLs, but this seems crazily insecure, particularly as credit card details may need to be passed.

    So, now (probably erronously) I've come to the conclusion to use the JotForm API, but not getting very far with this ( I have a key & the API's working on my server) so using this (or not if you suggest) how do I:

    1. grab a subcribers personal data,

    2. display it via a prepopulated Jotform,

    3. check everything is OK (including the Credit card details) 

    4. Pass the valid data back to Jotform (preferably via POST) & update our DB.

    Anyone done this, or at least point me in the right diection here?


    Any advice will be very gratefully recieved!

  • Charlie
    Replied on September 10, 2015 at 4:34 AM

    Hi,

    If that's the case, there's two options that you can try.

    Option 1: Create your own HTML form or page dedicated to only updating some details to the subscriber (I assume you are not requesting for payment again?).

    With that in mind, here are the link to our API page using PHP:

    1. Let's say user wants to get his subscription or submission details by entering a specific ID or name, you can then follow this guide on how to fetch the submission data and prepopulate the HTML form: http://api.jotform.com/docs/#submission-id 

    2. After that, you can then refer to this link to edit or update those submissions: http://api.jotform.com/docs/#post-submission-id 

    3. At the same time, you can run your own PHP script to update your MySQL database.

     

    Option 2: Another way for this is using the edit link plus a Webhook. Instead of redirecting to a PHP script to run it, you can silently run it at the back end using WebHook, you can learn more about it here: https://www.jotform.com/help/245-How-to-Setup-Webhook-with-JotForm. However, I'm not sure if the Webhook will still trigger for edit link, I assume it will. You can have a PHP script in the Webhook that checks if it's a new or old submission.

     

    I hope that helps. You can also contact the API team for more details, here's their email address api@jotform.com

  • actors2014
    Replied on September 10, 2015 at 11:51 AM

    Cheers Charlie for the great answers. I'll try-out option one. Many thanks again ;)

  • Charlie
    Replied on September 10, 2015 at 1:13 PM

    You're welcome. I'm glad it helped. Should you need any assistance again, please feel free to contact us anytime.

    Thank you :)