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.