getChannelMessageStatus method

Future<GetChannelMessageStatusResponse> getChannelMessageStatus({
  1. required String channelArn,
  2. required String chimeBearer,
  3. required String messageId,
  4. String? subChannelId,
})

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

May throw BadRequestException. May throw ForbiddenException. May throw ServiceFailureException. May throw ServiceUnavailableException. May throw ThrottledClientException. May throw UnauthorizedClientException.

Parameter channelArn : The ARN of the channel

Parameter chimeBearer : The AppInstanceUserArn of the user making the API call.

Parameter messageId : The ID of the message.

Parameter subChannelId : The ID of the SubChannel in the request.

Implementation

Future<GetChannelMessageStatusResponse> getChannelMessageStatus({
  required String channelArn,
  required String chimeBearer,
  required String messageId,
  String? subChannelId,
}) async {
  final headers = <String, String>{
    'x-amz-chime-bearer': chimeBearer.toString(),
  };
  final $query = <String, List<String>>{
    if (subChannelId != null) 'sub-channel-id': [subChannelId],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri:
        '/channels/${Uri.encodeComponent(channelArn)}/messages/${Uri.encodeComponent(messageId)}?scope=message-status',
    queryParams: $query,
    headers: headers,
    exceptionFnMap: _exceptionFns,
  );
  return GetChannelMessageStatusResponse.fromJson(response);
}