/AWS1/IF_CHS=>SENDCHANNELMESSAGE()¶
About SendChannelMessage¶
Sends a message to a particular channel that the member is a part of.
The x-amz-chime-bearer request header is mandatory. Use the
ARN of the AppInstanceUser or AppInstanceBot that makes the API call as the value in
the header.
Also, STANDARD messages can be up to 4KB in size and contain metadata. Metadata is arbitrary,
and you can use it in a variety of ways, such as containing a link to an attachment.
CONTROL messages are limited to 30 bytes and do not contain metadata.
Method Signature¶
METHODS /AWS1/IF_CHS~SENDCHANNELMESSAGE
IMPORTING
!IV_CHANNELARN TYPE /AWS1/CHSCHIMEARN OPTIONAL
!IV_CONTENT TYPE /AWS1/CHSNONEMPTYCONTENT OPTIONAL
!IV_TYPE TYPE /AWS1/CHSCHANNELMESSAGETYPE OPTIONAL
!IV_PERSISTENCE TYPE /AWS1/CHSCHANNELMSGPERSISTEN00 OPTIONAL
!IV_METADATA TYPE /AWS1/CHSMETADATA OPTIONAL
!IV_CLIENTREQUESTTOKEN TYPE /AWS1/CHSCLIENTREQUESTTOKEN OPTIONAL
!IV_CHIMEBEARER TYPE /AWS1/CHSCHIMEARN OPTIONAL
!IO_PUSHNOTIFICATION TYPE REF TO /AWS1/CL_CHSPUSHNOTIFCONF OPTIONAL
!IT_MESSAGEATTRIBUTES TYPE /AWS1/CL_CHSMESSAGEATTRVALUE=>TT_MESSAGEATTRIBUTEMAP OPTIONAL
!IV_SUBCHANNELID TYPE /AWS1/CHSSUBCHANNELID OPTIONAL
!IV_CONTENTTYPE TYPE /AWS1/CHSCONTENTTYPE OPTIONAL
!IT_TARGET TYPE /AWS1/CL_CHSTARGET=>TT_TARGETLIST OPTIONAL
RETURNING
VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_chssendchannelmsgrsp
RAISING
/AWS1/CX_CHSBADREQUESTEX
/AWS1/CX_CHSCONFLICTEXCEPTION
/AWS1/CX_CHSFORBIDDENEXCEPTION
/AWS1/CX_CHSSERVICEFAILUREEX
/AWS1/CX_CHSSERVICEUNAVAILEX
/AWS1/CX_CHSTHROTTLEDCLIENTEX
/AWS1/CX_CHSUNAUTHDCLIENTEX
/AWS1/CX_CHSCLIENTEXC
/AWS1/CX_CHSSERVEREXC
/AWS1/CX_RT_TECHNICAL_GENERIC
/AWS1/CX_RT_SERVICE_GENERIC.
IMPORTING¶
Required arguments:¶
iv_channelarn TYPE /AWS1/CHSCHIMEARN /AWS1/CHSCHIMEARN¶
The ARN of the channel.
iv_content TYPE /AWS1/CHSNONEMPTYCONTENT /AWS1/CHSNONEMPTYCONTENT¶
The content of the channel message.
iv_type TYPE /AWS1/CHSCHANNELMESSAGETYPE /AWS1/CHSCHANNELMESSAGETYPE¶
The type of message,
STANDARDorCONTROL.
STANDARDmessages can be up to 4KB in size and contain metadata. Metadata is arbitrary, and you can use it in a variety of ways, such as containing a link to an attachment.
CONTROLmessages are limited to 30 bytes and do not contain metadata.
iv_persistence TYPE /AWS1/CHSCHANNELMSGPERSISTEN00 /AWS1/CHSCHANNELMSGPERSISTEN00¶
Boolean that controls whether the message is persisted on the back end. Required.
iv_clientrequesttoken TYPE /AWS1/CHSCLIENTREQUESTTOKEN /AWS1/CHSCLIENTREQUESTTOKEN¶
The
Idempotencytoken for each client request.
iv_chimebearer TYPE /AWS1/CHSCHIMEARN /AWS1/CHSCHIMEARN¶
The ARN of the
AppInstanceUserorAppInstanceBotthat makes the API call.
Optional arguments:¶
iv_metadata TYPE /AWS1/CHSMETADATA /AWS1/CHSMETADATA¶
The optional metadata for each message.
io_pushnotification TYPE REF TO /AWS1/CL_CHSPUSHNOTIFCONF /AWS1/CL_CHSPUSHNOTIFCONF¶
The push notification configuration of the message.
it_messageattributes TYPE /AWS1/CL_CHSMESSAGEATTRVALUE=>TT_MESSAGEATTRIBUTEMAP TT_MESSAGEATTRIBUTEMAP¶
The attributes for the message, used for message filtering along with a
FilterRuledefined in thePushNotificationPreferences.
iv_subchannelid TYPE /AWS1/CHSSUBCHANNELID /AWS1/CHSSUBCHANNELID¶
The ID of the SubChannel in the request.
iv_contenttype TYPE /AWS1/CHSCONTENTTYPE /AWS1/CHSCONTENTTYPE¶
The content type of the channel message.
it_target TYPE /AWS1/CL_CHSTARGET=>TT_TARGETLIST TT_TARGETLIST¶
The target of a message. Must be a member of the channel, such as another user, a bot, or the sender. Only the target and the sender can view targeted messages. Only users who can see targeted messages can take actions on them. However, administrators can delete targeted messages that they can’t see.
RETURNING¶
oo_output TYPE REF TO /aws1/cl_chssendchannelmsgrsp /AWS1/CL_CHSSENDCHANNELMSGRSP¶
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->sendchannelmessage(
io_pushnotification = new /aws1/cl_chspushnotifconf(
iv_body = |string|
iv_title = |string|
iv_type = |string|
)
it_messageattributes = VALUE /aws1/cl_chsmessageattrvalue=>tt_messageattributemap(
(
VALUE /aws1/cl_chsmessageattrvalue=>ts_messageattributemap_maprow(
key = |string|
value = new /aws1/cl_chsmessageattrvalue(
it_stringvalues = VALUE /aws1/cl_chsmsgattrstrvalues_w=>tt_messageattrstringvalues(
( new /aws1/cl_chsmsgattrstrvalues_w( |string| ) )
)
)
)
)
)
it_target = VALUE /aws1/cl_chstarget=>tt_targetlist(
( new /aws1/cl_chstarget( |string| ) )
)
iv_channelarn = |string|
iv_chimebearer = |string|
iv_clientrequesttoken = |string|
iv_content = |string|
iv_contenttype = |string|
iv_metadata = |string|
iv_persistence = |string|
iv_subchannelid = |string|
iv_type = |string|
).
This is an example of reading all possible response values
lo_result = lo_result.
IF lo_result IS NOT INITIAL.
lv_chimearn = lo_result->get_channelarn( ).
lv_messageid = lo_result->get_messageid( ).
lo_channelmessagestatusstr = lo_result->get_status( ).
IF lo_channelmessagestatusstr IS NOT INITIAL.
lv_channelmessagestatus = lo_channelmessagestatusstr->get_value( ).
lv_statusdetail = lo_channelmessagestatusstr->get_detail( ).
ENDIF.
lv_subchannelid = lo_result->get_subchannelid( ).
ENDIF.