Insert record with a different Owner

Insert record with a different Owner

I am trying to add Calls to the CRM using the API 2.0 and PHP

I am retrieving call CDR records from our phone system, and I want to insert them into the Calls module, but with the 'Owner' being the relevent user.

I have tried the following:
  1. $user = ZCRMOrganization::getInstance()->getUser($userId);

  2. //Confirm we have the user object
  3. print_r($user);

  4. //Create empty call instance
  5. $callInstance = ZCRMRecord::getInstance("Calls",null);

  6. //Other code in here

  7. //Set the owner
    $callInstance->setOwner($user);
This returns the error:
zohocrm\php-sdk\src\com\zoho\crm\library\api\handler\EntityAPIHandler.php:232

The same error is returned if I pass the ID as a string, or the e-mail address of the user.

I have also tried
  1. $callInstance->setFieldValue("Owner", $user);
Any ideas?

If I remove the owner section - it works fine, but creates the records as "me" - which is how I authenticated throught the API. My user is an Administrator.