list_channel_messages
async
¶
list_channel_messages(
channel_arn: ChimeArn,
chime_bearer: ChimeArn,
*,
config_overrides: Optional[AsyncChimeSDKMessagingClientConfig] = None,
sort_order: Optional[SortOrder] = None,
not_before: Optional[Timestamp] = None,
not_after: Optional[Timestamp] = None,
max_results: Optional[MaxResults] = None,
next_token: Optional[NextToken] = None,
sub_channel_id: Optional[SubChannelId] = None,
) -> ListChannelMessagesResponse
List all the messages in a channel. Returns a paginated list of ChannelMessages. By default, sorted by creation timestamp in descending order.
Redacted messages appear in the results as empty, since they are only redacted, not deleted. Deleted messages do not appear in the results. This action always returns the latest version of an edited message.
Also, 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.
-
sort_order(Optional[SortOrder], default:None) –The order in which you want messages sorted. Default is Descending, based on time created.
-
not_before(Optional[Timestamp], default:None) –The initial or starting time stamp for your requested messages.
-
not_after(Optional[Timestamp], default:None) –The final or ending time stamp for your requested messages.
-
max_results(Optional[MaxResults], default:None) –The maximum number of messages that you want returned.
-
next_token(Optional[NextToken], default:None) –The token passed by previous API calls until all requested messages are returned.
-
chime_bearer(ChimeArn) –The ARN of the
AppInstanceUserorAppInstanceBotthat makes the API call. -
sub_channel_id(Optional[SubChannelId], default:None) –The ID of the SubChannel in the request.
Only required when listing the messages in a SubChannel that the user belongs to.
Raises:
-
BadRequestException–The input parameters don't match the service's restrictions.
-
ForbiddenException–The client is permanently forbidden from making the request.
-
ServiceFailureException–The service encountered an unexpected error.
-
ServiceUnavailableException–The service is currently unavailable.
-
ThrottledClientException–The client exceeded its request rate limit.
-
UnauthorizedClientException–The client is not currently authorized to make the request.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_chime_sdk_messaging/_services/async_chime_sdk_messaging.py
2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 | |