在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();
}
运行上面的代码后获取登录屏幕但无法登录。发生错误 注意:凭据无效 - 请重试