Skip to content

/AWS1/IF_CNT=>CREATECONTACT()

About CreateContact

Only the VOICE, EMAIL, and TASK channels are supported.

  • For VOICE: The supported initiation method is TRANSFER. The contacts created with this initiation method have a subtype connect:ExternalAudio.

  • For EMAIL: The supported initiation methods are OUTBOUND, AGENT_REPLY, and FLOW.

  • For TASK: The supported initiation method is API. Contacts created with this API have a sub-type of connect:ExternalTask.

Creates a new VOICE, EMAIL, or TASK contact.

After a contact is created, you can move it to the desired state by using the InitiateAs parameter. While you can use API to create task contacts that are in the COMPLETED state, you must contact Amazon Web Services Support before using it for bulk import use cases. Bulk import causes your requests to be throttled or fail if your CreateContact limits aren't high enough.

Method Signature

METHODS /AWS1/IF_CNT~CREATECONTACT
  IMPORTING
    !IV_INSTANCEID TYPE /AWS1/CNTINSTANCEID OPTIONAL
    !IV_CLIENTTOKEN TYPE /AWS1/CNTCLIENTTOKEN OPTIONAL
    !IV_RELATEDCONTACTID TYPE /AWS1/CNTCONTACTID OPTIONAL
    !IT_ATTRIBUTES TYPE /AWS1/CL_CNTATTRIBUTES_W=>TT_ATTRIBUTES OPTIONAL
    !IT_REFERENCES TYPE /AWS1/CL_CNTREFERENCE=>TT_CONTACTREFERENCES OPTIONAL
    !IV_CHANNEL TYPE /AWS1/CNTCHANNEL OPTIONAL
    !IV_INITIATIONMETHOD TYPE /AWS1/CNTCONTACTINITIATIONMETH OPTIONAL
    !IV_EXPIRYDURATIONINMINUTES TYPE /AWS1/CNTEXPIRYDURINMINUTES OPTIONAL
    !IO_USERINFO TYPE REF TO /AWS1/CL_CNTUSERINFO OPTIONAL
    !IV_INITIATEAS TYPE /AWS1/CNTINITIATEAS OPTIONAL
    !IV_NAME TYPE /AWS1/CNTNAME OPTIONAL
    !IV_DESCRIPTION TYPE /AWS1/CNTDESCRIPTION OPTIONAL
    !IT_SEGMENTATTRIBUTES TYPE /AWS1/CL_CNTSEGMENTATTRVALUE=>TT_SEGMENTATTRIBUTES OPTIONAL
    !IV_PREVIOUSCONTACTID TYPE /AWS1/CNTCONTACTID OPTIONAL
  RETURNING
    VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_cntcreatecontactrsp
  RAISING
    /AWS1/CX_CNTACCESSDENIEDEX
    /AWS1/CX_CNTCONFLICTEXCEPTION
    /AWS1/CX_CNTIDEMPOTENCYEX
    /AWS1/CX_CNTINTERNALSERVICEEX
    /AWS1/CX_CNTINVALIDPARAMETEREX
    /AWS1/CX_CNTINVALIDREQUESTEX
    /AWS1/CX_CNTRESOURCENOTFOUNDEX
    /AWS1/CX_CNTSERVICEQUOTAEXCDEX
    /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 Amazon Connect instance. You can find the instance ID in the Amazon Resource Name (ARN) of the instance.

iv_channel TYPE /AWS1/CNTCHANNEL /AWS1/CNTCHANNEL

The channel for the contact.

The CHAT channel is not supported. The following information is incorrect. We're working to correct it.

iv_initiationmethod TYPE /AWS1/CNTCONTACTINITIATIONMETH /AWS1/CNTCONTACTINITIATIONMETH

Indicates how the contact was initiated.

CreateContact only supports the following initiation methods. Valid values by channel are:

  • For VOICE: TRANSFER and the subtype connect:ExternalAudio

  • For EMAIL: OUTBOUND | AGENT_REPLY | FLOW

  • For TASK: API

The other channels listed below are incorrect. We're working to correct this information.

Optional arguments:

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.

iv_relatedcontactid TYPE /AWS1/CNTCONTACTID /AWS1/CNTCONTACTID

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

it_attributes TYPE /AWS1/CL_CNTATTRIBUTES_W=>TT_ATTRIBUTES TT_ATTRIBUTES

A custom key-value pair using an attribute map. The attributes are standard Amazon Connect attributes, and can be accessed in flows just like any other contact attributes.

There can be up to 32,768 UTF-8 bytes across all key-value pairs per contact. Attribute keys can include only alphanumeric, dash, and underscore characters.

it_references TYPE /AWS1/CL_CNTREFERENCE=>TT_CONTACTREFERENCES TT_CONTACTREFERENCES

A formatted URL that is shown to an agent in the Contact Control Panel (CCP). Tasks can have the following reference types at the time of creation: URL | NUMBER | STRING | DATE | EMAIL | ATTACHMENT.

iv_expirydurationinminutes TYPE /AWS1/CNTEXPIRYDURINMINUTES /AWS1/CNTEXPIRYDURINMINUTES

Number of minutes the contact will be active for before expiring

io_userinfo TYPE REF TO /AWS1/CL_CNTUSERINFO /AWS1/CL_CNTUSERINFO

User details for the contact

UserInfo is required when creating an EMAIL contact with OUTBOUND and AGENT_REPLY contact initiation methods.

iv_initiateas TYPE /AWS1/CNTINITIATEAS /AWS1/CNTINITIATEAS

Initial state of the contact when it's created. Only TASK channel contacts can be initiated with COMPLETED state.

iv_name TYPE /AWS1/CNTNAME /AWS1/CNTNAME

The name of a the contact.

iv_description TYPE /AWS1/CNTDESCRIPTION /AWS1/CNTDESCRIPTION

A description of the contact.

it_segmentattributes TYPE /AWS1/CL_CNTSEGMENTATTRVALUE=>TT_SEGMENTATTRIBUTES TT_SEGMENTATTRIBUTES

A set of system defined key-value pairs stored on individual contact segments (unique contact ID) using an attribute map. The attributes are standard Amazon Connect attributes. They can be accessed in flows.

Attribute keys can include only alphanumeric, -, and _.

This field can be used to set Segment Contact Expiry as a duration in minutes.

To set contact expiry, a ValueMap must be specified containing the integer number of minutes the contact will be active for before expiring, with SegmentAttributes like { "connect:ContactExpiry": {"ValueMap" : { "ExpiryDuration": { "ValueInteger": 135}}}}.

iv_previouscontactid TYPE /AWS1/CNTCONTACTID /AWS1/CNTCONTACTID

The ID of the previous contact when creating a transfer contact. This value can be provided only for external audio contacts. For more information, see Integrate Amazon Connect Contact Lens with external voice systems in the Amazon Connect Administrator Guide.

RETURNING

oo_output TYPE REF TO /aws1/cl_cntcreatecontactrsp /AWS1/CL_CNTCREATECONTACTRSP

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->createcontact(
  io_userinfo = new /aws1/cl_cntuserinfo( |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| )
      )
    )
  )
  it_references = VALUE /aws1/cl_cntreference=>tt_contactreferences(
    (
      VALUE /aws1/cl_cntreference=>ts_contactreferences_maprow(
        key = |string|
        value = new /aws1/cl_cntreference(
          iv_arn = |string|
          iv_status = |string|
          iv_statusreason = |string|
          iv_type = |string|
          iv_value = |string|
        )
      )
    )
  )
  it_segmentattributes = VALUE /aws1/cl_cntsegmentattrvalue=>tt_segmentattributes(
    (
      VALUE /aws1/cl_cntsegmentattrvalue=>ts_segmentattributes_maprow(
        value = new /aws1/cl_cntsegmentattrvalue(
          it_valuelist = VALUE /aws1/cl_cntsegmentattrvalue=>tt_segmentattributevaluelist(
            (
              new /aws1/cl_cntsegmentattrvalue(
                it_valuemap = VALUE /aws1/cl_cntsegmentattrvalue=>tt_segmentattributevaluemap(
                  (
                    VALUE /aws1/cl_cntsegmentattrvalue=>ts_segmentattrvaluemap_maprow(
                      key = |string|
                      value = new /aws1/cl_cntsegmentattrvalue(
                        iv_valuearn = |string|
                        iv_valueinteger = 123
                        iv_valuestring = |string|
                      )
                    )
                  )
                )
                iv_valuearn = |string|
                iv_valueinteger = 123
                iv_valuestring = |string|
              )
            )
          )
          it_valuemap = VALUE /aws1/cl_cntsegmentattrvalue=>tt_segmentattributevaluemap(
            (
              VALUE /aws1/cl_cntsegmentattrvalue=>ts_segmentattrvaluemap_maprow(
                key = |string|
                value = new /aws1/cl_cntsegmentattrvalue(
                  it_valuelist = VALUE /aws1/cl_cntsegmentattrvalue=>tt_segmentattributevaluelist(
                    (
                      new /aws1/cl_cntsegmentattrvalue(
                        iv_valuearn = |string|
                        iv_valueinteger = 123
                        iv_valuestring = |string|
                      )
                    )
                  )
                  iv_valuearn = |string|
                  iv_valueinteger = 123
                  iv_valuestring = |string|
                )
              )
            )
          )
          iv_valuearn = |string|
          iv_valueinteger = 123
          iv_valuestring = |string|
        )
        key = |string|
      )
    )
  )
  iv_channel = |string|
  iv_clienttoken = |string|
  iv_description = |string|
  iv_expirydurationinminutes = 123
  iv_initiateas = |string|
  iv_initiationmethod = |string|
  iv_instanceid = |string|
  iv_name = |string|
  iv_previouscontactid = |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_arn = lo_result->get_contactarn( ).
ENDIF.