Call to undefined method addWithDupCheck()

This was working all this while.

$user_id = $infusionsoft->contacts->addWithDupCheck($contact, 'Email');

PHP Fatal error: Uncaught Error: Call to undefined method Infusionsoft\Api\Rest\ContactService::addWithDupCheck() in /home/user/public_html/infusionsoft/addContact.cli.php:29

Looks like you are using the infusionsoft php library from github and probably just updated it. The current version includes the REST api which is defaulted to instead of the older XML-RPC api, see this part in the readme: https://github.com/infusionsoft/infusionsoft-php#breaking-change

Basically, you have to update that line to the following, i.e. adding “(‘xml’)” to the ‘contacts’ object:
$user_id = $infusionsoft->contacts('xml')->addWithDupCheck($contact, 'Email');

You will have to do this anywhere that uses the older XML-RPC part of the library, so any $infusionsoft->contacts->… calls will need to be updated, as well as any orders or products calls (again, see the readme link for details).

Thank You so much for solving this. Thanks again.

You are welcome, I ran into the same thing, teach me to update a library without checking what was updated first… :roll_eyes: