- Navigation GuideYou are on a Command (operation) page with structural examples. Use the navigation breadcrumb if you would like to return to the Client landing page.
PutFeedbackCommand
Enables your end user to provide feedback on their Amazon Q Business generated chat responses.
Example Syntax
Use a bare-bones client and the command you need to make an API call.
import { QBusinessClient, PutFeedbackCommand } from "@aws-sdk/client-qbusiness"; // ES Modules import
// const { QBusinessClient, PutFeedbackCommand } = require("@aws-sdk/client-qbusiness"); // CommonJS import
const client = new QBusinessClient(config);
const input = { // PutFeedbackRequest
applicationId: "STRING_VALUE", // required
userId: "STRING_VALUE",
conversationId: "STRING_VALUE", // required
messageId: "STRING_VALUE", // required
messageCopiedAt: new Date("TIMESTAMP"),
messageUsefulness: { // MessageUsefulnessFeedback
usefulness: "USEFUL" || "NOT_USEFUL", // required
reason: "NOT_FACTUALLY_CORRECT" || "HARMFUL_OR_UNSAFE" || "INCORRECT_OR_MISSING_SOURCES" || "NOT_HELPFUL" || "FACTUALLY_CORRECT" || "COMPLETE" || "RELEVANT_SOURCES" || "HELPFUL" || "NOT_BASED_ON_DOCUMENTS" || "NOT_COMPLETE" || "NOT_CONCISE" || "OTHER",
comment: "STRING_VALUE",
submittedAt: new Date("TIMESTAMP"), // required
},
};
const command = new PutFeedbackCommand(input);
const response = await client.send(command);
// {};
PutFeedbackCommand Input
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
applicationId Required | string | undefined | The identifier of the application associated with the feedback. |
conversationId Required | string | undefined | The identifier of the conversation the feedback is attached to. |
messageId Required | string | undefined | The identifier of the chat message that the feedback was given for. |
messageCopiedAt | Date | undefined | The timestamp for when the feedback was recorded. |
messageUsefulness | MessageUsefulnessFeedback | undefined | The feedback usefulness value given by the user to the chat message. |
userId | string | undefined | The identifier of the user giving the feedback. |
PutFeedbackCommand Output
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
$metadata Required | ResponseMetadata | Metadata pertaining to this request. |
Throws
Name | Fault | Details |
---|
Name | Fault | Details |
---|---|---|
AccessDeniedException | client | You don't have access to perform this action. Make sure you have the required permission policies and user accounts and try again. |
InternalServerException | server | An issue occurred with the internal server used for your Amazon Q Business service. Wait some minutes and try again, or contact Support for help. |
ResourceNotFoundException | client | The application or plugin resource you want to use doesn’t exist. Make sure you have provided the correct resource and try again. |
ThrottlingException | client | The request was denied due to throttling. Reduce the number of requests and try again. |
ValidationException | client | The input doesn't meet the constraints set by the Amazon Q Business service. Provide the correct input and try again. |
QBusinessServiceException | Base exception class for all service exceptions from QBusiness service. |