Skip to content

/AWS1/IF_CNT=>GETCONTACTMETRICS()

About GetContactMetrics

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.

Method Signature

IMPORTING

Required arguments:

iv_instanceid TYPE /AWS1/CNTINSTANCEIDORARN /AWS1/CNTINSTANCEIDORARN

The identifier of the Amazon Connect instance. You can find the instance ID in the Amazon Resource Name (ARN) of the instance.

iv_contactid TYPE /AWS1/CNTINSTANCEIDORARN /AWS1/CNTINSTANCEIDORARN

The identifier of the contact in this instance of Amazon Connect.

it_metrics TYPE /AWS1/CL_CNTCONTACTMETRICINFO=>TT_CONTACTMETRICS TT_CONTACTMETRICS

A list of contact-level metrics to retrieve.

RETURNING

oo_output TYPE REF TO /aws1/cl_cntgetcontactmetrsp /AWS1/CL_CNTGETCONTACTMETRSP

Domain /AWS1/RT_ACCOUNT_ID
Primitive Type NUMC

Examples

Syntax Example

This is an example of the syntax for calling the method. It includes every possible argument and initializes every possible value. The data provided is not necessarily semantically accurate (for example the value "string" may be provided for something that is intended to be an instance ID, or in some cases two arguments may be mutually exclusive). The syntax shows the ABAP syntax for creating the various data structures.

DATA(lo_result) = lo_client->/aws1/if_cnt~getcontactmetrics(
  it_metrics = VALUE /aws1/cl_cntcontactmetricinfo=>tt_contactmetrics(
    ( new /aws1/cl_cntcontactmetricinfo( |string| ) )
  )
  iv_contactid = |string|
  iv_instanceid = |string|
).

This is an example of reading all possible response values

lo_result = lo_result.
IF lo_result IS NOT INITIAL.
  LOOP AT lo_result->get_metricresults( ) into lo_row.
    lo_row_1 = lo_row.
    IF lo_row_1 IS NOT INITIAL.
      lv_contactmetricname = lo_row_1->get_name( ).
      lo_contactmetricvalue = lo_row_1->get_value( ).
      IF lo_contactmetricvalue IS NOT INITIAL.
        lv_double = lo_contactmetricvalue->get_number( ).
      ENDIF.
    ENDIF.
  ENDLOOP.
  lv_contactid = lo_result->get_id( ).
  lv_arn = lo_result->get_arn( ).
ENDIF.