How do I mark an answer as Best Answer through ConenctApi? I tried setting bestAnswerId of ConnectApi.QuestionAndAnswersCapabilityInput but it does not mark the answer as Best Answer.

ConnectApi.QuestionAndAnswersCapabilityInput questionAndAnswerCapabilitiesInput = new ConnectApi.QuestionAndAnswersCapabilityInput();
questionAndAnswerCapabilitiesInput.bestAnswerId = feedComment.Id;

Can someone help how to post the answer as Best Answer?


You need to use ConnectApi.QuestionAndAnswers.updateQuestionAndAnswers after this.


ConnectApi.QuestionAndAnswersCapability result = ConnectApi.QuestionAndAnswers.updateQuestionAndAnswers(communityId, QuestionId, bestAnswerId);

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.