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.

Need help with gform_after_submission to Zoho CRM

  1. I have created a simple form to test sending entries from Gravity Forms to my client's ZohoCRM account. Here is the code that I've placed in the theme's functions.php file:

    add_action('gform_after_submission_11', 'post_to_third_party', 10, 2);
    function post_to_third_party($entry, $form) {
    
        $post_url = 'https://crm.zoho.com/crm/private/xml/Leads/insertRecords?authtoken=bba8f9f96fba37315278dd45d4cf2###&scope=crmapi';
        $body = array(
            'First Name' => $entry['1.3'],
            'Last Name' => $entry['1.6'],
            'Email' => $entry['5'],
            'Phone' => $entry['4'],
            );
    
        $request = new WP_Http();
        $response = $request->post($post_url, array('body' => $body));
    
    }

    Where gform_after_submission_11 is for form ID = 11, and I replaced the last 3 digits of our API token with # for security's sake.

    The form creates entries within Gravity Forms, but nothing shows up in Zoho. Do you know if there is a way for me to debug or look for errors? Any suggestions on the code itself?

    I've also tried to do this with Contacts, but no luck.

    Posted 9 years ago on Wednesday October 10, 2012 | Permalink
  2. Can you echo the variables or dump the arrays at every point to see if they contain the values you expect them to? Also, can you check the value of $response when it returns and see what that contains?

    Posted 9 years ago on Wednesday October 10, 2012 | Permalink