1

ここに奇妙な問題があります。Aweber アプリを認証すると、認証コードが初めて機能します。

ただし、ページを更新すると、次のエラーが表示されます: AWeberAPIException:

Type: UnauthorizedError 
Msg : RequestToken key is invalid.     https://labs.aweber.com/docs/troubleshooting#unauthorized 

ドキュメント: https://labs.aweber.com/docs/troubleshooting#unauthorized

これは本当にイライラします助けてください。私が使用しているコードは次のとおりです。

require_once('aweber_api/aweber_api.php');

try {
# set $authorization_code to the code that is given to you from
# https://auth.aweber.com/1.0/oauth/authorize_app/YOUR_APP_ID
    $authorization_code="Azh...";

$auth = AWeberAPI::getDataFromAweberID($authorization_code);
list($consumerKey, $consumerSecret, $accessKey, $accessSecret) = $auth;

# Store the Consumer key/secret, as well as the AccessToken key/secret
# in your app, these are the credentials you need to access the API.
//$account = $aweber->getAccount($accessKey, $accessSecret);

}
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>";
}
4

1 に答える 1

4

わかりました、解決しました!

認証トークンに$consumerKey$consumetSecret、、、、$accessKeyおよび$accessSecret

次の行は、Array

$auth = AWeberAPI::getDataFromAweberID($authorization_code);

そう、

$consumerKey = $auth[0];
$consumerSecret = $auth[1];
$accessKey = $auth[2];
$accessSecret = $auth[3];

そして、これらの値を使用してアプリケーションを承認するだけです! もちろん、複数のユーザーが使用する場合は、これらの値をそれぞれに保存する必要があります。

于 2012-09-07T19:58:30.643 に答える