Question

I had originally posted a question about what API to use in regards to making a SharePoint 2010 timer job able to access the twitter API and chose the Spring Social .NET api and have run into another roadblock.

I cannot get the OAuth handshake or 'dance' to work.

I have the consumer key and secret linked to my account, as well as an access token and secret, but any time I try to initialize a TwitterServiceProvider object, any time I attempt to query I get a 401 error.

The console/mvc and wp7.1 examples provided dont give much insight how I can get this code (which should run with no human involvement) to work.

Does anyone have any good resources regarding this?

Thanks in advance

Was it helpful?

Solution

If you already have access token value and secret, you can do something like that:

ITwitter twitter = new TwitterTemplate("consumerKey", "consumerSecret", "accessTokenValue", "accessTokenSecret");
// twitterApi.UserOperations.GetUserProfile();

that is equivalent to :

TwitterServiceProvider serviceProvider = new TwitterServiceProvider("consumerKey", "consumerSecret");
ITwitter twitterApi = serviceProvider.GetApi("accessTokenValue", "accessTokenSecret");
// twitterApi.UserOperations.GetUserProfile();

How do you get the access token secret and value?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top