Skip to content

/AWS1/IF_CNT=>STARTASSISTANTCONTACT()

About StartAssistantContact

Starts a chat contact with an AI agent.

Use the returned ParticipantToken with the CreateParticipantConnection operation.

For more information about chat, see the following topics in the Connect Customer Administrator Guide:

Method Signature

METHODS /AWS1/IF_CNT~STARTASSISTANTCONTACT
  IMPORTING
    !IV_INSTANCEID TYPE /AWS1/CNTINSTANCEID OPTIONAL
    !IO_AIAGENT TYPE REF TO /AWS1/CL_CNTAIAGENTINPUT OPTIONAL
    !IO_PARTICIPANTDETAILS TYPE REF TO /AWS1/CL_CNTPARTICIPANTDETAILS OPTIONAL
    !IO_INITIALMESSAGE TYPE REF TO /AWS1/CL_CNTCHATMESSAGE OPTIONAL
    !IT_ATTRIBUTES TYPE /AWS1/CL_CNTATTRIBUTES_W=>TT_ATTRIBUTES OPTIONAL
    !IV_CLIENTTOKEN TYPE /AWS1/CNTCLIENTTOKEN OPTIONAL
    !IO_PERSISTENTCHAT TYPE REF TO /AWS1/CL_CNTPERSISTENTCHAT OPTIONAL
    !IV_RELATEDCONTACTID TYPE /AWS1/CNTCONTACTID OPTIONAL
  RETURNING
    VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_cntstrtassstntcontrsp
  RAISING
    /AWS1/CX_CNTACCESSDENIEDEX
    /AWS1/CX_CNTINTERNALSERVICEEX
    /AWS1/CX_CNTINVALIDPARAMETEREX
    /AWS1/CX_CNTINVALIDREQUESTEX
    /AWS1/CX_CNTLIMITEXCEEDEDEX
    /AWS1/CX_CNTRESOURCENOTFOUNDEX
    /AWS1/CX_CNTTHROTTLINGEX
    /AWS1/CX_CNTCLIENTEXC
    /AWS1/CX_CNTSERVEREXC
    /AWS1/CX_RT_TECHNICAL_GENERIC
    /AWS1/CX_RT_SERVICE_GENERIC.

IMPORTING

Required arguments:

iv_instanceid TYPE /AWS1/CNTINSTANCEID /AWS1/CNTINSTANCEID

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

io_aiagent TYPE REF TO /AWS1/CL_CNTAIAGENTINPUT /AWS1/CL_CNTAIAGENTINPUT

The AI agent configuration for this contact.

io_participantdetails TYPE REF TO /AWS1/CL_CNTPARTICIPANTDETAILS /AWS1/CL_CNTPARTICIPANTDETAILS

The display name and other details that identify the chat participant.

Optional arguments:

io_initialmessage TYPE REF TO /AWS1/CL_CNTCHATMESSAGE /AWS1/CL_CNTCHATMESSAGE

The initial message to send to the newly created chat.

it_attributes TYPE /AWS1/CL_CNTATTRIBUTES_W=>TT_ATTRIBUTES TT_ATTRIBUTES

A map of key-value pairs to associate with the contact. We make these attributes available to flows as standard contact attributes.

You can provide up to 32,768 UTF-8 bytes across all key-value pairs for each contact.

iv_clienttoken TYPE /AWS1/CNTCLIENTTOKEN /AWS1/CNTCLIENTTOKEN

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.

io_persistentchat TYPE REF TO /AWS1/CL_CNTPERSISTENTCHAT /AWS1/CL_CNTPERSISTENTCHAT

The configuration that enables persistent chat. For more information about persistent chat and its use cases, see Enable persistent chat.

iv_relatedcontactid TYPE /AWS1/CNTCONTACTID /AWS1/CNTCONTACTID

The identifier of an Connect Customer contact related to the new assistant contact.

You cannot provide both RelatedContactId and PersistentChat.

RETURNING

oo_output TYPE REF TO /aws1/cl_cntstrtassstntcontrsp /AWS1/CL_CNTSTRTASSSTNTCONTRSP

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->startassistantcontact(
  io_aiagent = new /aws1/cl_cntaiagentinput( |string| )
  io_initialmessage = new /aws1/cl_cntchatmessage(
    iv_content = |string|
    iv_contenttype = |string|
  )
  io_participantdetails = new /aws1/cl_cntparticipantdetails( |string| )
  io_persistentchat = new /aws1/cl_cntpersistentchat(
    iv_rehydrationtype = |string|
    iv_sourcecontactid = |string|
  )
  it_attributes = VALUE /aws1/cl_cntattributes_w=>tt_attributes(
    (
      VALUE /aws1/cl_cntattributes_w=>ts_attributes_maprow(
        key = |string|
        value = new /aws1/cl_cntattributes_w( |string| )
      )
    )
  )
  iv_clienttoken = |string|
  iv_instanceid = |string|
  iv_relatedcontactid = |string|
).

This is an example of reading all possible response values

lo_result = lo_result.
IF lo_result IS NOT INITIAL.
  lv_contactid = lo_result->get_contactid( ).
  lv_participantid = lo_result->get_participantid( ).
  lv_participanttoken = lo_result->get_participanttoken( ).
  lv_contactid = lo_result->get_continuedfromcontactid( ).
ENDIF.