:doc:`ChimeSDKMessaging <../../chime-sdk-messaging>` / Client / list_channel_memberships

************************
list_channel_memberships
************************



.. py:method:: ChimeSDKMessaging.Client.list_channel_memberships(**kwargs)

  

  Lists all channel memberships in a channel.

   

  .. note::

    

    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.

    

   

  If you want to list the channels to which a specific app instance user belongs, see the `ListChannelMembershipsForAppInstanceUser <https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_messaging-chime_ListChannelMembershipsForAppInstanceUser.html>`__ API.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-messaging-2021-05-15/ListChannelMemberships>`_  


  **Request Syntax**
  ::

    response = client.list_channel_memberships(
        ChannelArn='string',
        Type='DEFAULT'|'HIDDEN',
        MaxResults=123,
        NextToken='string',
        ChimeBearer='string',
        SubChannelId='string'
    )
    
  :type ChannelArn: string
  :param ChannelArn: **[REQUIRED]** 

    The maximum number of channel memberships that you want returned.

    

  
  :type Type: string
  :param Type: 

    The membership type of a user, ``DEFAULT`` or ``HIDDEN``. Default members are returned as part of ``ListChannelMemberships`` if no type is specified. Hidden members are only returned if the type filter in ``ListChannelMemberships`` equals ``HIDDEN``.

    

  
  :type MaxResults: integer
  :param MaxResults: 

    The maximum number of channel memberships that you want returned.

    

  
  :type NextToken: string
  :param NextToken: 

    The token passed by previous API calls until all requested channel memberships are returned.

    

  
  :type ChimeBearer: string
  :param ChimeBearer: **[REQUIRED]** 

    The ARN of the ``AppInstanceUser`` or ``AppInstanceBot`` that makes the API call.

    

  
  :type SubChannelId: string
  :param SubChannelId: 

    The ID of the SubChannel in the request.

     

    .. note::

      

      Only required when listing a user's memberships in a particular sub-channel of an elastic channel.

      

    

  
  
  :rtype: dict
  :returns: 
    
    **Response Syntax**

    
    ::

      {
          'ChannelArn': 'string',
          'ChannelMemberships': [
              {
                  'Member': {
                      'Arn': 'string',
                      'Name': 'string'
                  }
              },
          ],
          'NextToken': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **ChannelArn** *(string) --* 

        The ARN of the channel.

        
      

      - **ChannelMemberships** *(list) --* 

        The information for the requested channel memberships.

        
        

        - *(dict) --* 

          Summary of the details of a ``ChannelMembership``.

          
          

          - **Member** *(dict) --* 

            A member's summary data.

            
            

            - **Arn** *(string) --* 

              The ARN in an Identity.

              
            

            - **Name** *(string) --* 

              The name in an Identity.

              
        
      
    
      

      - **NextToken** *(string) --* 

        The token passed by previous API calls until all requested channel memberships are returned.

        
  
  **Exceptions**
  
  *   :py:class:`ChimeSDKMessaging.Client.exceptions.BadRequestException`

  
  *   :py:class:`ChimeSDKMessaging.Client.exceptions.ForbiddenException`

  
  *   :py:class:`ChimeSDKMessaging.Client.exceptions.UnauthorizedClientException`

  
  *   :py:class:`ChimeSDKMessaging.Client.exceptions.ThrottledClientException`

  
  *   :py:class:`ChimeSDKMessaging.Client.exceptions.ServiceUnavailableException`

  
  *   :py:class:`ChimeSDKMessaging.Client.exceptions.ServiceFailureException`

  