Connect / Client / get_contact_metrics
get_contact_metrics¶
- Connect.Client.get_contact_metrics(**kwargs)¶
Gets the real-time metrics of the specified contact.
Use cases
Following are common uses cases for this API:
You can use this API to retrieve the position of the contact in the queue.
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