This is required to get the skin change endpoint to work in case the services do not trust your IP yet.
Most methods return MojangAPIResponse or class inherited from MojangAPIResponse.
You can check whether the request was successful or failed to check IsSuccess property in MojangAPIResponse.
If IsSuccess is false, Error and ErrorMessage property tell you why the request failed.
Example:
usingMojangAPI.SecurityQuestion;HttpClient httpClient =newHttpClient();QuestionFlow questionFlow =newQuestionFlow(httpClient);try{awaitquestionFlow.CheckTrusted("accessToken");Console.WriteLine("Your IP was trusted");}catch{QuestionList questions =awaitquestionFlow.GetQuestionList("accessToken");for (int i =0; i <questions.Count; i++) {Question question =questions[i];Console.WriteLine($"Q{i +1}. [{question.QuestionId}] {question.QuestionMessage}");Console.Write("Answer? : ");var answer =Console.ReadLine();question.Answer= answer;Console.WriteLine(); }awaitquestionFlow.SendAnswers(questions,session.AccessToken);Console.WriteLine("Success");}
Methods (QuestionFlow class)
CheckTrusted
Check if security questions are needed.
try{awaitquestionFlow.CheckTrusted("accessToken"); // trusted}catch{ // security questions are needed}
QuestionList list; // you can get this from GetQuestionsList method, like 'questionList' variable above.awaitquestionFlow.SendAnswers(list,"accessToken");