can';t删除订阅服务器aweber api php包装器
正如删除订阅服务器的文档中所预期的,但它不起作用can';t删除订阅服务器aweber api php包装器,api,aweber,Api,Aweber,正如删除订阅服务器的文档中所预期的,但它不起作用 require_once('aweber_api/aweber_api.php'); $consumerKey = '***'; # put your credentials here $consumerSecret = '***'; # put your credentials here $accessKey = '***'; # put your credentials here $accessSecret = '***
require_once('aweber_api/aweber_api.php');
$consumerKey = '***'; # put your credentials here
$consumerSecret = '***'; # put your credentials here
$accessKey = '***'; # put your credentials here
$accessSecret = '***'; # put your credentials here
$account_id = '***'; # put the Account ID here
$list_id = '***'; # put the List ID here
$aweber = new AWeberAPI($consumerKey, $consumerSecret);
try {
$account = $aweber->getAccount($accessKey, $accessSecret);
$listURL = "/accounts/{$account_id}/lists/{$list_id}";
$list = $account->loadFromUrl($listURL);
# subscriber to delete
$params = array(
'email' => 'johndoe@example.com'
);
$subscribers = $list->subscribers;
$new_subscriber = $subscribers->delete($params);
# success!
print "Subscriber was deleted!";
} catch(AWeberAPIException $exc) {
print "<h3>AWeberAPIException:</h3>";
print " <li> Type: $exc->type <br>";
print " <li> Msg : $exc->message <br>";
print " <li> Docs: $exc->documentation_url <br>";
print "<hr>";
exit(1);
}
require_once('aweber_api/aweber_api.php');
$consumerKey='***'#把你的证件放在这里
$ConsumerCret='***'#把你的证件放在这里
$accessKey='***'#把你的证件放在这里
$accessSecret='***'#把你的证件放在这里
$account_id='***'#把帐号放在这里
$list_id='***'#将列表ID放在这里
$aweber=新的AWeberAPI($consumerKey,$ConsumerCret);
试一试{
$account=$aweber->getAccount($accessKey,$accessSecret);
$listURL=“/accounts/{$account\u id}/lists/{$list\u id}”;
$list=$account->loadFromUrl($listURL);
#要删除的订阅服务器
$params=数组(
'电子邮件'=>'johndoe@example.com'
);
$subscribers=$list->subscribers;
$new_subscriber=$subscribers->delete($params);
#成功!
打印“已删除订阅服务器!”;
}捕获(AWeberAPIException$exc){
打印“AWeberAPIException:”;
打印“类型:$exc->Type
”;
打印“ Msg:$exc->message
”;
打印“ 文档:$exc->documentation_url
”;
打印“
”;
出口(1);
}
我的参考资料请尝试此代码。它对我有用
require_once('aweber_api/aweber_api.php');
$consumerKey = '###';
$consumerSecret = '###';
$accessKey = '###';
$accessSecret = '###';
$account_id = '###';
$list_id = '###';
$aweber = new AWeberAPI($consumerKey, $consumerSecret);
try {
$account = $aweber->getAccount($accessKey, $accessSecret);
$listURL = "/accounts/{$account_id}/lists/{$list_id}";
$list = $account->loadFromUrl($listURL);
$params = array(
'email' => 'info@examples.com'
);
$subscribers = $list->subscribers;
$found_subscribers = $subscribers->find($params);
foreach ($found_subscribers as $subscriber) {
$subscriber->delete();
}
print "Subscriber was deleted!";
} catch(AWeberAPIException $exc) {
print "AWeberAPIException:";
print "Type: $exc->type";
print "Msg : $exc->message";
print "Docs: $exc->documentation_url";
exit(1);
}