Skip to content

/AWS1/IF_WKR=>BATCHLOOKUPUSERUNAME()

About BatchLookupUserUname

Looks up multiple user usernames from their unique username hashes (unames). This operation allows you to retrieve the email addresses associated with a list of username hashes.

Method Signature

METHODS /AWS1/IF_WKR~BATCHLOOKUPUSERUNAME
  IMPORTING
    !IV_NETWORKID TYPE /AWS1/WKRNETWORKID OPTIONAL
    !IT_UNAMES TYPE /AWS1/CL_WKRUNAMES_W=>TT_UNAMES OPTIONAL
    !IV_CLIENTTOKEN TYPE /AWS1/WKRCLIENTTOKEN OPTIONAL
  RETURNING
    VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_wkrbtclkupuseruname01
  RAISING
    /AWS1/CX_WKRBADREQUESTERROR
    /AWS1/CX_WKRFORBIDDENERROR
    /AWS1/CX_WKRINTSERVERERROR
    /AWS1/CX_WKRRATELIMITERROR
    /AWS1/CX_WKRRESNOTFOUNDERROR
    /AWS1/CX_WKRUNAUTHORIZEDERROR
    /AWS1/CX_WKRVALIDATIONERROR
    /AWS1/CX_WKRCLIENTEXC
    /AWS1/CX_WKRSERVEREXC
    /AWS1/CX_RT_TECHNICAL_GENERIC
    /AWS1/CX_RT_SERVICE_GENERIC.

IMPORTING

Required arguments:

iv_networkid TYPE /AWS1/WKRNETWORKID /AWS1/WKRNETWORKID

The ID of the Wickr network where the users will be looked up.

it_unames TYPE /AWS1/CL_WKRUNAMES_W=>TT_UNAMES TT_UNAMES

A list of username hashes (unames) to look up. Each uname is a unique identifier for a user's username. Maximum 50 unames per batch request.

Optional arguments:

iv_clienttoken TYPE /AWS1/WKRCLIENTTOKEN /AWS1/WKRCLIENTTOKEN

A unique identifier for this request to ensure idempotency.

RETURNING

oo_output TYPE REF TO /aws1/cl_wkrbtclkupuseruname01 /AWS1/CL_WKRBTCLKUPUSERUNAME01

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->batchlookupuseruname(
  it_unames = VALUE /aws1/cl_wkrunames_w=>tt_unames(
    ( new /aws1/cl_wkrunames_w( |string| ) )
  )
  iv_clienttoken = |string|
  iv_networkid = |string|
).

This is an example of reading all possible response values

lo_result = lo_result.
IF lo_result IS NOT INITIAL.
  lv_genericstring = lo_result->get_message( ).
  LOOP AT lo_result->get_successful( ) into lo_row.
    lo_row_1 = lo_row.
    IF lo_row_1 IS NOT INITIAL.
      lv_uname = lo_row_1->get_uname( ).
      lv_genericstring = lo_row_1->get_username( ).
    ENDIF.
  ENDLOOP.
  LOOP AT lo_result->get_failed( ) into lo_row_2.
    lo_row_3 = lo_row_2.
    IF lo_row_3 IS NOT INITIAL.
      lv_genericstring = lo_row_3->get_field( ).
      lv_genericstring = lo_row_3->get_reason( ).
      lv_uname = lo_row_3->get_uname( ).
    ENDIF.
  ENDLOOP.
ENDIF.

Lookup multiple user unames

Lookup multiple user unames

DATA(lo_result) = lo_client->batchlookupuseruname(
  it_unames = VALUE /aws1/cl_wkrunames_w=>tt_unames(
    ( new /aws1/cl_wkrunames_w( |a1b2c3d4e5f6| ) )
    ( new /aws1/cl_wkrunames_w( |g7h8i9j0k1l2| ) )
  )
  iv_clienttoken = |f47ac10b-58cc-4372-a567-0e02b2c3d479|
  iv_networkid = |12345678|
).

Partial failure - uname not found

Partial failure - uname not found

DATA(lo_result) = lo_client->batchlookupuseruname(
  it_unames = VALUE /aws1/cl_wkrunames_w=>tt_unames(
    ( new /aws1/cl_wkrunames_w( |a1b2c3d4e5f6| ) )
    ( new /aws1/cl_wkrunames_w( |invaliduname| ) )
  )
  iv_networkid = |12345678|
).