- 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.
UpdateMessageTemplateCommand
Updates the Amazon Q in Connect message template. Partial update is supported. If any field is not supplied, it will remain unchanged for the message template that is referenced by the $LATEST
qualifier. Any modification will only apply to the message template that is referenced by the $LATEST
qualifier. The fields for all available versions will remain unchanged.
Example Syntax
Use a bare-bones client and the command you need to make an API call.
import { QConnectClient, UpdateMessageTemplateCommand } from "@aws-sdk/client-qconnect"; // ES Modules import
// const { QConnectClient, UpdateMessageTemplateCommand } = require("@aws-sdk/client-qconnect"); // CommonJS import
const client = new QConnectClient(config);
const input = { // UpdateMessageTemplateRequest
knowledgeBaseId: "STRING_VALUE", // required
messageTemplateId: "STRING_VALUE", // required
content: { // MessageTemplateContentProvider Union: only one key present
email: { // EmailMessageTemplateContent
subject: "STRING_VALUE",
body: { // EmailMessageTemplateContentBody
plainText: { // MessageTemplateBodyContentProvider Union: only one key present
content: "STRING_VALUE",
},
html: {// Union: only one key present
content: "STRING_VALUE",
},
},
headers: [ // EmailHeaders
{ // EmailHeader
name: "STRING_VALUE",
value: "STRING_VALUE",
},
],
},
sms: { // SMSMessageTemplateContent
body: { // SMSMessageTemplateContentBody
plainText: {// Union: only one key present
content: "STRING_VALUE",
},
},
},
},
language: "STRING_VALUE",
defaultAttributes: { // MessageTemplateAttributes
systemAttributes: { // SystemAttributes
name: "STRING_VALUE",
customerEndpoint: { // SystemEndpointAttributes
address: "STRING_VALUE",
},
systemEndpoint: {
address: "STRING_VALUE",
},
},
agentAttributes: { // AgentAttributes
firstName: "STRING_VALUE",
lastName: "STRING_VALUE",
},
customerProfileAttributes: { // CustomerProfileAttributes
profileId: "STRING_VALUE",
profileARN: "STRING_VALUE",
firstName: "STRING_VALUE",
middleName: "STRING_VALUE",
lastName: "STRING_VALUE",
accountNumber: "STRING_VALUE",
emailAddress: "STRING_VALUE",
phoneNumber: "STRING_VALUE",
additionalInformation: "STRING_VALUE",
partyType: "STRING_VALUE",
businessName: "STRING_VALUE",
birthDate: "STRING_VALUE",
gender: "STRING_VALUE",
mobilePhoneNumber: "STRING_VALUE",
homePhoneNumber: "STRING_VALUE",
businessPhoneNumber: "STRING_VALUE",
businessEmailAddress: "STRING_VALUE",
address1: "STRING_VALUE",
address2: "STRING_VALUE",
address3: "STRING_VALUE",
address4: "STRING_VALUE",
city: "STRING_VALUE",
county: "STRING_VALUE",
country: "STRING_VALUE",
postalCode: "STRING_VALUE",
province: "STRING_VALUE",
state: "STRING_VALUE",
shippingAddress1: "STRING_VALUE",
shippingAddress2: "STRING_VALUE",
shippingAddress3: "STRING_VALUE",
shippingAddress4: "STRING_VALUE",
shippingCity: "STRING_VALUE",
shippingCounty: "STRING_VALUE",
shippingCountry: "STRING_VALUE",
shippingPostalCode: "STRING_VALUE",
shippingProvince: "STRING_VALUE",
shippingState: "STRING_VALUE",
mailingAddress1: "STRING_VALUE",
mailingAddress2: "STRING_VALUE",
mailingAddress3: "STRING_VALUE",
mailingAddress4: "STRING_VALUE",
mailingCity: "STRING_VALUE",
mailingCounty: "STRING_VALUE",
mailingCountry: "STRING_VALUE",
mailingPostalCode: "STRING_VALUE",
mailingProvince: "STRING_VALUE",
mailingState: "STRING_VALUE",
billingAddress1: "STRING_VALUE",
billingAddress2: "STRING_VALUE",
billingAddress3: "STRING_VALUE",
billingAddress4: "STRING_VALUE",
billingCity: "STRING_VALUE",
billingCounty: "STRING_VALUE",
billingCountry: "STRING_VALUE",
billingPostalCode: "STRING_VALUE",
billingProvince: "STRING_VALUE",
billingState: "STRING_VALUE",
custom: { // CustomAttributes
"<keys>": "STRING_VALUE",
},
},
customAttributes: {
"<keys>": "STRING_VALUE",
},
},
};
const command = new UpdateMessageTemplateCommand(input);
const response = await client.send(command);
// { // UpdateMessageTemplateResponse
// messageTemplate: { // MessageTemplateData
// 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
// content: { // MessageTemplateContentProvider Union: only one key present
// email: { // EmailMessageTemplateContent
// subject: "STRING_VALUE",
// body: { // EmailMessageTemplateContentBody
// plainText: { // MessageTemplateBodyContentProvider Union: only one key present
// content: "STRING_VALUE",
// },
// html: {// Union: only one key present
// content: "STRING_VALUE",
// },
// },
// headers: [ // EmailHeaders
// { // EmailHeader
// name: "STRING_VALUE",
// value: "STRING_VALUE",
// },
// ],
// },
// sms: { // SMSMessageTemplateContent
// body: { // SMSMessageTemplateContentBody
// plainText: {// Union: only one key present
// content: "STRING_VALUE",
// },
// },
// },
// },
// description: "STRING_VALUE",
// language: "STRING_VALUE",
// groupingConfiguration: { // GroupingConfiguration
// criteria: "STRING_VALUE",
// values: [ // GroupingValues
// "STRING_VALUE",
// ],
// },
// defaultAttributes: { // MessageTemplateAttributes
// systemAttributes: { // SystemAttributes
// name: "STRING_VALUE",
// customerEndpoint: { // SystemEndpointAttributes
// address: "STRING_VALUE",
// },
// systemEndpoint: {
// address: "STRING_VALUE",
// },
// },
// agentAttributes: { // AgentAttributes
// firstName: "STRING_VALUE",
// lastName: "STRING_VALUE",
// },
// customerProfileAttributes: { // CustomerProfileAttributes
// profileId: "STRING_VALUE",
// profileARN: "STRING_VALUE",
// firstName: "STRING_VALUE",
// middleName: "STRING_VALUE",
// lastName: "STRING_VALUE",
// accountNumber: "STRING_VALUE",
// emailAddress: "STRING_VALUE",
// phoneNumber: "STRING_VALUE",
// additionalInformation: "STRING_VALUE",
// partyType: "STRING_VALUE",
// businessName: "STRING_VALUE",
// birthDate: "STRING_VALUE",
// gender: "STRING_VALUE",
// mobilePhoneNumber: "STRING_VALUE",
// homePhoneNumber: "STRING_VALUE",
// businessPhoneNumber: "STRING_VALUE",
// businessEmailAddress: "STRING_VALUE",
// address1: "STRING_VALUE",
// address2: "STRING_VALUE",
// address3: "STRING_VALUE",
// address4: "STRING_VALUE",
// city: "STRING_VALUE",
// county: "STRING_VALUE",
// country: "STRING_VALUE",
// postalCode: "STRING_VALUE",
// province: "STRING_VALUE",
// state: "STRING_VALUE",
// shippingAddress1: "STRING_VALUE",
// shippingAddress2: "STRING_VALUE",
// shippingAddress3: "STRING_VALUE",
// shippingAddress4: "STRING_VALUE",
// shippingCity: "STRING_VALUE",
// shippingCounty: "STRING_VALUE",
// shippingCountry: "STRING_VALUE",
// shippingPostalCode: "STRING_VALUE",
// shippingProvince: "STRING_VALUE",
// shippingState: "STRING_VALUE",
// mailingAddress1: "STRING_VALUE",
// mailingAddress2: "STRING_VALUE",
// mailingAddress3: "STRING_VALUE",
// mailingAddress4: "STRING_VALUE",
// mailingCity: "STRING_VALUE",
// mailingCounty: "STRING_VALUE",
// mailingCountry: "STRING_VALUE",
// mailingPostalCode: "STRING_VALUE",
// mailingProvince: "STRING_VALUE",
// mailingState: "STRING_VALUE",
// billingAddress1: "STRING_VALUE",
// billingAddress2: "STRING_VALUE",
// billingAddress3: "STRING_VALUE",
// billingAddress4: "STRING_VALUE",
// billingCity: "STRING_VALUE",
// billingCounty: "STRING_VALUE",
// billingCountry: "STRING_VALUE",
// billingPostalCode: "STRING_VALUE",
// billingProvince: "STRING_VALUE",
// billingState: "STRING_VALUE",
// custom: { // CustomAttributes
// "<keys>": "STRING_VALUE",
// },
// },
// customAttributes: {
// "<keys>": "STRING_VALUE",
// },
// },
// attributeTypes: [ // MessageTemplateAttributeTypeList
// "STRING_VALUE",
// ],
// messageTemplateContentSha256: "STRING_VALUE", // required
// tags: { // Tags
// "<keys>": "STRING_VALUE",
// },
// },
// };
UpdateMessageTemplateCommand 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. |
messageTemplateId Required | string | undefined | The identifier of the message template. Can be either the ID or the ARN. It cannot contain any qualifier. |
content | MessageTemplateContentProvider | undefined | The content of the message template. |
defaultAttributes | MessageTemplateAttributes | undefined | An object that specifies the default values to use for variables in the message template. This object contains different categories of key-value pairs. Each key defines a variable or placeholder in the message template. The corresponding value defines the default value for that variable. |
language | string | undefined | The language code value for the language in which the quick response is written. The supported language codes include |
UpdateMessageTemplateCommand Output
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
$metadata Required | ResponseMetadata | Metadata pertaining to this request. |
messageTemplate | MessageTemplateData | undefined | The message template. |
Throws
Name | Fault | Details |
---|
Name | Fault | Details |
---|---|---|
AccessDeniedException | client | You do not have sufficient access to perform this action. |
ConflictException | client | The request could not be processed because of conflict in the current state of the resource. For example, if you're using a |
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. |