Inserting Records into Zoho causes Fatal Error
hey there,
I've been hitting a wall for the past 2 days on this and finally reaching out for some support. I'm using the PHP SDK and attempting to
Insert a Specific Record into the Contacts Module.
I get a PHP Fatal Error:
- [24-Feb-2019 22:29:49 UTC] PHP Fatal error: Uncaught Error: Call to a member function getEntityId() on array in /app/public/wp-content/plugins/nano-wc-zoho-integration/vendor/zohocrm/php-sdk/src/com/zoho/crm/library/api/handler/MassEntityAPIHandler.php:34
- Stack trace:
- #0 /app/public/wp-content/plugins/nano-wc-zoho-integration/vendor/zohocrm/php-sdk/src/com/zoho/crm/library/crud/ZCRMModule.php(952): MassEntityAPIHandler->createRecords(Array, NULL)
- #1 /app/public/wp-content/plugins/nano-wc-zoho-integration/includes/class-nano-wc-zoho.php(256): ZCRMModule->createRecords(Array)
- #2 /app/public/wp-content/plugins/nano-wc-zoho-integration/includes/class-nano-wc-zoho.php(178): Nano_WC_Zoho->insert_into_zoho('Contacts', Array)
- #3 /app/public/wp-includes/class-wp-hook.php(286): Nano_WC_Zoho->nano_add_contact_to_zoho('')
- #4 /app/public/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters(NULL, Array)
- #5 /app/public/wp-includes/plugin.php(465): WP_Hook->do_action(Array)
- #6 /app/public/wp-settings.php(374): do_action('plugins_loaded')
- #7 /app/public/wp-config in /app/public/wp-content/plugins/nano-wc-zoho-integration/vendor/zohocrm/php-sdk/src/com/zoho/crm/library/api/handler/MassEntityAPIHandler.php on line 34
Here's my Records Array:
- $records = array(
- 'data' => array([
- 'Last_Name' => 'Lastname',
- 'Email' => 'demo@email.com',
- ])
- );
And my call to the API:
- $zcrmModuleInstance = ZCRMModule::getInstance('Contacts');
- $apiResponse = $zcrmModuleInstance->createRecords($records);
- $results = $apiResponse->getEntityResponses();
- foreach($results as $result) {
- error_log('Status: '. $result->getStatus());
- }
I've tried converting the $records array into json. Tried casting to an Object.
Any help would be greatly appreciated! FWIW - I am able to search my Zoho CRM account and it works perfectly indicating no oAuth issues.