when I’m trying to get these information with ASP.NET (C#), I get an error:
The remote server returned an error (403) Forbidden.
Here is the code I’m using to make an Get Request.
private void GetUserDetailsFromTwitter()
{
if (Request["oauth_token"] != null & Request["oauth_verifier"] != null)
{
imgTwitter.Visible = false;
tbleTwitInfo.Visible = true;
var oAuth = new oAuthTwitter();
//Get the access token and secret.
oAuth.AccessTokenGet(Request["oauth_token"], Request["oauth_verifier"]);
if (oAuth.TokenSecret.Length > 0)
{
//We now have the credentials, so make a call to the Twitter API.
url = "http://api.twitter.com/1/account/verify_credentials.xml";
xml = oAuth.oAuthWebRequest(oAuthTwitter.Method.POST, url, String.Empty);
XmlDocument xmldoc = new XmlDocument();
xmldoc.LoadXml(xml);
XmlNodeList xmlList = xmldoc.SelectNodes("/user");
foreach (XmlNode node in xmlList)
{
name = node["name"].InnerText;
username = node["screen_name"].InnerText;
profileImage = node["profile_image_url"].InnerText;
followersCount = node["followers_count"].InnerText;
noOfTweets = node["statuses_count"].InnerText;
recentTweet = node["status"]["text"].InnerText;
}
}
}
}