I'm using the AWeber API from Codeplex to create a private App.
According to the documentation at http://aweber.codeplex.com/documentation, after authorizing the application I can save the api.OAuthToken and api.OAuthTokenSecret to be used on further calls.
What I do in code is:
API api = new API(consumerKey, consumerSecret);
api.OAuthToken = oauth_token; // Saved previously
api.OAuthTokenSecret = oauth_token_secret; // Saved previously
Account account = api.getAccount();
in the call to api.getAccount()
I'm getting a Remote Server: 401 Not authorized
Exception.
What I'm doing wrong? How long can I store the tokens and still be valid? Do I need another call or set another field on api?
Thanks for all your responses.
Finally I get it working this way:
Use the PHP script provided in How to create an app in Aweber?
Copy the accessKey
and accessSecret
variables to your C# code (these are the permanent keys).
Initialize the API with this code:
AWeber.API api = new AWeber.API(consumerKey, consumerSecret);
api.OAuthToken = accessKey;
api.OAuthTokenSecret = accessSecret;
And then you can make further calls