Newer Version Available

This content describes an older version of this product. View Latest

updateQuestionAndAnswers(String, String, ConnectApi.QuestionAndAnswersCapabilityInput)

Choose or change the best answer for a question.

API Version

32.0

Requires Chatter

Yes

Signature

public static ConnectApi.QuestionAndAnswersCapability updateQuestionAndAnswers(String communityId, String feedElementId, ConnectApi.QuestionAndAnswersCapabilityInput questionAndAnswersCapability)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
feedElementId
Type: String
The ID for a feed element.
questionAndAnswersCapability
Type: ConnectApi.​QuestionAndAnswers​CapabilityInput
Specify the best answer (comment ID) for the question.

Return Value

Type: ConnectApi.QuestionAndAnswersCapability

If the feed element doesn’t support this capability, the return value is ConnectApi.NotFoundException.

Example

1ConnectApi.QuestionAndAnswersCapabilityInput qaInput = new ConnectApi.QuestionAndAnswersCapabilityInput();
2qaInput.bestAnswerId = '0D7D00000000lMAKAY';
3
4ConnectApi.QuestionAndAnswersCapability qa = ConnectApi.QuestionAndAnswers.updateQuestionAndAnswers(null, '0D5D0000000XZjJ', qaInput);