Skip to content

/AWS1/IF_CN2=>CREATECAMPAIGN()

About CreateCampaign

Creates a campaign for the specified Amazon Connect account. This API is idempotent.

Method Signature

METHODS /AWS1/IF_CN2~CREATECAMPAIGN
  IMPORTING
    !IV_NAME TYPE /AWS1/CN2CAMPAIGNNAME OPTIONAL
    !IV_CONNECTINSTANCEID TYPE /AWS1/CN2INSTANCEID OPTIONAL
    !IO_CHANNELSUBTYPECONFIG TYPE REF TO /AWS1/CL_CN2CHANNELSUBTYPECFG OPTIONAL
    !IO_SOURCE TYPE REF TO /AWS1/CL_CN2SOURCE OPTIONAL
    !IV_CONNECTCAMPAIGNFLOWARN TYPE /AWS1/CN2ARN OPTIONAL
    !IO_SCHEDULE TYPE REF TO /AWS1/CL_CN2SCHEDULE OPTIONAL
    !IO_COMMUNICATIONTIMECONFIG TYPE REF TO /AWS1/CL_CN2COMMUNICATIONTIM00 OPTIONAL
    !IO_COMMUNICATIONLMTSOVERRIDE TYPE REF TO /AWS1/CL_CN2COMMUNICATIONLMT00 OPTIONAL
    !IT_TAGS TYPE /AWS1/CL_CN2TAGMAP_W=>TT_TAGMAP OPTIONAL
  RETURNING
    VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_cn2createcampaignrsp
  RAISING
    /AWS1/CX_CN2ACCESSDENIEDEX
    /AWS1/CX_CN2CONFLICTEXCEPTION
    /AWS1/CX_CN2INTERNALSERVEREX
    /AWS1/CX_CN2RESOURCENOTFOUNDEX
    /AWS1/CX_CN2SERVICEQUOTAEXCDEX
    /AWS1/CX_CN2THROTTLINGEX
    /AWS1/CX_CN2VALIDATIONEX
    /AWS1/CX_CN2CLIENTEXC
    /AWS1/CX_CN2SERVEREXC
    /AWS1/CX_RT_TECHNICAL_GENERIC
    /AWS1/CX_RT_SERVICE_GENERIC.

IMPORTING

Required arguments:

iv_name TYPE /AWS1/CN2CAMPAIGNNAME /AWS1/CN2CAMPAIGNNAME

name

iv_connectinstanceid TYPE /AWS1/CN2INSTANCEID /AWS1/CN2INSTANCEID

connectInstanceId

io_channelsubtypeconfig TYPE REF TO /AWS1/CL_CN2CHANNELSUBTYPECFG /AWS1/CL_CN2CHANNELSUBTYPECFG

channelSubtypeConfig

Optional arguments:

io_source TYPE REF TO /AWS1/CL_CN2SOURCE /AWS1/CL_CN2SOURCE

source

iv_connectcampaignflowarn TYPE /AWS1/CN2ARN /AWS1/CN2ARN

connectCampaignFlowArn

io_schedule TYPE REF TO /AWS1/CL_CN2SCHEDULE /AWS1/CL_CN2SCHEDULE

schedule

io_communicationtimeconfig TYPE REF TO /AWS1/CL_CN2COMMUNICATIONTIM00 /AWS1/CL_CN2COMMUNICATIONTIM00

communicationTimeConfig

io_communicationlmtsoverride TYPE REF TO /AWS1/CL_CN2COMMUNICATIONLMT00 /AWS1/CL_CN2COMMUNICATIONLMT00

communicationLimitsOverride

it_tags TYPE /AWS1/CL_CN2TAGMAP_W=>TT_TAGMAP TT_TAGMAP

tags

RETURNING

oo_output TYPE REF TO /aws1/cl_cn2createcampaignrsp /AWS1/CL_CN2CREATECAMPAIGNRSP

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->createcampaign(
  io_channelsubtypeconfig = new /aws1/cl_cn2channelsubtypecfg(
    io_email = new /aws1/cl_cn2emailchannelsubt00(
      io_defaultoutboundconfig = new /aws1/cl_cn2emailoutboundcfg(
        iv_connectsourceemailaddress = |string|
        iv_sourceemailaddressdspname = |string|
        iv_wisdomtemplatearn = |string|
      )
      io_outboundmode = new /aws1/cl_cn2emailoutboundmode( new /aws1/cl_cn2agentlessconfig( ) )
      iv_capacity = '0.1'
    )
    io_sms = new /aws1/cl_cn2smschannelsubtyp00(
      io_defaultoutboundconfig = new /aws1/cl_cn2smsoutboundconfig(
        iv_cnctsourcephonenumberarn = |string|
        iv_wisdomtemplatearn = |string|
      )
      io_outboundmode = new /aws1/cl_cn2smsoutboundmode( new /aws1/cl_cn2agentlessconfig( ) )
      iv_capacity = '0.1'
    )
    io_telephony = new /aws1/cl_cn2telephonychannel00(
      io_defaultoutboundconfig = new /aws1/cl_cn2telephonyoutboun01(
        io_answermachinedetectconfig = new /aws1/cl_cn2answermachinedet00(
          iv_awaitanswermachineprompt = ABAP_TRUE
          iv_enableanswermachinedetect = ABAP_TRUE
        )
        iv_connectcontactflowid = |string|
        iv_connectsourcephonenumber = |string|
      )
      io_outboundmode = new /aws1/cl_cn2telephonyoutboun00(
        io_agentless = new /aws1/cl_cn2agentlessconfig( )
        io_predictive = new /aws1/cl_cn2predictiveconfig( '0.1' )
        io_preview = new /aws1/cl_cn2previewconfig(
          io_timeoutconfig = new /aws1/cl_cn2timeoutconfig( 123 )
          it_agentactions = VALUE /aws1/cl_cn2agentactions_w=>tt_agentactions(
            ( new /aws1/cl_cn2agentactions_w( |string| ) )
          )
          iv_bandwidthallocation = '0.1'
        )
        io_progressive = new /aws1/cl_cn2progressiveconfig( '0.1' )
      )
      iv_capacity = '0.1'
      iv_connectqueueid = |string|
    )
  )
  io_communicationlmtsoverride = new /aws1/cl_cn2communicationlmt00(
    io_allchannelsubtypes = new /aws1/cl_cn2communicationlmts(
      it_communicationlimitslist = VALUE /aws1/cl_cn2communicationlimit=>tt_communicationlimitlist(
        (
          new /aws1/cl_cn2communicationlimit(
            iv_frequency = 123
            iv_maxcountperrecipient = 123
            iv_unit = |string|
          )
        )
      )
    )
    iv_instancelimitshandling = |string|
  )
  io_communicationtimeconfig = new /aws1/cl_cn2communicationtim00(
    io_email = new /aws1/cl_cn2timewindow(
      io_openhours = new /aws1/cl_cn2openhours(
        it_dailyhours = VALUE /aws1/cl_cn2timerange=>tt_dailyhours(
          (
            VALUE /aws1/cl_cn2timerange=>ts_dailyhours_maprow(
              key = |string|
              value = VALUE /aws1/cl_cn2timerange=>tt_timerangelist(
                (
                  new /aws1/cl_cn2timerange(
                    iv_endtime = |string|
                    iv_starttime = |string|
                  )
                )
              )
            )
          )
        )
      )
      io_restrictedperiods = new /aws1/cl_cn2restrictedperiods(
        it_restrictedperiodlist = VALUE /aws1/cl_cn2restrictedperiod=>tt_restrictedperiodlist(
          (
            new /aws1/cl_cn2restrictedperiod(
              iv_enddate = |string|
              iv_name = |string|
              iv_startdate = |string|
            )
          )
        )
      )
    )
    io_localtimezoneconfig = new /aws1/cl_cn2localtimezonecfg(
      it_localtimezonedetection = VALUE /aws1/cl_cn2localtimezonedet_w=>tt_localtimezonedetection(
        ( new /aws1/cl_cn2localtimezonedet_w( |string| ) )
      )
      iv_defaulttimezone = |string|
    )
    io_sms = new /aws1/cl_cn2timewindow(
      io_openhours = new /aws1/cl_cn2openhours(
        it_dailyhours = VALUE /aws1/cl_cn2timerange=>tt_dailyhours(
          (
            VALUE /aws1/cl_cn2timerange=>ts_dailyhours_maprow(
              key = |string|
              value = VALUE /aws1/cl_cn2timerange=>tt_timerangelist(
                (
                  new /aws1/cl_cn2timerange(
                    iv_endtime = |string|
                    iv_starttime = |string|
                  )
                )
              )
            )
          )
        )
      )
      io_restrictedperiods = new /aws1/cl_cn2restrictedperiods(
        it_restrictedperiodlist = VALUE /aws1/cl_cn2restrictedperiod=>tt_restrictedperiodlist(
          (
            new /aws1/cl_cn2restrictedperiod(
              iv_enddate = |string|
              iv_name = |string|
              iv_startdate = |string|
            )
          )
        )
      )
    )
    io_telephony = new /aws1/cl_cn2timewindow(
      io_openhours = new /aws1/cl_cn2openhours(
        it_dailyhours = VALUE /aws1/cl_cn2timerange=>tt_dailyhours(
          (
            VALUE /aws1/cl_cn2timerange=>ts_dailyhours_maprow(
              key = |string|
              value = VALUE /aws1/cl_cn2timerange=>tt_timerangelist(
                (
                  new /aws1/cl_cn2timerange(
                    iv_endtime = |string|
                    iv_starttime = |string|
                  )
                )
              )
            )
          )
        )
      )
      io_restrictedperiods = new /aws1/cl_cn2restrictedperiods(
        it_restrictedperiodlist = VALUE /aws1/cl_cn2restrictedperiod=>tt_restrictedperiodlist(
          (
            new /aws1/cl_cn2restrictedperiod(
              iv_enddate = |string|
              iv_name = |string|
              iv_startdate = |string|
            )
          )
        )
      )
    )
  )
  io_schedule = new /aws1/cl_cn2schedule(
    iv_endtime = '20150101000000.0000000'
    iv_refreshfrequency = |string|
    iv_starttime = '20150101000000.0000000'
  )
  io_source = new /aws1/cl_cn2source(
    io_eventtrigger = new /aws1/cl_cn2eventtrigger( |string| )
    iv_cusprofilessegmentarn = |string|
  )
  it_tags = VALUE /aws1/cl_cn2tagmap_w=>tt_tagmap(
    (
      VALUE /aws1/cl_cn2tagmap_w=>ts_tagmap_maprow(
        value = new /aws1/cl_cn2tagmap_w( |string| )
        key = |string|
      )
    )
  )
  iv_connectcampaignflowarn = |string|
  iv_connectinstanceid = |string|
  iv_name = |string|
).

This is an example of reading all possible response values

lo_result = lo_result.
IF lo_result IS NOT INITIAL.
  lv_campaignid = lo_result->get_id( ).
  lv_campaignarn = lo_result->get_arn( ).
  LOOP AT lo_result->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.
ENDIF.