在https://labs.aweber.com .got创建帐户
App ID: ****
Consumer Key:****
Consumer Secret:******
在 index.php 中的代码是
require_once('aweber_api/aweber_api.php');
$consumerKey = "***"; # Put your consumer key here
$consumerSecret = "*****"; # Put your consumer secret key here
$aweber = new AWeberAPI($consumerKey, $consumerSecret);
/*echo "<pre>";
var_dump($aweber);exit;*/
if (empty($_COOKIE['accessToken'])) {
if (empty($_GET['oauth_token'])) {
$callbackUrl = 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
list($requestToken, $requestTokenSecret) = $aweber->getRequestToken($callbackUrl);
setcookie('requestTokenSecret', $requestTokenSecret);
setcookie('callbackUrl', $callbackUrl);
header("Location: {$aweber->getAuthorizeUrl()}");
exit();
}
$aweber->user->tokenSecret = $_COOKIE['requestTokenSecret'];
$aweber->user->requestToken = $_GET['oauth_token'];
$aweber->user->verifier = $_GET['oauth_verifier'];
list($accessToken, $accessTokenSecret) = $aweber->getAccessToken();
setcookie('accessToken', $accessToken);
setcookie('accessTokenSecret', $accessTokenSecret);
header('Location: '.$_COOKIE['callbackUrl']);
exit();
}
运行上述代码后,出现登录屏幕但无法登录。收到错误 通知:凭据无效 - 请重试