/AWS1/IF_PP2=>SENDNOTIFYVOICEMESSAGE()¶
About SendNotifyVoiceMessage¶
Sends a templated voice message through a notify configuration to a recipient's phone number.
Method Signature¶
METHODS /AWS1/IF_PP2~SENDNOTIFYVOICEMESSAGE
IMPORTING
!IV_NOTIFYCONFIGURATIONID TYPE /AWS1/PP2NOTIFYCONFIDORARN OPTIONAL
!IV_DESTINATIONPHONENUMBER TYPE /AWS1/PP2PHONENUMBER OPTIONAL
!IV_TEMPLATEID TYPE /AWS1/PP2NOTIFYTEMPLATEID OPTIONAL
!IT_TEMPLATEVARIABLES TYPE /AWS1/CL_PP2TMPLVARSUBSTMAP_W=>TT_TEMPLATEVARIABLESUBSTNMAP OPTIONAL
!IV_VOICEID TYPE /AWS1/PP2VOICEID OPTIONAL
!IV_TIMETOLIVE TYPE /AWS1/PP2TIMETOLIVE OPTIONAL
!IT_CONTEXT TYPE /AWS1/CL_PP2CONTEXTMAP_W=>TT_CONTEXTMAP OPTIONAL
!IV_CONFIGURATIONSETNAME TYPE /AWS1/PP2CONFSETNAMEORARN OPTIONAL
!IV_DRYRUN TYPE /AWS1/PP2PRIMITIVEBOOLEAN OPTIONAL
!IV_MESSAGEFEEDBACKENABLED TYPE /AWS1/PP2BOOLEAN OPTIONAL
RETURNING
VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_pp2sendntfvoicemsgrs
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_notifyconfigurationid TYPE /AWS1/PP2NOTIFYCONFIDORARN /AWS1/PP2NOTIFYCONFIDORARN¶
The unique identifier of the notify configuration to use for sending the message. This can be either the NotifyConfigurationId or NotifyConfigurationArn.
iv_destinationphonenumber TYPE /AWS1/PP2PHONENUMBER /AWS1/PP2PHONENUMBER¶
The destination phone number in E.164 format.
it_templatevariables TYPE /AWS1/CL_PP2TMPLVARSUBSTMAP_W=>TT_TEMPLATEVARIABLESUBSTNMAP TT_TEMPLATEVARIABLESUBSTNMAP¶
A map of template variable names and their values. All variable values are passed as strings regardless of the declared variable type. For example, pass
INTEGERvalues as"42"andBOOLEANvalues as"true"or"false".
Optional arguments:¶
iv_templateid TYPE /AWS1/PP2NOTIFYTEMPLATEID /AWS1/PP2NOTIFYTEMPLATEID¶
The unique identifier of the template to use for the message.
iv_voiceid TYPE /AWS1/PP2VOICEID /AWS1/PP2VOICEID¶
The voice ID to use for the voice message.
iv_timetolive TYPE /AWS1/PP2TIMETOLIVE /AWS1/PP2TIMETOLIVE¶
How long the voice message is valid for, in seconds. By default this is 72 hours.
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_configurationsetname TYPE /AWS1/PP2CONFSETNAMEORARN /AWS1/PP2CONFSETNAMEORARN¶
The name of the configuration set to use. This can be either the ConfigurationSetName or ConfigurationSetArn.
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.
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_pp2sendntfvoicemsgrs /AWS1/CL_PP2SENDNTFVOICEMSGRS¶
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->sendnotifyvoicemessage(
it_context = VALUE /aws1/cl_pp2contextmap_w=>tt_contextmap(
(
VALUE /aws1/cl_pp2contextmap_w=>ts_contextmap_maprow(
value = new /aws1/cl_pp2contextmap_w( |string| )
key = |string|
)
)
)
it_templatevariables = VALUE /aws1/cl_pp2tmplvarsubstmap_w=>tt_templatevariablesubstnmap(
(
VALUE /aws1/cl_pp2tmplvarsubstmap_w=>ts_tmplvarblsubstnmap_maprow(
key = |string|
value = new /aws1/cl_pp2tmplvarsubstmap_w( |string| )
)
)
)
iv_configurationsetname = |string|
iv_destinationphonenumber = |string|
iv_dryrun = ABAP_TRUE
iv_messagefeedbackenabled = ABAP_TRUE
iv_notifyconfigurationid = |string|
iv_templateid = |string|
iv_timetolive = 123
iv_voiceid = |string|
).
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( ).
lv_notifytemplateid = lo_result->get_templateid( ).
lv_string = lo_result->get_resolvedmessagebody( ).
ENDIF.
SendNotifyVoiceMessage¶
Send an OTP verification code via voice call using a notify configuration.
DATA(lo_result) = lo_client->sendnotifyvoicemessage(
it_templatevariables = VALUE /aws1/cl_pp2tmplvarsubstmap_w=>tt_templatevariablesubstnmap(
(
VALUE /aws1/cl_pp2tmplvarsubstmap_w=>ts_tmplvarblsubstnmap_maprow(
key = |code|
value = new /aws1/cl_pp2tmplvarsubstmap_w( |123456| )
)
)
(
VALUE /aws1/cl_pp2tmplvarsubstmap_w=>ts_tmplvarblsubstnmap_maprow(
key = |expiry|
value = new /aws1/cl_pp2tmplvarsubstmap_w( |10| )
)
)
)
iv_destinationphonenumber = |+12065550100|
iv_notifyconfigurationid = |nc-1234567890abcdef0|
iv_voiceid = |JOANNA|
).