- Newest
- Most votes
- Most comments
You are correct in your understanding that the GetMetricDataV2 API for Amazon Connect does not directly support grouping by phone number. The API documentation does not list phone number as one of the valid grouping options.
The valid groupings for GetMetricDataV2 include options like QUEUE, CHANNEL, ROUTING_PROFILE, AGENT, and various AGENT_HIERARCHY_LEVELS, among others. However, there is no specific grouping option for phone numbers.
As for workarounds, there are a few approaches you might consider:
-
Use available groupings: You can still group by QUEUE as you mentioned, which might give you some of the information you need.
-
Custom attribute: If it's crucial to group by phone number, you could potentially use a contact attribute to store the phone number information and then group by that attribute. The API supports grouping by custom contact attributes (like 'contact/segmentAttributes/connect:Subtype').
-
Post-processing: You could retrieve the data without grouping by phone number, and then perform the grouping in your application after receiving the API response.
-
Contact Trace Records (CTRs): For more detailed data including phone numbers, you might need to use Contact Trace Records. These provide comprehensive information about each contact, including the phone numbers involved.
-
Data exports: As you suggested, exporting all call data and processing it externally might be necessary if you need extensive phone number-based analysis.
If grouping by phone number is a critical requirement for your use case, you may want to consider combining the GetMetricDataV2 API results with other data sources or reaching out to AWS Support for more specific guidance tailored to your needs.
Sources
GetMetricDataV2 - Amazon Connect
GetMetricData - Amazon Connect
Relevant content
asked 2 years ago
- AWS OFFICIALUpdated 8 months ago

Thanks a lot for quick response. On your option #2 - Custom attribute. How could I use a contract attribute to store the phone number information? That sounds like a good workaround that I'd like to try.
When the call arrives you use a set attribute block to set the phone number to an attribute.