Connect / Client / get_contact_metrics
get_contact_metrics¶
- Connect.Client.get_contact_metrics(**kwargs)¶
Retrieves the position of the contact in the queue.
Use cases
Following are common uses cases for position in queue:
Understand the expected wait experience of a contact.
Inform customers of their position in queue and potentially offer a callback.
Make data-driven routing decisions between primary and alternative queues.
Enhance queue visibility and leverage agent proficiencies to streamline contact routing.
Important things to know
The only way to retrieve the position of the contact in queue is by using this API. You can’t retrieve the position by using flows and attributes.
For more information, see the Position in queue metric in the Amazon Connect Administrator Guide.
Endpoints: See Amazon Connect endpoints and quotas.
See also: AWS API Documentation
Request Syntax
response = client.get_contact_metrics( InstanceId='string', ContactId='string', Metrics=[ { 'Name': 'POSITION_IN_QUEUE' }, ] )
- Parameters:
InstanceId (string) –
[REQUIRED]
The identifier of the Amazon Connect instance. You can find the instance ID in the Amazon Resource Name (ARN) of the instance.
ContactId (string) –
[REQUIRED]
The identifier of the contact in this instance of Amazon Connect.
Metrics (list) –
[REQUIRED]
A list of contact-level metrics to retrieve.
(dict) –
The object that contains information about metric being requested.
Name (string) – [REQUIRED]
The name of the metric being retrieved in type String.
- Return type:
dict
- Returns:
Response Syntax
{ 'MetricResults': [ { 'Name': 'POSITION_IN_QUEUE', 'Value': { 'Number': 123.0 } }, ], 'Id': 'string', 'Arn': 'string' }
Response Structure
(dict) –
MetricResults (list) –
A list of metric results containing the calculated values for each requested metric. Each result includes the metric name and its corresponding calculated value.
(dict) –
Object containing information about metric requested for the contact.
Name (string) –
The name of the metric being retrieved in type String.
Value (dict) –
Object result associated with the metric received.
Note
This is a Tagged Union structure. Only one of the following top level keys will be set:
Number
. If a client receives an unknown member it will setSDK_UNKNOWN_MEMBER
as the top level key, which maps to the name or tag of the unknown member. The structure ofSDK_UNKNOWN_MEMBER
is as follows:'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'}
Number (float) –
The number of type Double. This number is the contact’s position in queue.
Id (string) –
The unique identifier of the contact for which metrics were retrieved.
Arn (string) –
The ARN of the contact for which metrics were retrieved.
Exceptions