【发布时间】:2015-09-21 09:44:48
【问题描述】:
我有这段代码可以在 GetResponse 中查找联系人以查看它是否存在。 第一部分(获取活动)有效,但获取联系人失败并出现异常:请求返回错误:无效参数:
<?php
$jsonfile = 'jsonrpcclient.php';
if (file_exists($jsonfile))
{
require_once $jsonfile;
$api_key = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';
$api_url = 'http://api2.getresponse.com';
$client = new jsonRPCClient($api_url);
$result = NULL;
// Get campaign
try
{
$result = $client->get_campaigns(
$api_key,
array (
'name' => array ( 'EQUALS' => 'my_customer_list' )
)
);
}
catch (Exception $e)
{
die($e->getMessage());
}
$campaigns = array_keys($result);
$CAMPAIGN_ID = array_pop($campaigns);
// Lookup contact
try
{
$result = $client->get_contacts(
$api_key,
array (
'campaigns' => $CAMPAIGN_ID,
'email' => $track_order_email
)
);
}
catch (Exception $e)
{
die($e->getMessage());
}
}
else
{
echo "Json include file NOT found";
}
?>
如果在格式化 get_contacts 参数方面提供任何帮助,我们将不胜感激。
【问题讨论】:
-
为什么不检查
jsonRPCClient类中的get_contacts方法定义,看看它需要哪些参数?
标签: php json api getresponse