0

我使用 getreponse php 客户端(https://github.com/GetResponse/getresponse-api-php/blob/master/src/GetResponseAPI3.class.php)将联系人添加到列表中。

$fname ="mike";
$lname = "";
$email = "mike@test.com";

$getresponse = new GetResponse('xxxxxxxxxxxxxxxxxxx');

$response = $getresponse->addContact(array(
'name'              => $fname . " " . $lname,
'email'             => $email,
'dayOfCycle'        => 0,
'campaign'          => array('campaignId' => '999999999')
));

尝试此代码时出现此错误:

object(stdClass)#2 (7) { ["httpStatus"]=> int(403) ["code"]=> int(0) ["codeDescription"]=> string(38) "Internal error, please contact support" ["message"]=> string(58) "Access Forbidden! You have no access to campaign: 9999999" ["moreInfo"]=> string(46) "https://apidocs.getresponse.com/en/v3/errors/0" ["context"]=> array(0) { } ["uuid"]=> string(36) "503b85fb-799c-46ec-b297-" }

我有正确的 API 密钥和活动 ID。

对此有什么帮助吗?

4

2 回答 2

0

我不知道为什么它不适合你..但它工作得很好..我从过去 3-4 天开始搜索这段代码。

我从你提到的github下载了sdk文件。后来我做了以下编码。这是我所做的更改:

require_once dirname(__FILE__) . '/getresponse-api/src/GetResponseAPI3.class.php';
$fname ="mike";
$lname = "";
$email = "mike@test.com";

$getresponse = new GetResponse('xxxxxxxxxxxxxxxxxxx');

$response = $getresponse->addContact(array(
'name'              => $fname . " " . $lname,
'email'             => $email,
'dayOfCycle'        => 0,
'campaign'          => array('campaignId' => '999999999')
));


echo print_r($response);
于 2020-04-10T20:44:38.067 回答
0

不要在您的请求中使用广告系列名称,请使用广告系列令牌。您可以使用此 api 方法获取包括令牌在内的活动列表:

https://apidocs.getresponse.com/en/v3/resources/campaigns#campaigns.get.all

它对我来说没有任何问题

于 2016-08-29T13:59:43.157 回答