AWS Contact Center
Manage prompts programmatically with Amazon Connect
Introduction
Contact centers use prompts to interact with customers, to obtain information from customers and to provide updates to customers. Prompts are recorded audio files played in call flows. Contact center administrators need to react quickly to the business needs by adding new prompts or changing existing prompts.
Tracking and managing large numbers of prompts is a time-consuming task. Managing prompts across channels and using multiple languages complicates this further. Propagating prompts across deployment environments adds another dimension of complexity. Minor errors during manual prompt updates can result in inconsistent customer messaging, customer confusion, and potential misrouting of contacts. With Amazon Connect, businesses can use Prompts API operations to programmatically manage prompts using automation tools to streamline the prompt creation and management process.
In this blog post, you will learn how to deploy a web-based application to manage prompts in Amazon Connect using API operations. The post uses six prompt-specific API actions (List prompts, Create prompt, Update prompt, Describe prompt, Delete prompt, and Retrieve prompt file).
Overview of solution
This solution is deployed using an AWS CloudFormation template. It creates an Amazon S3 bucket and loads all the assets into Amazon CloudFront. Users invoke Amazon CloudFront URL to view the web User Interface(UI). Based on the prompt specific API operations you choose, this UI initiates the appropriate API operation in Amazon Connect.
Note: This sample project is designed to be deployed for experimentation. The Identity Access Management (IAM) policy permissions use least privilege, however the Amazon CloudFront deployed is publicly accessible. Please take the appropriate measures to secure your CloudFront distribution as required.
Prerequisites:
For this blog post, it is assumed that you understand the use of the services below and you have the following prerequisites:
-
- An AWS account with both management console and programmatic administrator access
- An existing Amazon Connect instance
- AWS IAM to create policies and roles
- Amazon CloudFront to create a distribution
- Amazon S3 to create buckets
- AWS CloudFormation to run the stack
- AWS IAM access and secret key credentials to execute the Connect API operations
Following is a sample policy with least minimum required access permissions:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "VisualEditor0",
"Effect": "Allow",
"Action": [
"s3:GetObject",
"connect:DescribeInstance",
"connect:UntagResource",
"connect:ListPrompts",
"connect:TagResource",
"s3:ListBucket"
],
"Resource": [
"arn:aws:connect:YOUR_REGION:YOUR_ACCOUNT_ID:instance/YOUR_INSTANCE_ID",
"arn:aws:s3:::YOUR_S3_BUCKET_NAME/*",
"arn:aws:s3:::YOUR_S3_BUCKET_NAME"
]
},
{
"Sid": "VisualEditor1",
"Effect": "Allow",
"Action": [
"connect:CreatePrompt",
"connect:UpdatePrompt",
"connect:DescribePrompt",
"connect:UntagResource",
"connect:DeletePrompt",
"connect:TagResource",
"connect:GetPromptFile"
],
"Resource": "arn:aws:connect:YOUR_REGION:YOUR_ACCOUNT_ID:instance/YOUR_INSTANCE_ID/prompt/*"
},
{
"Sid": "VisualEditor2",
"Effect": "Allow",
"Action": "connect:ListInstances",
"Resource": "*"
}
]
}
Deploy the solution
- Sign in to the AWS Management Console and select the same Region as your Amazon Connect instance.
- Click on to launch the AWS CloudFormation template.
- Enter a unique Stack name (e.g. prompts-api-web-ui).
- Select the check the box to acknowledge the IAM resource creation.
- Choose Create Stack. The AWS CloudFormation template takes about 10 minutes to create all the resources. Once done, the status changes to CREATE_COMPLETE.
- Navigate to the Outputs section of the newly created stack.
- Copy the value of CloudFrontEndpoint.
- Paste the URL in a new web browser tab/window to navigate to the CloudFront web UI.
How to access the web UI to manage prompts
Initial Configuration
- Enter the IAM User Access ID, Secret Access Key and Region (To get your access key ID and secret access key).
- Enter the Amazon Connect ARN (Find your Amazon Connect instance ARN).
- Choose Save Configurations.
Test the solution for managing the prompts in your Amazon Connect instance
Next, we will test the six prompts API operations on the navigation pane.
- List Prompts
- On the navigation menu, choose List Prompts
- This lists all prompts associated with your Amazon Connect instance in a tabular format on the center panel. Results can be sorted based on the prompt name. The right panel shows a JSON listing with the Prompt Id, ARN, and name.
- Log in to your Amazon Connect console and verify the prompts across both user interfaces.
- Create Prompt
- On the navigation menu, choose Create Prompt.
- Enter a unique name for the prompt
- Enter a valid description
- Enter the Amazon S3 URI for the prompt (Amazon S3 Location from where the prompt should be imported into the Amazon Connect instance)
- Choose Create Prompt. Results display the new prompt in the table along with updated JSON output.
- Verify the newly created prompt on the Amazon Connect console.
- Update Prompt
- In the center panel, select the prompt file name for the prompt to be updated.
- On the navigation menu, choose Update Prompt.
- The Update Prompt pop-up window pre-fills the name and description.
- Modify the values and click on Update Prompt on this window. In this example, you can see the description is updated with a new value.
- Verify the updated prompt description on the Amazon Connect console.
- Describe Prompt
- In the center panel, select the prompt file name.
- On the navigation panel, choose Describe Prompt.
- The right panel (Prompt ARN, Id, Name, Description and Tags) shows the updated description from the earlier Update Prompt API action.
- Get Prompt File
- Select the prompt you would like to listen to, or download by clicking on the prompt file name in the center panel.
- Click on the Get Prompt File button on the navigation pane.
- The right panel shows the API response with the prompt specific presigned URL.
- Prompt file plays in a new tab.
- Delete Prompt
- Select the prompt you would like to delete by clicking on the prompt file name in the center panel
- Click on the Delete Prompt button on the left panel
- Click on Yes to confirm deletion of the prompt.
- Once the prompt is deleted, you will see an updated list of prompts on the table (center panel) and JSON Output (Right Panel)
Clean up
To avoid incurring future charges, remove all the contents in the Amazon S3 bucket that you created as part of this blog. Empty the Amazon S3 bucket, then delete the bucket. You can remove all other created resources by deleting the AWS CloudFormation stack.
Conclusion
This blog post demonstrated how the newly launched Amazon Connect Prompts API operations can be used to programmatically manage prompts using a web UI example. Customers can now use API operations to extract prompts stored within Amazon Connect and back them up in an Amazon S3 bucket. They can programmatically swap out existing audio files, for example if they hire a new celebrity for recorded greetings. Prompts change logs are stored and presented to customers within the admin website. The prompts API operations support AWS CloudTrail, AWS CloudFormation and tagging.
Related links
To learn more about the technologies or features used to create this solution, see the following: