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

**********************************************
list_channel_memberships_for_app_instance_user
**********************************************



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

  

  Lists all channels that an ``AppInstanceUser`` or ``AppInstanceBot`` is a part of. Only an ``AppInstanceAdmin`` can call the API with a user ARN that is not their own.

   

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

    

  

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


  **Request Syntax**
  ::

    response = client.list_channel_memberships_for_app_instance_user(
        AppInstanceUserArn='string',
        MaxResults=123,
        NextToken='string',
        ChimeBearer='string'
    )
    
  :type AppInstanceUserArn: string
  :param AppInstanceUserArn: 

    The ARN of the user or bot.

    

  
  :type MaxResults: integer
  :param MaxResults: 

    The maximum number of users that you want returned.

    

  
  :type NextToken: string
  :param NextToken: 

    The token returned from previous API requests until the number of channel memberships is reached.

    

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

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

    

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

    
    ::

      {
          'ChannelMemberships': [
              {
                  'ChannelSummary': {
                      'Name': 'string',
                      'ChannelArn': 'string',
                      'Mode': 'UNRESTRICTED'|'RESTRICTED',
                      'Privacy': 'PUBLIC'|'PRIVATE',
                      'Metadata': 'string',
                      'LastMessageTimestamp': datetime(2015, 1, 1)
                  },
                  'AppInstanceUserMembershipSummary': {
                      'Type': 'DEFAULT'|'HIDDEN',
                      'ReadMarkerTimestamp': datetime(2015, 1, 1),
                      'SubChannelId': 'string'
                  }
              },
          ],
          'NextToken': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

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

        The information for the requested channel memberships.

        
        

        - *(dict) --* 

          Summary of the channel membership details of an ``AppInstanceUser``.

          
          

          - **ChannelSummary** *(dict) --* 

            Returns the channel data for an ``AppInstance``.

            
            

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

              The name of the channel.

              
            

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

              The ARN of the channel.

              
            

            - **Mode** *(string) --* 

              The mode of the channel.

              
            

            - **Privacy** *(string) --* 

              The privacy setting of the channel.

              
            

            - **Metadata** *(string) --* 

              The metadata of the channel.

              
            

            - **LastMessageTimestamp** *(datetime) --* 

              The time at which the last persistent message visible to the caller in a channel was sent.

              
        
          

          - **AppInstanceUserMembershipSummary** *(dict) --* 

            Returns the channel membership data for an ``AppInstance``.

            
            

            - **Type** *(string) --* 

              The type of ``ChannelMembership``.

              
            

            - **ReadMarkerTimestamp** *(datetime) --* 

              The time at which an ``AppInstanceUser`` last marked a channel as read.

              
            

            - **SubChannelId** *(string) --* 

              The ID of the SubChannel that the ``AppInstanceUser`` is a member of.

              
        
      
    
      

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

        The token passed by previous API calls until all requested users 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`

  