Skip to content

/AWS1/IF_QQC=>CREATESESSION()

About CreateSession

Creates a session. A session is a contextual container used for generating recommendations. Amazon Connect creates a new Amazon Q in Connect session for each contact on which Amazon Q in Connect is enabled.

Method Signature

METHODS /AWS1/IF_QQC~CREATESESSION
  IMPORTING
    !IV_CLIENTTOKEN TYPE /AWS1/QQCCLIENTTOKEN OPTIONAL
    !IV_ASSISTANTID TYPE /AWS1/QQCUUIDORARN OPTIONAL
    !IV_NAME TYPE /AWS1/QQCNAME OPTIONAL
    !IV_DESCRIPTION TYPE /AWS1/QQCDESCRIPTION OPTIONAL
    !IT_TAGS TYPE /AWS1/CL_QQCTAGS_W=>TT_TAGS OPTIONAL
    !IO_TAGFILTER TYPE REF TO /AWS1/CL_QQCTAGFILTER OPTIONAL
    !IT_AIAGENTCONFIGURATION TYPE /AWS1/CL_QQCAIAGENTCONFDATA=>TT_AIAGENTCONFIGURATIONMAP OPTIONAL
    !IV_CONTACTARN TYPE /AWS1/QQCGENERICARN OPTIONAL
  RETURNING
    VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_qqccreatesessionrsp
  RAISING
    /AWS1/CX_QQCACCESSDENIEDEX
    /AWS1/CX_QQCCONFLICTEXCEPTION
    /AWS1/CX_QQCDEPENDENCYFAILEDEX
    /AWS1/CX_QQCRESOURCENOTFOUNDEX
    /AWS1/CX_QQCUNAUTHORIZEDEX
    /AWS1/CX_QQCVALIDATIONEX
    /AWS1/CX_QQCCLIENTEXC
    /AWS1/CX_QQCSERVEREXC
    /AWS1/CX_RT_TECHNICAL_GENERIC
    /AWS1/CX_RT_SERVICE_GENERIC.

IMPORTING

Required arguments:

iv_assistantid TYPE /AWS1/QQCUUIDORARN /AWS1/QQCUUIDORARN

The identifier of the Amazon Q in Connect assistant. Can be either the ID or the ARN. URLs cannot contain the ARN.

iv_name TYPE /AWS1/QQCNAME /AWS1/QQCNAME

The name of the session.

Optional arguments:

iv_clienttoken TYPE /AWS1/QQCCLIENTTOKEN /AWS1/QQCCLIENTTOKEN

A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the Amazon Web Services SDK populates this field. For more information about idempotency, see Making retries safe with idempotent APIs.

iv_description TYPE /AWS1/QQCDESCRIPTION /AWS1/QQCDESCRIPTION

The description.

it_tags TYPE /AWS1/CL_QQCTAGS_W=>TT_TAGS TT_TAGS

The tags used to organize, track, or control access for this resource.

io_tagfilter TYPE REF TO /AWS1/CL_QQCTAGFILTER /AWS1/CL_QQCTAGFILTER

An object that can be used to specify Tag conditions.

it_aiagentconfiguration TYPE /AWS1/CL_QQCAIAGENTCONFDATA=>TT_AIAGENTCONFIGURATIONMAP TT_AIAGENTCONFIGURATIONMAP

The configuration of the AI Agents (mapped by AI Agent Type to AI Agent version) that should be used by Amazon Q in Connect for this Session.

iv_contactarn TYPE /AWS1/QQCGENERICARN /AWS1/QQCGENERICARN

The Amazon Resource Name (ARN) of the email contact in Amazon Connect. Used to retrieve email content and establish session context for AI-powered email assistance.

RETURNING

oo_output TYPE REF TO /aws1/cl_qqccreatesessionrsp /AWS1/CL_QQCCREATESESSIONRSP

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->createsession(
  io_tagfilter = new /aws1/cl_qqctagfilter(
    io_tagcondition = new /aws1/cl_qqctagcondition(
      iv_key = |string|
      iv_value = |string|
    )
    it_andconditions = VALUE /aws1/cl_qqctagcondition=>tt_andconditions(
      (
        new /aws1/cl_qqctagcondition(
          iv_key = |string|
          iv_value = |string|
        )
      )
    )
    it_orconditions = VALUE /aws1/cl_qqcorcondition=>tt_orconditions(
      (
        new /aws1/cl_qqcorcondition(
          io_tagcondition = new /aws1/cl_qqctagcondition(
            iv_key = |string|
            iv_value = |string|
          )
          it_andconditions = VALUE /aws1/cl_qqctagcondition=>tt_andconditions(
            (
              new /aws1/cl_qqctagcondition(
                iv_key = |string|
                iv_value = |string|
              )
            )
          )
        )
      )
    )
  )
  it_aiagentconfiguration = VALUE /aws1/cl_qqcaiagentconfdata=>tt_aiagentconfigurationmap(
    (
      VALUE /aws1/cl_qqcaiagentconfdata=>ts_aiagentconfmap_maprow(
        key = |string|
        value = new /aws1/cl_qqcaiagentconfdata( |string| )
      )
    )
  )
  it_tags = VALUE /aws1/cl_qqctags_w=>tt_tags(
    (
      VALUE /aws1/cl_qqctags_w=>ts_tags_maprow(
        key = |string|
        value = new /aws1/cl_qqctags_w( |string| )
      )
    )
  )
  iv_assistantid = |string|
  iv_clienttoken = |string|
  iv_contactarn = |string|
  iv_description = |string|
  iv_name = |string|
).

This is an example of reading all possible response values

lo_result = lo_result.
IF lo_result IS NOT INITIAL.
  lo_sessiondata = lo_result->get_session( ).
  IF lo_sessiondata IS NOT INITIAL.
    lv_arn = lo_sessiondata->get_sessionarn( ).
    lv_uuid = lo_sessiondata->get_sessionid( ).
    lv_name = lo_sessiondata->get_name( ).
    lv_description = lo_sessiondata->get_description( ).
    LOOP AT lo_sessiondata->get_tags( ) into ls_row.
      lv_key = ls_row-key.
      lo_value = ls_row-value.
      IF lo_value IS NOT INITIAL.
        lv_tagvalue = lo_value->get_value( ).
      ENDIF.
    ENDLOOP.
    lo_sessionintegrationconfi = lo_sessiondata->get_integrationconfiguration( ).
    IF lo_sessionintegrationconfi IS NOT INITIAL.
      lv_genericarn = lo_sessionintegrationconfi->get_topicintegrationarn( ).
    ENDIF.
    lo_tagfilter = lo_sessiondata->get_tagfilter( ).
    IF lo_tagfilter IS NOT INITIAL.
      lo_tagcondition = lo_tagfilter->get_tagcondition( ).
      IF lo_tagcondition IS NOT INITIAL.
        lv_tagkey = lo_tagcondition->get_key( ).
        lv_tagvalue = lo_tagcondition->get_value( ).
      ENDIF.
      LOOP AT lo_tagfilter->get_andconditions( ) into lo_row_1.
        lo_row_2 = lo_row_1.
        IF lo_row_2 IS NOT INITIAL.
          lv_tagkey = lo_row_2->get_key( ).
          lv_tagvalue = lo_row_2->get_value( ).
        ENDIF.
      ENDLOOP.
      LOOP AT lo_tagfilter->get_orconditions( ) into lo_row_3.
        lo_row_4 = lo_row_3.
        IF lo_row_4 IS NOT INITIAL.
          LOOP AT lo_row_4->get_andconditions( ) into lo_row_1.
            lo_row_2 = lo_row_1.
            IF lo_row_2 IS NOT INITIAL.
              lv_tagkey = lo_row_2->get_key( ).
              lv_tagvalue = lo_row_2->get_value( ).
            ENDIF.
          ENDLOOP.
          lo_tagcondition = lo_row_4->get_tagcondition( ).
          IF lo_tagcondition IS NOT INITIAL.
            lv_tagkey = lo_tagcondition->get_key( ).
            lv_tagvalue = lo_tagcondition->get_value( ).
          ENDIF.
        ENDIF.
      ENDLOOP.
    ENDIF.
    LOOP AT lo_sessiondata->get_aiagentconfiguration( ) into ls_row_5.
      lv_key_1 = ls_row_5-key.
      lo_value_1 = ls_row_5-value.
      IF lo_value_1 IS NOT INITIAL.
        lv_uuidwithqualifier = lo_value_1->get_aiagentid( ).
      ENDIF.
    ENDLOOP.
    lv_origin = lo_sessiondata->get_origin( ).
  ENDIF.
ENDIF.