Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/309.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/templates/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 在aweberapi上保存身份验证密钥_C#_Asp.net_Aweber - Fatal编程技术网

C# 在aweberapi上保存身份验证密钥

C# 在aweberapi上保存身份验证密钥,c#,asp.net,aweber,C#,Asp.net,Aweber,我正在使用Codeplex的AWeber API创建一个私有应用程序 根据处的文档,在授权应用程序后,我可以保存api.OAuthToken和api.OAuthTokenSecret以供进一步调用使用 我在代码中所做的是: API api = new API(consumerKey, consumerSecret); api.OAuthToken = oauth_token; // Saved previously api.OAuthTokenSecret = oaut

我正在使用Codeplex的AWeber API创建一个私有应用程序

根据处的文档,在授权应用程序后,我可以保存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()
的过程中,我得到一个
远程服务器:401未授权
异常

我做错了什么?我可以将代币存储多长时间并且仍然有效?我需要另一个调用还是在api上设置另一个字段


谢谢您的回复。

最后,我还是这样做的:

  • 使用中提供的PHP脚本

  • accessKey
    accessSecret
    变量复制到您的C#code(这些是永久密钥)

  • 使用以下代码初始化API:

  • AWeber.API=新的AWeber.API(consumerKey,ConsumerCret)

    然后你可以打更多的电话

    api.OAuthToken = accessKey;
    
    api.OAuthTokenSecret = accessSecret;