Update an announcement
This action updates information on a specific announcement. You can update the information of an announcement only when its status is scheduled
, which indicates that the announcement hasn't started. After the announcement starts, you can change its status.
HTTP request
Parameters
The following table lists the parameters that this action supports.
Required
Parameter name | Type | Description |
---|---|---|
unique_id | string | Specifies the unique ID of the announcement. |
Request body
The following table lists the properties of an HTTP request that this action supports.
Properties
Optional | Type | Description |
---|---|---|
action | string | Specifies an action to take on the announcement. If this property is updated, other specified properties in the request aren't effective. Acceptable values are |
announcement_group | string | Specifies the name of an announcement group. If not specified, all announcements are returned, regardless of their group. |
target_custom_type | string | Determines which group channels are target for the announcement based on their custom channel type. It also determines the custom channel type of new channels that will be created for this announcement. When target channels don't exist and |
create_channel | boolean | Determines whether to create a new channel if there is no existing channel that fits the specified target scope including |
create_channel_options.name | string | Specifies the name of the channel. (Default: |
create_channel_options.cover_url | string | Specifies the URL of the cover image for the channel. |
create_channel_options.custom_type | string | Specifies the custom channel type. |
create_channel_options.data | string | Specifies additional channel information such as a long description of the channel or |
create_channel_options.distinct | string | Determines whether to create a distinct channel. (Default: |
message.user_id | string | Specifies the unique ID of the announcement sender. |
message.content | string | Specifies the content of the message. |
message.data | string | Specifies additional information regarding the message, such as custom font size, font type, or file, in |
enable_push | boolean | Determines whether to turn on push notifications of the announcement. If set to |
scheduled_at | long | Specifies the time to start the announcement in Unix milliseconds format. If not specified, the default is the timestamp of when the request was delivered to the Sendbird server. |
end_at | long | Specifies the time to permanently end the announcement in Unix milliseconds format. If specified, the announcement ends no matter if the announcement has been sent to all its targets. |
cease_at | string | Specifies the time to temporarily put the announcement on hold in UTC. The value is represented in HHMM format. This property should be specified in conjunction with the |
resume_at | string | SSpecifies the time to automatically resume the on-hold announcement in UTC. The value is represented in HHMM format. This property should be specified in conjunction with the |
send_to_frozen_channels | boolean | Determines whether to send the announcement to frozen channels. (Default: |
keep_channel_hidden_for_sender | boolean | Determines whether to hide the newly created or existing channels associated with the announcement from the announcement sender's channel list. When set to |
Changing announcement status
You can change the status of an announcement by specifying one of the following four actions in the action
property.
Action | Description |
---|---|
cancel | Status changes from |
pause | Status changes from |
resume | Status changes from |
stop | Status changes from |
Request body
This API request can be applied to two situations as shown below.
Responses
If successful, this action returns an updated announcement resource containing its status information in the response body.
Error
If you attempt to take an action with an unacceptable status, an error is returned with a 400-series HTTP code. For example, the stop
action is only applicable to the running
status. See the error codes section for more details.