class_docstr: A custom REST http input channel that responds using a callback server.
  
  Incoming messages are received through a REST interface. Responses
  are sent asynchronously by calling a configured external REST endpoint.
class_docstr_tok: ["A","custom","REST","http","input","channel","that","responds","using","a","callback","server",".","Incoming","messages","are","received","through","a","REST","interface",".","Responses","are","sent","asynchronously","by","calling","a","configured","external","REST","endpoint","."]
code: def blueprint(
      self, on_new_message: Callable[[UserMessage], Awaitable[Any]]
  ) -> Blueprint:
      callback_webhook = Blueprint("callback_webhook", __name__)
  
      @callback_webhook.route("/", methods=["GET"])
      async def health(_: Request) -> HTTPResponse:
          return response.json({"status": "ok"})
  
      @callback_webhook.route("/webhook", methods=["POST"])
      async def webhook(request: Request) -> HTTPResponse:
          sender_id = await self._extract_sender(request)
          text = self._extract_message(request)
  
          collector = self.get_output_channel()
          await on_new_message(
              UserMessage(
                  text, collector, sender_id, input_channel=self.name()
              )
          )
          return response.text("success")
  
      return callback_webhook
  
file_path: rasa/rasa/core/channels/callback.py
imports: import logging
  from typing import Text, Dict, Optional, Callable, Awaitable, Any
  from sanic import Blueprint, response
  from sanic.request import Request
  from rasa.core.channels.channel import CollectingOutputChannel, UserMessage, InputChannel
  from rasa.core.channels.rest import RestInput
  from rasa.utils.endpoints import EndpointConfig, ClientResponseError
  from sanic.response import HTTPResponse
label_desc: Use image node_id 4 for calling the CallbackInput obj's underlying member method code with example usage: obj.blueprint(on_new_message) and returns: callback_webhook, response, response