SearchQuickResponsesCommand

Searches existing Amazon Q in Connect quick responses in an Amazon Q in Connect knowledge base.

Example Syntax

Use a bare-bones client and the command you need to make an API call.

import { QConnectClient, SearchQuickResponsesCommand } from "@aws-sdk/client-qconnect"; // ES Modules import
// const { QConnectClient, SearchQuickResponsesCommand } = require("@aws-sdk/client-qconnect"); // CommonJS import
const client = new QConnectClient(config);
const input = { // SearchQuickResponsesRequest
  knowledgeBaseId: "STRING_VALUE", // required
  searchExpression: { // QuickResponseSearchExpression
    queries: [ // QuickResponseQueryFieldList
      { // QuickResponseQueryField
        name: "STRING_VALUE", // required
        values: [ // QuickResponseQueryValueList // required
          "STRING_VALUE",
        ],
        operator: "STRING_VALUE", // required
        allowFuzziness: true || false,
        priority: "STRING_VALUE",
      },
    ],
    filters: [ // QuickResponseFilterFieldList
      { // QuickResponseFilterField
        name: "STRING_VALUE", // required
        values: [ // QuickResponseFilterValueList
          "STRING_VALUE",
        ],
        operator: "STRING_VALUE", // required
        includeNoExistence: true || false,
      },
    ],
    orderOnField: { // QuickResponseOrderField
      name: "STRING_VALUE", // required
      order: "STRING_VALUE",
    },
  },
  nextToken: "STRING_VALUE",
  maxResults: Number("int"),
  attributes: { // ContactAttributes
    "<keys>": "STRING_VALUE",
  },
};
const command = new SearchQuickResponsesCommand(input);
const response = await client.send(command);
// { // SearchQuickResponsesResponse
//   results: [ // QuickResponseSearchResultsList // required
//     { // QuickResponseSearchResultData
//       quickResponseArn: "STRING_VALUE", // required
//       quickResponseId: "STRING_VALUE", // required
//       knowledgeBaseArn: "STRING_VALUE", // required
//       knowledgeBaseId: "STRING_VALUE", // required
//       name: "STRING_VALUE", // required
//       contentType: "STRING_VALUE", // required
//       status: "STRING_VALUE", // required
//       contents: { // QuickResponseContents
//         plainText: { // QuickResponseContentProvider Union: only one key present
//           content: "STRING_VALUE",
//         },
//         markdown: {//  Union: only one key present
//           content: "STRING_VALUE",
//         },
//       },
//       createdTime: new Date("TIMESTAMP"), // required
//       lastModifiedTime: new Date("TIMESTAMP"), // required
//       isActive: true || false, // required
//       description: "STRING_VALUE",
//       groupingConfiguration: { // GroupingConfiguration
//         criteria: "STRING_VALUE",
//         values: [ // GroupingValues
//           "STRING_VALUE",
//         ],
//       },
//       shortcutKey: "STRING_VALUE",
//       lastModifiedBy: "STRING_VALUE",
//       channels: [ // Channels
//         "STRING_VALUE",
//       ],
//       language: "STRING_VALUE",
//       attributesNotInterpolated: [ // ContactAttributeKeys
//         "STRING_VALUE",
//       ],
//       attributesInterpolated: [
//         "STRING_VALUE",
//       ],
//       tags: { // Tags
//         "<keys>": "STRING_VALUE",
//       },
//     },
//   ],
//   nextToken: "STRING_VALUE",
// };

SearchQuickResponsesCommand Input

Parameter
Type
Description
knowledgeBaseId
Required
string | undefined

The identifier of the knowledge base. This should be a QUICK_RESPONSES type knowledge base. Can be either the ID or the ARN. URLs cannot contain the ARN.

searchExpression
Required
QuickResponseSearchExpression | undefined

The search expression for querying the quick response.

attributes
Record<string, string> | undefined

The user-defined Amazon Connect contact attributes  to be resolved when search results are returned.

maxResults
number | undefined

The maximum number of results to return per page.

nextToken
string | undefined

The token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results.

SearchQuickResponsesCommand Output

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.
results
Required
QuickResponseSearchResultData[] | undefined

The results of the quick response search.

nextToken
string | undefined

The token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results.

Throws

Name
Fault
Details
AccessDeniedException
client

You do not have sufficient access to perform this action.

RequestTimeoutException
client

The request reached the service more than 15 minutes after the date stamp on the request or more than 15 minutes after the request expiration date (such as for pre-signed URLs), or the date stamp on the request is more than 15 minutes in the future.

ResourceNotFoundException
client

The specified resource does not exist.

ValidationException
client

The input fails to satisfy the constraints specified by a service.

QConnectServiceException
Base exception class for all service exceptions from QConnect service.