I'm trying to integrate iContact api with wordpress and I need to add/move/delete contacts in lists under certain circumstances.
I can add contact with addContact() method. But when I'm trying to subscribe contact via subscribeContactToList($iContactId, $iListId, $sStatus)
method, it doesn't work and returns me an emty array.
It seems I'm doing everything according to following example: https://github.com/icontact/icontact-api-php/blob/master/examples.php. I haven't any idea how can get it to work.
What am I doing wrong? Has anyone faced with such problem and which is the most proper way to tackle it?
Here is my code:
// Load the iContact library
require_once('icontact/iContactApi.php');
// configuring iContact API
iContactApi::getInstance()->setConfig(array(
'appId' => '',
'apiPassword' => '',
'apiUsername' => ''
));
$oiContact = iContactApi::getInstance();
$contactInfo = $oiContact->addContact(
$user->user_email,
'normal',
null,
$first_name,
$last_name,
null,
null,
null,
null,
null,
null,
null,
null,
null
);
$oiContact->subscribeContactToList($contactInfo->contactId, $list_id, 'normal');