Skip to content

get_channel_message_status async

get_channel_message_status(
    channel_arn: ChimeArn,
    message_id: MessageId,
    chime_bearer: ChimeArn,
    *,
    config_overrides: Optional[AsyncChimeSDKMessagingClientConfig] = None,
    sub_channel_id: Optional[SubChannelId] = None,
) -> GetChannelMessageStatusResponse

Gets message status for a specified messageId. Use this API to determine the intermediate status of messages going through channel flow processing. The API provides an alternative to retrieving message status if the event was not received because a client wasn't connected to a websocket.

Messages can have any one of these statuses.

SENT

Message processed successfully

PENDING

Ongoing processing

FAILED

Processing failed

DENIED

Message denied by the processor

  • This API does not return statuses for denied messages, because we don't store them once the processor denies them.

  • Only the message sender can invoke this API.

  • 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.

Parameters:

  • channel_arn (ChimeArn) –

    The ARN of the channel

  • message_id (MessageId) –

    The ID of the message.

  • chime_bearer (ChimeArn) –

    The AppInstanceUserArn of the user making the API call.

  • sub_channel_id (Optional[SubChannelId], default: None ) –

    The ID of the SubChannel in the request.

    Only required when getting message status in a SubChannel that the user belongs to.

Raises:

Source code in docs_src/capo_chime_sdk_messaging/_services/async_chime_sdk_messaging.py
async def get_channel_message_status(
    self,
    channel_arn: "capo_chime_sdk_messaging.types.chime_arn.ChimeArn",
    message_id: "capo_chime_sdk_messaging.types.message_id.MessageId",
    chime_bearer: "capo_chime_sdk_messaging.types.chime_arn.ChimeArn",
    *,
    config_overrides: Optional[AsyncChimeSDKMessagingClientConfig] = None,
    sub_channel_id: Optional[
        "capo_chime_sdk_messaging.types.sub_channel_id.SubChannelId"
    ] = None,
) -> "capo_chime_sdk_messaging.types.get_channel_message_status_response.GetChannelMessageStatusResponse":
    """<p>Gets message status for a specified <code>messageId</code>. Use this API to determine the intermediate status of messages going through channel flow processing. The API provides an alternative to retrieving message status if the event was not received because a client wasn't connected to a websocket. </p> <p>Messages can have any one of these statuses.</p> <dl> <dt>SENT</dt> <dd> <p>Message processed successfully</p> </dd> <dt>PENDING</dt> <dd> <p>Ongoing processing</p> </dd> <dt>FAILED</dt> <dd> <p>Processing failed</p> </dd> <dt>DENIED</dt> <dd> <p>Message denied by the processor</p> </dd> </dl> <note> <ul> <li> <p>This API does not return statuses for denied messages, because we don't store them once the processor denies them. </p> </li> <li> <p>Only the message sender can invoke this API.</p> </li> <li> <p>The <code>x-amz-chime-bearer</code> request header is mandatory. Use the ARN of the <code>AppInstanceUser</code> or <code>AppInstanceBot</code> that makes the API call as the value in the header.</p> </li> </ul> </note>

    Args:
        channel_arn: <p>The ARN of the channel</p>
        message_id: <p>The ID of the message.</p>
        chime_bearer: <p>The <code>AppInstanceUserArn</code> of the user making the API call.</p>
        sub_channel_id: <p>The ID of the SubChannel in the request.</p> <note> <p>Only required when getting message status in a SubChannel that the user belongs to.</p> </note>

    Raises:
        capo_chime_sdk_messaging.errors.bad_request_exception.BadRequestException: <p>The input parameters don't match the service's restrictions.</p>
        capo_chime_sdk_messaging.errors.forbidden_exception.ForbiddenException: <p>The client is permanently forbidden from making the request.</p>
        capo_chime_sdk_messaging.errors.service_failure_exception.ServiceFailureException: <p>The service encountered an unexpected error.</p>
        capo_chime_sdk_messaging.errors.service_unavailable_exception.ServiceUnavailableException: <p>The service is currently unavailable.</p>
        capo_chime_sdk_messaging.errors.throttled_client_exception.ThrottledClientException: <p>The client exceeded its request rate limit.</p>
        capo_chime_sdk_messaging.errors.unauthorized_client_exception.UnauthorizedClientException: <p>The client is not currently authorized to make the request.</p>
        capo_chime_sdk_messaging.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_chime_sdk_messaging.types.get_channel_message_status_request.GetChannelMessageStatusRequest]",
    ) -> AsyncOperationResponse[
        "capo_chime_sdk_messaging.types.get_channel_message_status_response.GetChannelMessageStatusResponse"
    ]:
        import capo_chime_sdk_messaging._operations.chime_messaging_service.get_channel_message_status

        (
            output,
            http_response,
        ) = await capo_chime_sdk_messaging._operations.chime_messaging_service.get_channel_message_status.async_get_channel_message_status(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetChannelMessageStatus")
    )
    input_: capo_chime_sdk_messaging.types.get_channel_message_status_request.GetChannelMessageStatusRequest = {
        "channel_arn": channel_arn,
        "message_id": message_id,
        "chime_bearer": chime_bearer,
    }
    if sub_channel_id is not None:
        input_["sub_channel_id"] = sub_channel_id

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output