Skip to content

/AWS1/IF_PPM=>GETWHATSAPPCALLPERMISSION()

About GetWhatsAppCallPermission

Retrieves the current calling permission for a WhatsApp end user, along with the calling actions the business is allowed to take with that user. Provide the destination phone number or the business-scoped user ID to identify the end user.

Method Signature

METHODS /AWS1/IF_PPM~GETWHATSAPPCALLPERMISSION
  IMPORTING
    !IV_ORIGINATIONPHONENUMBERID TYPE /AWS1/PPMWHATSAPPPHONENUMBERID OPTIONAL
    !IV_DESTINATIONPHONENUMBER TYPE /AWS1/PPMWHATSAPPDSTPHONENUM OPTIONAL
    !IV_ENDUSERBSUID TYPE /AWS1/PPMWHATSAPPBIZSCPDUSERID OPTIONAL
  RETURNING
    VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_ppmgtwhtappcallperm01
  RAISING
    /AWS1/CX_PPMACCESSDENIEDEX
    /AWS1/CX_PPMVALIDATIONEX
    /AWS1/CX_PPMACCDENIEDBYMETAEX
    /AWS1/CX_PPMDEPENDENCYEX
    /AWS1/CX_PPMINTERNALSERVICEEX
    /AWS1/CX_PPMINVALIDPARAMSEX
    /AWS1/CX_PPMRESOURCENOTFOUNDEX
    /AWS1/CX_PPMTHROTTLEDREQUESTEX
    /AWS1/CX_PPMCLIENTEXC
    /AWS1/CX_PPMSERVEREXC
    /AWS1/CX_RT_TECHNICAL_GENERIC
    /AWS1/CX_RT_SERVICE_GENERIC.

IMPORTING

Required arguments:

iv_originationphonenumberid TYPE /AWS1/PPMWHATSAPPPHONENUMBERID /AWS1/PPMWHATSAPPPHONENUMBERID

The unique identifier of the business phone number for which to retrieve the calling permission. The phone number identifiers are formatted as phone-number-id-01234567890123456789012345678901.

Optional arguments:

iv_destinationphonenumber TYPE /AWS1/PPMWHATSAPPDSTPHONENUM /AWS1/PPMWHATSAPPDSTPHONENUM

The end user's phone number, in E.164 format, for which to retrieve the calling permission.

iv_enduserbsuid TYPE /AWS1/PPMWHATSAPPBIZSCPDUSERID /AWS1/PPMWHATSAPPBIZSCPDUSERID

The business-scoped user identifier (BSUID) of the end user for which to retrieve the calling permission.

RETURNING

oo_output TYPE REF TO /aws1/cl_ppmgtwhtappcallperm01 /AWS1/CL_PPMGTWHTAPPCALLPERM01

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->getwhatsappcallpermission(
  iv_destinationphonenumber = |string|
  iv_enduserbsuid = |string|
  iv_originationphonenumberid = |string|
).

This is an example of reading all possible response values

lo_result = lo_result.
IF lo_result IS NOT INITIAL.
  lo_whatsappcallpermission = lo_result->get_permission( ).
  IF lo_whatsappcallpermission IS NOT INITIAL.
    lv_whatsappcallpermissions = lo_whatsappcallpermission->get_status( ).
    lv_timestamp = lo_whatsappcallpermission->get_expirationtime( ).
  ENDIF.
  LOOP AT lo_result->get_actions( ) into lo_row.
    lo_row_1 = lo_row.
    IF lo_row_1 IS NOT INITIAL.
      lv_whatsappcallpermissiona = lo_row_1->get_actionname( ).
      lv_boolean = lo_row_1->get_canperformaction( ).
      LOOP AT lo_row_1->get_limits( ) into lo_row_2.
        lo_row_3 = lo_row_2.
        IF lo_row_3 IS NOT INITIAL.
          lv_iso8601duration = lo_row_3->get_timeperiod( ).
          lv_integer = lo_row_3->get_maxallowed( ).
          lv_integer = lo_row_3->get_currentusage( ).
          lv_timestamp = lo_row_3->get_limitexpirationtime( ).
        ENDIF.
      ENDLOOP.
    ENDIF.
  ENDLOOP.
ENDIF.