PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Posting Submitting Form Data to 3rd party service

  1. Hey everyone.
    I'm trying to figure some things out about how to post form data from Gravity Forms to a 3rd Party Service, such as Podio.com.

    They have an API to interact with, so it's possible.

    However, I'm really not familiar with how to do this. Ideally, I'd like to learn to do this myself, but would be willing to pay for someone to do it for me.

    I see that there's some documentation on how to accomplish this here: http://www.gravityhelp.com/documentation/page/Gform_after_submission

    I'm confused by the example provided, though. Is this something that needs to be done in the functions.php file?

    Seriously lost and would appreciate some guidance.
    Thanks.

    Posted 13 years ago on Tuesday September 13, 2011 | Permalink
  2. The gform_after_submission hook is available in 1.6, which has not yet been released (It's currently in beta. The documentation is a little ahead of the final release.) In the current production release, 1.5.2.8, a roughly equivalent hook is gform_post_submission.

    Using any of the filters or hooks will be done in your current theme's functions.php file.

    A hook is used to run your code at that particular time. This particular hook is processed after the form is submitted, notifications are sent and entry is created. You "hook" your code to that action, so your custom code runs when that hook is executed.

    That's the high level overview.

    If you cannot use the form confirmation option of 'redirect', then you will have to use one of these two hooks to run custom code to interact with your external service's API. All your custom code will go in a function in functions.php, and you tell WordPress to run your code when the Gravity Forms hook is executed. Does that help at all?

    Posted 13 years ago on Wednesday September 14, 2011 | Permalink
  3. Here's a rough example:

    [php]
    // run only on form 6.  if your form ID is different, change the 6 here to your form ID
    add_action("gform_post_submission_6", "notify_podio", 10, 2);
    function notify_podio($entry,$form) {
        // first get the values you need from the form.
        // view the source of the HTML in form preview to find the IDs
    
        // field ID 1, part 3 for first name
        $fname       = rgpost('input_1_3');
    
        // field ID 1, part 6 for last name
        $lname       = rgpost('input_1_6');
    
        // field ID 4 for email address
        $email       = rgpost('input_4');
    
        // integrate with podio.com
        // contact their API endpoint or something
        $podio_result = do_something();
    
        // check the value returned from the attempt
        if ($podio_result == 1) {
            $success = TRUE;
        }
        else {
            $success = FALSE;
        }
        wp_mail('youremail@example.com', 'Podio Results', 'Email body here');
    }
    Posted 13 years ago on Wednesday September 14, 2011 | Permalink
  4. That actually helps a lot. I'm still not sure I could handle it on my own, but I think this at least gives me a good start. How you pass the values makes a little more sense to me now; I think it's just a matter of how to interact with Podio's API now. There's documentation on that, but I'll see if there are more examples to draw from.

    Thanks again.

    Posted 13 years ago on Wednesday September 14, 2011 | Permalink
  5. If you would like to contact a developer about implementing this, check out our new Job Board. You can post a request there and have developers contact you, or you can use the list of developers in the sticky post.

    Glad you found the example useful. If you need assistance once you get into it. please post again.

    Posted 13 years ago on Wednesday September 14, 2011 | Permalink
  6. What I'm working on may help. I'm doing a CRM and payment gateway interface.

    In each case, I looked for sample PHP code from the vendor.

    Typically, there are 2 ways to interface & I'm lucky enough to have 1 of each:

    Soap and REST (CURL in PHP).

    In each case, you must first establish the conduit, then, format the call, then, make the call and look at the results.

    If this is your first time with SOAP, you may find some assistance with a free diagnostic program - soapui comes to mind.

    Good luck, feel free to get into details, if I know, I'll answer.

    Posted 13 years ago on Thursday September 15, 2011 | Permalink
  7. That's awesome, Jim. I'm afraid, though, this is beyond my range of technical... =(
    Though with the code provided already, I suppose I can grab an example from Podio and see what I can do to make sense of it.

    Thanks for the info, man. That's also rather helpful!

    Posted 13 years ago on Friday September 16, 2011 | Permalink

This topic has been resolved and has been closed to new replies.