I want to get the user profile data on connect to twitter. I managed to connect and get the access token and access token secret using Tweetsharp Lib. But trying to get the user profile throw an error. So I want to use the Rest Api and just get the info my self. I would like to see an example of how to pass the access token and or access token secret. Anybody can help me out please?
Asked
Active
Viewed 1,549 times
1 Answers
2
I am the developer of Tweetinvi which is a library similar to Tweetsharp but that is maintained and up to date.
You can get a user profile using the following code :
TwitterCredentials.SetCredentials("Access_Token", "Access_Token_Secret", "Consumer_Key", "Consumer_Secret");
var user = User.GetUserFromScreenName("<username>");
I hope this can help you with your code.
Cheers, Linvi

Linvi
- 2,077
- 1
- 14
- 28
-
Hi I tried to implemement your lib and after adding the dlls, using nuget and also tried using https://tweetinvi.codeplex.com/, but keep getting and error: "Error 6 The type or namespace name 'TwitterCredentials' does not exist in the namespace 'Tweetinvi' (are you missing an assembly reference?)". Any ideas? – mashta gidi May 25 '15 at 08:43
-
It seems that The new Tweetinvi Dll was refferencing .Net 4.5 where is my project was using .Net 4.0. I used an older version of Tweetinvi in order to solve this. – mashta gidi May 25 '15 at 10:25
-
after implementing your dlls in my code, it worked, but preety soon it is interfering with the facebook connect which retun null for some reason now. Any ideas please? – mashta gidi May 27 '15 at 12:06
-
I have no idea how this could be interfering with any other api as Tweetinvi is a self contained library. Could you please share which library you are using for Facebook? – Linvi May 28 '15 at 00:13
-
I am using facebook Sdk for C#, it's a facebook client that has RestClient and RestRequest Classes. The error I am getting is : "The request was aborted: Could not create SSL/TLS secure channel" – mashta gidi May 28 '15 at 07:32
-
Would you please confirm that the problem is related with Tweetinvi. You can do that by simply removing the reference to Tweetinvi in your application and check that Facebook works again. If it does please check the external libraries required by both libraries and verify if any conflict could exist. – Linvi May 29 '15 at 08:21
-
I solved the issue by changing the ssl3 to tsl, using the next line of code: ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls; my guess is that tweetnivi is using ssl3 and somehow that affected my code abillity to connect with facebook. – mashta gidi Jun 01 '15 at 12:25