PHP icontact API integration



我正在使用icontact api 2.0在我的网站中集成icontact列表。我在创建新列表和添加新消息时遇到问题,它没有使用 API 创建任何列表。但是我可以创建联系人和订阅等等。使用的代码是

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));

还检查了一些帮助,但没有找到任何灵魂http://www.softwareprojects.com/resources/programming/t-icontact-20-api-integration-php-example-1925.html

问题可能出在 addList 的第二个参数上

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

4424 - 必须是您的某个列表已存在的有效消息 ID,如果您转到 iContact 仪表板并为其中一个列表创建欢迎消息,然后对其进行编辑,您将在 URL 上看到"iMessageId"参数。您可以将其用作第二个参数,它应该可以工作。

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

参考: http://developer.icontact.com/documentation/lists/

最新更新