-
Notifications
You must be signed in to change notification settings - Fork 1
Questions Section
The options object is optional, can be an empty object also. update all your query fields in it. supported query fields are as follows:
let options = {"order": "desc","sort": "activity","site": "stackoverflow","key" : "your_key"}// questions objectconst stack_questions = stackexchange.questions;
Get all questions on the site.
// using questions endpointstack_questions.questions(options , (response) => {// response will be jsonconsole.log(response);});
Get the questions identified by a set of ids.
ids = "47559184"// using questions_by_ids endpointstack_questions.questions_by_ids(ids , options , (response) => {// response will be jsonconsole.log(response);});
Get the answers to the questions identified by a set of ids.
id = "47596027"// using answers_on_questions endpointstack_questions.answers_on_questions(id, options , (response) => {// response will be jsonconsole.log(response);});
Renders a hypothetical answer to a question. This is a post endpoints, the options section looks like this, both fields are required.
let options = {"body": "hello","site": "stackoverflow"}// id of the questionlet id = "47596027"// using render_answer endpointstack_questions.render_answer(id, options , (response) => {// response returns hypothetical solutionconsole.log(response);});
Get the questions that link to the questions identified by a set of ids.
// id of the questionlet id = "1884724";// using answers_on_questions endpointstack_questions.linked_questions(id, options , (response) => {console.log(response);});
Get the questions that are related to the questions identified by a set of ids.
// id of the questionlet id = "37878662";// using related_questions endpointstack_questions.related_questions(id, options , (response) => {console.log(response);});
Get the timelines of the questions identified by a set of ids.
// id of the questionlet id = "37878662";// using questions_timeline endpointstack_questions.questions_timeline(id, options, (response) => {console.log(response);});
Get all questions on the site with active bounties.
// using featured_questions endpointstack_questions.featured_questions(options, (response) => {//will return featured questionsconsole.log(response);});
Get all questions on the site with no answers.
// using no_answer_questions endpointstack_questions.no_answer_questions( options , (response) => {// will return no-answer questionsconsole.log(response);});
Get all questions the site considers unanswered.
// using unanswered_questions endpointstack_questions.unanswered_questions( options , (response) => {//returns unanswered questions detailsconsole.log(response);});
Get questions the site considers unanswered within a user's favorite or interesting tags. auth required This endpoint required access_token and key in options.
// using unanswered_questions_my_tags endpointstack_questions.unanswered_questions_my_tags( options , (response) => {console.log(response);});
Returns valid flag options for the given question. auth required. This endpoint required access_token and key in options.
let options = {"key": "your_key","access_token": "your_token","site": "stackoverflow"}let question_id = "37878662";// using question_flag_options endpointstack_questions.question_flag_options(question_id, options, (response) => {console.log(response);});
Returns valid flag options which are also close reasons for the given question. auth required. This endpoint required access_token and key in options.
let options = {"key": "your_key","access_token": "your_token","site": "stackoverflow"}let question_id = "37878662";// using question_close_options endpointstack_questions.question_close_options(question_id, options, (response) => {console.log(response);});
Get the comments on the questions identified by a set of ids. This endpoint required access_token and key in options.
let options = {"key": "your_key","access_token": "your_token","site": "stackoverflow"}let question_id = "45934757";// using comments_on_questions endpointstack_questions.comments_on_questions(question_id, options, (response) => {console.log(response);});