- 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.
SearchMessageTemplatesCommand
Searches for Amazon Q in Connect message templates in the specified knowledge base.
Example Syntax
Use a bare-bones client and the command you need to make an API call.
import { QConnectClient, SearchMessageTemplatesCommand } from "@aws-sdk/client-qconnect"; // ES Modules import
// const { QConnectClient, SearchMessageTemplatesCommand } = require("@aws-sdk/client-qconnect"); // CommonJS import
const client = new QConnectClient(config);
const input = { // SearchMessageTemplatesRequest
knowledgeBaseId: "STRING_VALUE", // required
searchExpression: { // MessageTemplateSearchExpression
queries: [ // MessageTemplateQueryFieldList
{ // MessageTemplateQueryField
name: "STRING_VALUE", // required
values: [ // MessageTemplateQueryValueList // required
"STRING_VALUE",
],
operator: "STRING_VALUE", // required
allowFuzziness: true || false,
priority: "STRING_VALUE",
},
],
filters: [ // MessageTemplateFilterFieldList
{ // MessageTemplateFilterField
name: "STRING_VALUE", // required
values: [ // MessageTemplateFilterValueList
"STRING_VALUE",
],
operator: "STRING_VALUE", // required
includeNoExistence: true || false,
},
],
orderOnField: { // MessageTemplateOrderField
name: "STRING_VALUE", // required
order: "STRING_VALUE",
},
},
nextToken: "STRING_VALUE",
maxResults: Number("int"),
};
const command = new SearchMessageTemplatesCommand(input);
const response = await client.send(command);
// { // SearchMessageTemplatesResponse
// results: [ // MessageTemplateSearchResultsList // required
// { // MessageTemplateSearchResultData
// messageTemplateArn: "STRING_VALUE", // required
// messageTemplateId: "STRING_VALUE", // required
// knowledgeBaseArn: "STRING_VALUE", // required
// knowledgeBaseId: "STRING_VALUE", // required
// name: "STRING_VALUE", // required
// channelSubtype: "STRING_VALUE", // required
// createdTime: new Date("TIMESTAMP"), // required
// lastModifiedTime: new Date("TIMESTAMP"), // required
// lastModifiedBy: "STRING_VALUE", // required
// isActive: true || false,
// versionNumber: Number("long"),
// description: "STRING_VALUE",
// groupingConfiguration: { // GroupingConfiguration
// criteria: "STRING_VALUE",
// values: [ // GroupingValues
// "STRING_VALUE",
// ],
// },
// language: "STRING_VALUE",
// tags: { // Tags
// "<keys>": "STRING_VALUE",
// },
// },
// ],
// nextToken: "STRING_VALUE",
// };
SearchMessageTemplatesCommand Input
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
knowledgeBaseId Required | string | undefined | The identifier of the knowledge base. Can be either the ID or the ARN. URLs cannot contain the ARN. |
searchExpression Required | MessageTemplateSearchExpression | undefined | The search expression for querying the message template. |
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. |
SearchMessageTemplatesCommand Output
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
$metadata Required | ResponseMetadata | Metadata pertaining to this request. |
results Required | MessageTemplateSearchResultData[] | undefined | The results of the message template search. |
nextToken | string | undefined | If there are additional results, this is the token for the next set of results. |
Throws
Name | Fault | Details |
---|
Name | Fault | Details |
---|---|---|
AccessDeniedException | client | You do not have sufficient access to perform this action. |
ResourceNotFoundException | client | The specified resource does not exist. |
ThrottlingException | client | The throttling limit has been exceeded. |
ValidationException | client | The input fails to satisfy the constraints specified by a service. |
QConnectServiceException | Base exception class for all service exceptions from QConnect service. |