/AWS1/IF_PP2=>SENDRCSMESSAGE()¶
About SendRcsMessage¶
Creates a new RCS message and sends it to a recipient's phone number. RCS messages support rich content including text, files, rich cards, and carousels with interactive suggested actions.
Method Signature¶
METHODS /AWS1/IF_PP2~SENDRCSMESSAGE
IMPORTING
!IV_DESTINATIONPHONENUMBER TYPE /AWS1/PP2PHONENUMBER OPTIONAL
!IV_ORIGINATIONIDENTITY TYPE /AWS1/PP2RCSMSGORIGINATIONID OPTIONAL
!IO_RCSMESSAGECONTENT TYPE REF TO /AWS1/CL_PP2RCSMESSAGECONTENT OPTIONAL
!IV_TIMETOLIVE TYPE /AWS1/PP2RCSTIMETOLIVE OPTIONAL
!IV_MESSAGETRAFFICTYPE TYPE /AWS1/PP2RCSMESSAGETRAFFICTYPE OPTIONAL
!IO_FALLBACKCONFIGURATION TYPE REF TO /AWS1/CL_PP2RCSFALLBACKCONF OPTIONAL
!IV_PROTECTCONFIGURATIONID TYPE /AWS1/PP2PROTECTCONFIDORARN OPTIONAL
!IV_CONFIGURATIONSETNAME TYPE /AWS1/PP2CONFSETNAMEORARN OPTIONAL
!IV_MAXPRICE TYPE /AWS1/PP2MAXPRICE OPTIONAL
!IV_DRYRUN TYPE /AWS1/PP2PRIMITIVEBOOLEAN OPTIONAL
!IT_CONTEXT TYPE /AWS1/CL_PP2CONTEXTMAP_W=>TT_CONTEXTMAP OPTIONAL
!IV_MESSAGEFEEDBACKENABLED TYPE /AWS1/PP2BOOLEAN OPTIONAL
RETURNING
VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_pp2sendrcsmsgresult
RAISING
/AWS1/CX_PP2ACCESSDENIEDEX
/AWS1/CX_PP2CONFLICTEXCEPTION
/AWS1/CX_PP2INTERNALSERVEREX
/AWS1/CX_PP2RESOURCENOTFOUNDEX
/AWS1/CX_PP2SERVICEQUOTAEXCDEX
/AWS1/CX_PP2THROTTLINGEX
/AWS1/CX_PP2VALIDATIONEX
/AWS1/CX_PP2CLIENTEXC
/AWS1/CX_PP2SERVEREXC
/AWS1/CX_RT_TECHNICAL_GENERIC
/AWS1/CX_RT_SERVICE_GENERIC.
IMPORTING¶
Required arguments:¶
iv_destinationphonenumber TYPE /AWS1/PP2PHONENUMBER /AWS1/PP2PHONENUMBER¶
The destination phone number in E.164 format.
iv_originationidentity TYPE /AWS1/PP2RCSMSGORIGINATIONID /AWS1/PP2RCSMSGORIGINATIONID¶
The origination identity of the message. This can be either the RcsAgentId, RcsAgentArn, PoolId, or PoolArn.
Optional arguments:¶
io_rcsmessagecontent TYPE REF TO /AWS1/CL_PP2RCSMESSAGECONTENT /AWS1/CL_PP2RCSMESSAGECONTENT¶
The content of the RCS message. Contains the message content (text, file, rich card, or carousel) and optional message-level suggested actions.
iv_timetolive TYPE /AWS1/PP2RCSTIMETOLIVE /AWS1/PP2RCSTIMETOLIVE¶
The duration in seconds that the RCS message is valid for delivery. If the message cannot be delivered within this duration, it is considered expired. Valid values are 1 to 172800 (48 hours). If a FallbackConfiguration is provided, the fallback is triggered when the duration expires without delivery confirmation.
iv_messagetraffictype TYPE /AWS1/PP2RCSMESSAGETRAFFICTYPE /AWS1/PP2RCSMESSAGETRAFFICTYPE¶
The traffic type of the RCS message. Valid values are AUTHENTICATION, TRANSACTION, PROMOTION, SERVICE_REQUEST, and ACKNOWLEDGEMENT. This field is reserved for future use.
io_fallbackconfiguration TYPE REF TO /AWS1/CL_PP2RCSFALLBACKCONF /AWS1/CL_PP2RCSFALLBACKCONF¶
Configuration for SMS or MMS fallback when RCS delivery fails. If provided, the service sends a fallback message via the specified channel when the RCS message fails or the TimeToLive expires.
iv_protectconfigurationid TYPE /AWS1/PP2PROTECTCONFIDORARN /AWS1/PP2PROTECTCONFIDORARN¶
The unique identifier of the protect configuration to use.
iv_configurationsetname TYPE /AWS1/PP2CONFSETNAMEORARN /AWS1/PP2CONFSETNAMEORARN¶
The name of the configuration set to use. This can be either the ConfigurationSetName or ConfigurationSetArn.
iv_maxprice TYPE /AWS1/PP2MAXPRICE /AWS1/PP2MAXPRICE¶
The maximum amount that you want to spend, in US dollars, per each RCS message.
iv_dryrun TYPE /AWS1/PP2PRIMITIVEBOOLEAN /AWS1/PP2PRIMITIVEBOOLEAN¶
When set to true, the message is checked and validated, but isn't sent to the end recipient.
it_context TYPE /AWS1/CL_PP2CONTEXTMAP_W=>TT_CONTEXTMAP TT_CONTEXTMAP¶
You can specify custom data in this field. If you do, that data is logged to the event destination.
iv_messagefeedbackenabled TYPE /AWS1/PP2BOOLEAN /AWS1/PP2BOOLEAN¶
Set to true to enable message feedback for the message. When a user receives the message you need to update the message status using PutMessageFeedback.
RETURNING¶
oo_output TYPE REF TO /aws1/cl_pp2sendrcsmsgresult /AWS1/CL_PP2SENDRCSMSGRESULT¶
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->sendrcsmessage(
io_fallbackconfiguration = new /aws1/cl_pp2rcsfallbackconf(
it_mediaurls = VALUE /aws1/cl_pp2mediaurllist_w=>tt_mediaurllist(
( new /aws1/cl_pp2mediaurllist_w( |string| ) )
)
iv_channel = |string|
iv_messagebody = |string|
iv_originationidentity = |string|
)
io_rcsmessagecontent = new /aws1/cl_pp2rcsmessagecontent(
io_content = new /aws1/cl_pp2rcscontent(
io_carousel = new /aws1/cl_pp2rcscarousel(
it_cardcontents = VALUE /aws1/cl_pp2rcscarocardcontent=>tt_rcscarouselcardcontentlist(
(
new /aws1/cl_pp2rcscarocardcontent(
io_media = new /aws1/cl_pp2rcscarocardmedia(
iv_fileurl = |string|
iv_height = |string|
iv_thumbnailurl = |string|
)
it_suggestions = VALUE /aws1/cl_pp2rcssuggestedaction=>tt_rcscardsuggestedactionlist(
(
new /aws1/cl_pp2rcssuggestedaction(
io_createcalendarevent = new /aws1/cl_pp2rcscrecaleventact(
iv_description = |string|
iv_endtime = '20150101000000.0000000'
iv_postbackdata = |string|
iv_starttime = '20150101000000.0000000'
iv_text = |string|
iv_title = |string|
)
io_dialphone = new /aws1/cl_pp2rcsdialphoneaction(
iv_phonenumber = |string|
iv_postbackdata = |string|
iv_text = |string|
)
io_openurl = new /aws1/cl_pp2rcsopenurlaction(
iv_application = |string|
iv_postbackdata = |string|
iv_text = |string|
iv_url = |string|
iv_webviewviewmode = |string|
)
io_reply = new /aws1/cl_pp2rcsreplyaction(
iv_postbackdata = |string|
iv_text = |string|
)
io_requestlocation = new /aws1/cl_pp2rcsreqlocaction(
iv_postbackdata = |string|
iv_text = |string|
)
io_showlocation = new /aws1/cl_pp2rcsshowlocaction(
iv_label = |string|
iv_latitude = '0.1'
iv_longitude = '0.1'
iv_postbackdata = |string|
iv_text = |string|
)
)
)
)
iv_description = |string|
iv_title = |string|
)
)
)
iv_cardwidth = |string|
)
io_filemessage = new /aws1/cl_pp2rcsfilemessage(
iv_fileurl = |string|
iv_thumbnailurl = |string|
)
io_richcard = new /aws1/cl_pp2rcsstandalonecard(
io_cardcontent = new /aws1/cl_pp2rcscardcontent(
io_media = new /aws1/cl_pp2rcscardmedia(
iv_fileurl = |string|
iv_height = |string|
iv_thumbnailurl = |string|
)
it_suggestions = VALUE /aws1/cl_pp2rcssuggestedaction=>tt_rcscardsuggestedactionlist(
(
new /aws1/cl_pp2rcssuggestedaction(
io_createcalendarevent = new /aws1/cl_pp2rcscrecaleventact(
iv_description = |string|
iv_endtime = '20150101000000.0000000'
iv_postbackdata = |string|
iv_starttime = '20150101000000.0000000'
iv_text = |string|
iv_title = |string|
)
io_dialphone = new /aws1/cl_pp2rcsdialphoneaction(
iv_phonenumber = |string|
iv_postbackdata = |string|
iv_text = |string|
)
io_openurl = new /aws1/cl_pp2rcsopenurlaction(
iv_application = |string|
iv_postbackdata = |string|
iv_text = |string|
iv_url = |string|
iv_webviewviewmode = |string|
)
io_reply = new /aws1/cl_pp2rcsreplyaction(
iv_postbackdata = |string|
iv_text = |string|
)
io_requestlocation = new /aws1/cl_pp2rcsreqlocaction(
iv_postbackdata = |string|
iv_text = |string|
)
io_showlocation = new /aws1/cl_pp2rcsshowlocaction(
iv_label = |string|
iv_latitude = '0.1'
iv_longitude = '0.1'
iv_postbackdata = |string|
iv_text = |string|
)
)
)
)
iv_description = |string|
iv_title = |string|
)
iv_cardorientation = |string|
iv_thumbnailimagealignment = |string|
)
io_textmessage = new /aws1/cl_pp2rcstextmessage( |string| )
)
it_suggestions = VALUE /aws1/cl_pp2rcssuggestedaction=>tt_rcssuggestedactionlist(
(
new /aws1/cl_pp2rcssuggestedaction(
io_createcalendarevent = new /aws1/cl_pp2rcscrecaleventact(
iv_description = |string|
iv_endtime = '20150101000000.0000000'
iv_postbackdata = |string|
iv_starttime = '20150101000000.0000000'
iv_text = |string|
iv_title = |string|
)
io_dialphone = new /aws1/cl_pp2rcsdialphoneaction(
iv_phonenumber = |string|
iv_postbackdata = |string|
iv_text = |string|
)
io_openurl = new /aws1/cl_pp2rcsopenurlaction(
iv_application = |string|
iv_postbackdata = |string|
iv_text = |string|
iv_url = |string|
iv_webviewviewmode = |string|
)
io_reply = new /aws1/cl_pp2rcsreplyaction(
iv_postbackdata = |string|
iv_text = |string|
)
io_requestlocation = new /aws1/cl_pp2rcsreqlocaction(
iv_postbackdata = |string|
iv_text = |string|
)
io_showlocation = new /aws1/cl_pp2rcsshowlocaction(
iv_label = |string|
iv_latitude = '0.1'
iv_longitude = '0.1'
iv_postbackdata = |string|
iv_text = |string|
)
)
)
)
)
it_context = VALUE /aws1/cl_pp2contextmap_w=>tt_contextmap(
(
VALUE /aws1/cl_pp2contextmap_w=>ts_contextmap_maprow(
key = |string|
value = new /aws1/cl_pp2contextmap_w( |string| )
)
)
)
iv_configurationsetname = |string|
iv_destinationphonenumber = |string|
iv_dryrun = ABAP_TRUE
iv_maxprice = |string|
iv_messagefeedbackenabled = ABAP_TRUE
iv_messagetraffictype = |string|
iv_originationidentity = |string|
iv_protectconfigurationid = |string|
iv_timetolive = 123
).
This is an example of reading all possible response values
lo_result = lo_result.
IF lo_result IS NOT INITIAL.
lv_string = lo_result->get_messageid( ).
ENDIF.