Hello Experts,

I am new in stackapps.I have created account & i got api key. Now my question is that how can i access user accounts means users posted question and answer.If i want to post a question or answer through code so how? I am c# .net developer.Please help me to solve the problem. If any one have ant link or solution so please reply me.

Thanks in advance..

link|improve this question
feedback

2 Answers

up vote 3 down vote accepted

You may not post data to the api but retrieving data in c# is quite simple.

  • Create a project and get an api key. To get started, just make use your project's name, whatever it is and your profile url as the app's website. This information can be modified at any time in the future.
  • Download the source code for Soapi.CS
  • Either build or add a project reference to Soapi.net35 or Soapi.net40 to your project

and from there, it is quite simple

var context = new ApiContext(apiKey).Initialize(false);

var site = context.find("http://stackapps.com");

var skysQuestions = site.Users.ById(14).Questions.ToList();

foreach (Question in skysQuestions)
{
  Console.WriteLine(Question.Title);
}
link|improve this answer
So how would one of my users actually submit a question? – user4948 Feb 14 '11 at 0:12
@user: They would have to do it through the site itself. – George Edison Jun 28 '11 at 1:05
i added soad.dll as reference but i cant get Question as the Key word .. where did i go wrong – user1542 Mar 9 at 16:36
feedback

The current version of the API is read only, meaning you can not have users login and post answers/comments/questions. Theres documentation on the API, which you can get by click on the API documentation and help just here on the right column >>>>

link|improve this answer
feedback

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged