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

*********************
channel_flow_callback
*********************



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

  

  Calls back Amazon Chime SDK messaging with a processing response message. This should be invoked from the processor Lambda. This is a developer API.

   

  You can return one of the following processing responses:

   

  
  * Update message content or metadata
   
  * Deny a message
   
  * Make no changes to the message
  

  

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


  **Request Syntax**
  ::

    response = client.channel_flow_callback(
        CallbackId='string',
        ChannelArn='string',
        DeleteResource=True|False,
        ChannelMessage={
            'MessageId': 'string',
            'Content': 'string',
            'Metadata': 'string',
            'PushNotification': {
                'Title': 'string',
                'Body': 'string',
                'Type': 'DEFAULT'|'VOIP'
            },
            'MessageAttributes': {
                'string': {
                    'StringValues': [
                        'string',
                    ]
                }
            },
            'SubChannelId': 'string',
            'ContentType': 'string'
        }
    )
    
  :type CallbackId: string
  :param CallbackId: **[REQUIRED]** 

    The identifier passed to the processor by the service when invoked. Use the identifier to call back the service.

    This field is autopopulated if not provided.

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

    The ARN of the channel.

    

  
  :type DeleteResource: boolean
  :param DeleteResource: 

    When a processor determines that a message needs to be ``DENIED``, pass this parameter with a value of true.

    

  
  :type ChannelMessage: dict
  :param ChannelMessage: **[REQUIRED]** 

    Stores information about the processed message.

    

  
    - **MessageId** *(string) --* **[REQUIRED]** 

      The message ID.

      

    
    - **Content** *(string) --* 

      The message content. For Amazon Lex V2 bot responses, this field holds a list of messages originating from the bot. For more information, refer to `Processing responses from an AppInstanceBot <https://docs.aws.amazon.com/chime-sdk/latest/dg/appinstance-bots#process-response.html>`__ in the *Amazon Chime SDK Messaging Developer Guide*.

      

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

      The message metadata.

      

    
    - **PushNotification** *(dict) --* 

      The push notification configuration of the message.

      

    
      - **Title** *(string) --* 

        The title of the push notification.

        

      
      - **Body** *(string) --* 

        The body of the push notification.

        

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

        Enum value that indicates the type of the push notification for a message. ``DEFAULT``: Normal mobile push notification. ``VOIP``: VOIP mobile push notification.

        

      
    
    - **MessageAttributes** *(dict) --* 

      The attributes for the channel message. For Amazon Lex V2 bot responses, the attributes are mapped to specific fields from the bot. For more information, refer to `Processing responses from an AppInstanceBot <https://docs.aws.amazon.com/chime-sdk/latest/dg/appinstance-bots#process-response.html>`__ in the *Amazon Chime SDK Messaging Developer Guide*.

      

    
      - *(string) --* 

      
        - *(dict) --* 

          A list of message attribute values.

          

        
          - **StringValues** *(list) --* 

            The strings in a message attribute value.

            

          
            - *(string) --* 

            
        
        
  

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

      The ID of the SubChannel.

      

    
    - **ContentType** *(string) --* 

      The content type of the call-back message. For Amazon Lex V2 bot responses, the content type is ``application/amz-chime-lex-msgs`` for success responses and ``application/amz-chime-lex-error`` for failure responses. For more information, refer to `Processing responses from an AppInstanceBot <https://docs.aws.amazon.com/chime-sdk/latest/dg/appinstance-bots#process-response.html>`__ in the *Amazon Chime SDK Messaging Developer Guide*.

      

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

    
    ::

      {
          'ChannelArn': 'string',
          'CallbackId': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

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

        The ARN of the channel.

        
      

      - **CallbackId** *(string) --* 

        The call back ID passed in the request.

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

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

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

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

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

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

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

  