Skip to content

Pull historical AWS Connect (CTR) Contract Trace Records

0

We would like to pull historical CTR data from AWS Connect.

See https://docs.aws.amazon.com/connect/latest/adminguide/ctr-data-model.html

Is there a way we could pull that data via a script, API, or query?

2 Answers
1

Yes, you can pull historical Contact Trace Records (CTR) data from Amazon Connect using several methods:

  1. Using Amazon Kinesis Data Streams:
  • Configure your Amazon Connect instance to stream CTR data to a Kinesis Data Stream
  • Use the AWS SDK (like Boto3 for Python) to consume the data from the stream
  • Each record contains detailed contact information including recording locations
  1. Querying CTR data stored in Amazon S3:
  • Ensure CTRs are being stored in an S3 bucket
  • Use Amazon Athena to run SQL queries directly against this data
  • Write queries to extract specific information like phone numbers, timestamps, call durations, etc.
  1. Amazon Connect Analytics Data Lake:
  • If you have access to the Connect Analytics data lake, you can use SQL queries to extract CTR information
  • This allows for more complex analysis and reporting

For example, you could write an Athena SQL query to separate inbound and outbound calls:

SELECT 
InitiationMethod,
SUM(AgentInteractionDuration) as TotalCallDuration
FROM 
"your_ctr_table"
WHERE 
InitiationMethod IN ('INBOUND', 'OUTBOUND')
GROUP BY 
InitiationMethod

Note that there are time limitations for historical data access. According to documentation, the GetMetricDataV2 API allows you to retrieve historical metrics for the last 3 months. For data older than that, you would need to ensure you've been storing the CTR data in S3 or another persistent storage solution.
Sources
Programmatically Get Call Recording Filename | AWS re:Post
Downloading yearly call data from Amazon Connect | AWS re:Post
Sum total time of inbound / outbound calls | AWS re:Post

answered 8 months ago
EXPERT
reviewed 8 months ago
0

Currently, there is no direct API available for accessing complete historical CTR data from Amazon Connect. However, for accessing complete CTR data, you would need to set up CTR streams through Amazon Kinesis Data Firehose or Amazon Kinesis Data Streams to capture and store the data in Amazon S3 buckets. This approach allows you to stream your Contact Trace Records to S3 in real-time as contacts are processed through your Connect instance [1]. You could then query the data using Athena.

References: https://aws.amazon.com/blogs/contact-center/analyze-amazon-connect-contact-trace-record-with-amazon-athena-and-amazon-quicksight-part-1/

AWS
answered 8 months ago
EXPERT
reviewed 8 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.