2013-12-09 38 views
0

我使用Codeplex的AWeber API创建私有应用程序。在AWeber API上保存身份验证密钥

根据http://aweber.codeplex.com/documentation的文档,在授权应用程序后,我可以保存api.OAuthToken和api.OAuthTokenSecret以用于进一步调用。

我的代码做的是:

API api = new API(consumerKey, consumerSecret); 

    api.OAuthToken = oauth_token; // Saved previously 
    api.OAuthTokenSecret = oauth_token_secret; // Saved previously 

    Account account = api.getAccount(); 
呼叫

api.getAccount()我得到一个Remote Server: 401 Not authorized异常。

我在做什么错了?我可以存储多久的令牌并仍然有效?我是否需要另一个电话或在api上设置另一个字段?

感谢您的回复。

回答

0

最后我得到它的工作是这样的:

  1. 使用在How to create an app in Aweber?

  2. 复制accessKeyaccessSecret变量到您的C#代码(这些是永久密钥)提供的PHP脚本。

  3. 与此代码初始化API:

AWeber.API API =新AWeber.API(consumerKey,consumerSecret);

api.OAuthToken = accessKey; 

api.OAuthTokenSecret = accessSecret; 

然后你就可以做进一步的通话

相关问题