2

I am using icontact api 2.0 for integrating the icontact list in my site. I face an issue with creating new list and adding new message its not create any list using the API.But i can create contact and subscribe and so on.. Code used is

require_once('lib/iContactApi.php');


// Give the API your information
iContactApi::getInstance()->setConfig(array(
    'appId'       => 'my_APIID', 
    'apiPassword' => 'my_password', 
    'apiUsername' => 'my_username'
));

// Store the singleton
$oiContact = iContactApi::getInstance();

$oiContact->addList('test', 4424, true, false, false, 'Just an example list',"test");

$oiContact->addMessage('An Example Message', 585, '<h1>An Example Message</h1>', 'An Example Message', 'ExampleMessage', 33765, 'normal');
// Schedule send
$oiContact->sendMessage(array(33765), 179962, null, null, null, mktime(0, 0, 0, 10, 03, 2012));

Also checked some help but not found any soulution http://www.softwareprojects.com/resources/programming/t-icontact-20-api-integration-php-example-1925.html

Charles
  • 50,943
  • 13
  • 104
  • 142
Jobin
  • 8,238
  • 1
  • 33
  • 52

1 Answers1

1

The problem is probably on the second parameter to addList

$oiContact->addList('test', 4424, true, false, false, 'Just an example list',"test");

4424 - has to be a valid message id that already exists for one of your list, if you go to your icontact dashboard and create a welcome message for one of your list and then edit it, you will see on the url an "iMessageId" parameter. You can use this as the second parameter and it should work.

https://app.sandbox.icontact.com/icp/core/code/message/edit/?token=ff1a8748b08088d41e69215c75295c98&iMessageId=1979804&sHubId=41254750ca180a4e7b3

ref: http://developer.icontact.com/documentation/lists/

Pragnesh Chauhan
  • 8,363
  • 9
  • 42
  • 53
Herbert Balagtas
  • 1,929
  • 1
  • 12
  • 6
  • Actually i found the issue ,the message was not there .but your are correct .This old issue any way thanks.. – Jobin Dec 13 '12 at 19:18
  • Just thought I'd help out, was currently working on icontact api as well. API seems to be unable to resubscribe a user after they unsubscribed. – Herbert Balagtas Dec 14 '12 at 19:59
  • Yes,You are right you cannot resubscribe a user once unsubscribed using API.This we can achieve by tricky.Create two list one Subscribed and unsubscribed,when the user apply subscription move theor id to subscribed list else reverse. – Jobin Dec 15 '12 at 01:52
  • Hey thanks, I missed that move feature on the api, got it working now. – Herbert Balagtas Dec 17 '12 at 20:36