# API call to get response

**URL:** <https://forum.rasa.com/t/api-call-to-get-response/23783>\
**Category:** Rasa Open Source\
**Created:** [January 21, 2020, 1:00pm UTC](https://forum.rasa.com/t/api-call-to-get-response/23783 "2020-01-21T13:00:44Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![grb25](https://avatars.discourse-cdn.com/v4/letter/g/bbe5ce/32.png) [@grb25](https://forum.rasa.com/u/grb25)\
**Post date:** [January 21, 2020, 1:00pm UTC](https://forum.rasa.com/t/api-call-to-get-response/23783/1 "2020-01-21T13:00:44Z")

</div>

Hello there, I have build a simple rasabot, and want to use it from web front-end, so I am sending the following json to=\> [http://127.0.0.1:5005/webhooks/rest/webhook](http://127.0.0.1:5005/webhooks/rest/webhook) json is =\> {“sender”:“Me”,“message”:“thanks”,“token”:“None”}

It responds successfully, But I want to have all the info like slot values, entities, intents etc, how to do this? Is this the right way to do it? Please provide me some guidance, Will this work for multiple users chatting simultaneously?

---

<div class="post-metadata">

**Author:** ![amn41](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/amn41/32/20_2.png) [@amn41](https://forum.rasa.com/u/amn41)\
**Post date:** [January 22, 2020, 2:31pm UTC](https://forum.rasa.com/t/api-call-to-get-response/23783/2 "2020-01-22T14:31:07Z")

</div>

for multiple users, this will work so long as you pass a different value for `sender` for each one.

You can fetch the tracker using the [HTTP API](https://rasa.com/docs/rasa/api/http-api/) , but maybe you can elaborate on exactly what you want to build?

---

<div class="post-metadata">

**Author:** ![grb25](https://avatars.discourse-cdn.com/v4/letter/g/bbe5ce/32.png) [@grb25](https://forum.rasa.com/u/grb25)\
**Post date:** [January 22, 2020, 3:50pm UTC](https://forum.rasa.com/t/api-call-to-get-response/23783/3 "2020-01-22T15:50:35Z")

</div>

I want to pass a string via an API from frond-end like I mentioned, and the API will respond with a json with the response string and all the regarding info, like slots, intent of the string, so that some minor modifications can be done at front-end, is that clear? BTW thanks for your response…

---

<div class="post-metadata">

**Author:** ![amn41](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/amn41/32/20_2.png) [@amn41](https://forum.rasa.com/u/amn41)\
**Post date:** [January 22, 2020, 4:33pm UTC](https://forum.rasa.com/t/api-call-to-get-response/23783/4 "2020-01-22T16:33:31Z")

</div>

understood. well you have two options:

1 is that you create extra requests to fetch the tracker (not ideal).

2 is that you create a custom channel. to do that, subclass the [rest channel](https://github.com/RasaHQ/rasa/blob/master/rasa/core/channels/channel.py#L382) and override the `send_message` function to send the additional info you want

---

<div class="post-metadata">

**Author:** ![grb25](https://avatars.discourse-cdn.com/v4/letter/g/bbe5ce/32.png) [@grb25](https://forum.rasa.com/u/grb25)\
**Post date:** [January 23, 2020, 5:43am UTC](https://forum.rasa.com/t/api-call-to-get-response/23783/5 "2020-01-23T05:43:37Z")

</div>

thank you for your response, Can you elaborately describe how to do the option 2, is there any examples or documentations available?

---

<div class="post-metadata">

**Author:** ![grb25](https://avatars.discourse-cdn.com/v4/letter/g/bbe5ce/32.png) [@grb25](https://forum.rasa.com/u/grb25)\
**Post date:** [January 23, 2020, 9:13am UTC](https://forum.rasa.com/t/api-call-to-get-response/23783/6 "2020-01-23T09:13:55Z")

</div>

here is a code I found in RASA FORAM and documentation as well;

import logging import uuid import inspect import rasa from sanic import Blueprint, response from sanic.request import Request from socketio import AsyncServer from typing import Text, List, Dict, Any, Optional, Callable, Iterable, Awaitable from asyncio import Queue, CancelledError from rasa.core.channels.channel import UserMessage, OutputChannel, CollectingOutputChannel, InputChannel

logger = logging.getLogger( **name** )

class RestInput(InputChannel): “”"A custom http input channel.

```
This implementation is the basis for a custom implementation of a chat
frontend. You can customize this to send messages to Rasa Core and
retrieve responses from the agent."""

@classmethod
def name(cls):
    print("hi from name method")
    return "rest"

@staticmethod
async def on_message_wrapper(
    on_new_message: Callable[[UserMessage], Awaitable[None]],
    text: Text,
    queue: Queue,
    sender_id: Text,
) -> None:

    print("Inside on_message_wrapper function")
    collector = QueueOutputChannel(queue)

    message = UserMessage(
        text, collector, sender_id, input_channel=RestInput.name()
    )

    print("above on_new_message method")
    await on_new_message(message)

    await queue.put("DONE") # pytype: disable=bad-return-type

async def _extract_sender(self, req) -> Optional[Text]:
    return req.json.get("sender", None)

# noinspection PyMethodMayBeStatic
def _extract_message(self, req):
    print("User message ::- ",req.json.get("message", None))
    return req.json.get("message", None)

def stream_response(
    self,
    on_new_message: Callable[[UserMessage], Awaitable[None]],
    text: Text,
    sender_id: Text,
) -> Callable[[Any], Awaitable[None]]:
    async def stream(resp: Any) -> None:
        q = Queue()
        task = asyncio.ensure_future(
            self.on_message_wrapper(on_new_message, text, q, sender_id)
        )
        while True:
            result = await q.get() # pytype: disable=bad-return-type
            if result == "DONE":
                break
            else:
                await resp.write(json.dumps(result) + "\n")
        await task

    return stream # pytype: disable=bad-return-type

def blueprint(self, on_new_message: Callable[[UserMessage], Awaitable[None]]):
    custom_webhook = Blueprint(
        "custom_webhook_{}".format(type(self). __name__ ),
        inspect.getmodule(self). __name__ ,
    )

    # noinspection PyUnusedLocal
    @custom_webhook.route("/", methods=["GET"])
    async def health(request: Request):
        print("Inside health")
        return response.json({"status": "ok"})

    @custom_webhook.route("/webhook", methods=["POST"])
    async def receive(request: Request):
        print("Inside receive")
        sender_id = await self._extract_sender(request)
        text = self._extract_message(request)
        print("sender_id is ::-",sender_id)
        print("text is ::-",text)
        should_use_stream = rasa.utils.endpoints.bool_arg(
            request, "stream", default=False
        )

        if should_use_stream:
            return response.stream(
                self.stream_response(on_new_message, text, sender_id),
                 content_type="text/event-stream",
                
            )
        else:
            collector = CollectingOutputChannel()
            on_new_message(UserMessage(text, collector, sender_id))
            print("collector MSG::",collector)
            # noinspection PyBroadException
            try:
                await on_new_message(
                    UserMessage(
                        text, collector, sender_id, input_channel=self.name()
                    )
                )
            except CancelledError:
                logger.error(
                    "Message handling timed out for "
                    "user message '{}'.".format(text)
                )
            except Exception:
                logger.exception(
                    "An exception occured while handling "
                    "user message '{}'.".format(text)
                )
            return response.json(collector.messages)
            

    return custom_webhook

```

Its working fine, like the output is:

(rasa-project-1) gourab@gourab:~/rasa/rasabot$ rasa run -m models --enable-api --cors “\*” --debug 2020-01-23 13:30:36 DEBUG rasa.cli.utils - Parameter ‘endpoints’ not set. Using default location ‘endpoints.yml’ instead. 2020-01-23 13:30:36 DEBUG rasa.cli.utils - Parameter ‘credentials’ not set. Using default location ‘credentials.yml’ instead. hi from name method 2020-01-23 13:30:37 DEBUG rasa.core.utils - Available web server routes: /conversations/\<conversation\_id\>/messages POST add\_message /conversations/\<conversation\_id\>/tracker/events POST append\_events /webhooks/rasa GET custom\_webhook\_RasaChatInput.health /webhooks/rasa/webhook POST custom\_webhook\_RasaChatInput.receive /webhooks/rest GET custom\_webhook\_RestInput.health /webhooks/rest/webhook POST custom\_webhook\_RestInput.receive /model/test/intents POST evaluate\_intents /model/test/stories POST evaluate\_stories /conversations/\<conversation\_id\>/execute POST execute\_action /domain GET get\_domain / GET hello /model PUT load\_model /model/parse POST parse /conversations/\<conversation\_id\>/predict POST predict /conversations/\<conversation\_id\>/tracker/events PUT replace\_events /conversations/\<conversation\_id\>/story GET retrieve\_story /conversations/\<conversation\_id\>/tracker GET retrieve\_tracker /status GET status /model/predict POST tracker\_predict /model/train POST train /model DELETE unload\_model /version GET version hi from name method 2020-01-23 13:30:37 INFO root - Starting Rasa server on [http://localhost:5005](http://localhost:5005) 2020-01-23 13:30:37 DEBUG rasa.core.utils - Using the default number of Sanic workers (1). 2020-01-23 13:30:37 INFO root - Enabling coroutine debugging. Loop id 105198376. 2020-01-23 13:30:37 DEBUG rasa.model - Extracted model to ‘/tmp/tmpa6sqtcg1’. 2020-01-23 13:30:40 INFO absl - Entry Point [tensor2tensor.envs.tic\_tac\_toe\_env:TicTacToeEnv] registered with id [T2TEnv-TicTacToeEnv-v0] 2020-01-23 13:30:40.503954: E tensorflow/stream\_executor/cuda/cuda\_driver.cc:318] failed call to cuInit: UNKNOWN ERROR (303) 2020-01-23 13:30:40 DEBUG rasa.core.tracker\_store - Connected to InMemoryTrackerStore. 2020-01-23 13:30:40 DEBUG rasa.core.lock\_store - Connected to lock store ‘InMemoryLockStore’. 2020-01-23 13:30:41 DEBUG rasa.model - Extracted model to ‘/tmp/tmp5imkw3y7’. 2020-01-23 13:30:41 DEBUG pykwalify.compat - Using yaml library: /home/gourab/rasa/rasa-project-1/lib/python3.6/site-packages/ruamel/yaml/ **init**.py Inside receive User message ::- hi sender\_id is ::- Me text is ::- hi 2020-01-23 13:33:13 ERROR asyncio - \<CoroWrapper register..handler() running at /home/gourab/rasa/rasa-project-1/lib/python3.6/site-packages/rasa/core/channels/channel.py:81, created at /usr/lib/python3.6/asyncio/coroutines.py:85\> was never yielded from Coroutine object created at (most recent call last, truncated to 10 last lines): File “/home/gourab/rasa/rasa-project-1/lib/python3.6/site-packages/rasa/core/run.py”, line 206, in serve\_application endpoints.lock\_store if endpoints else None File “/home/gourab/rasa/rasa-project-1/lib/python3.6/site-packages/sanic/app.py”, line 1133, in run serve(\*\*server\_settings) File “/home/gourab/rasa/rasa-project-1/lib/python3.6/site-packages/sanic/server.py”, line 885, in serve loop.run\_forever() File “/usr/lib/python3.6/asyncio/coroutines.py”, line 126, in send return self.gen.send(value) File “/home/gourab/rasa/rasa-project-1/lib/python3.6/site-packages/spf/framework.py”, line 512, in \_handle\_request stream\_callback) File “/usr/lib/python3.6/asyncio/coroutines.py”, line 110, in **next** return self.gen.send(None) File “/home/gourab/rasa/rasa-project-1/lib/python3.6/site-packages/sanic/app.py”, line 942, in handle\_request response = await response File “/usr/lib/python3.6/asyncio/coroutines.py”, line 110, in **next** return self.gen.send(None) File “/home/gourab/rasa/rasabot/MyIo.py”, line 106, in receive on\_new\_message(UserMessage(text, collector, sender\_id)) File “/usr/lib/python3.6/asyncio/coroutines.py”, line 85, in debug\_wrapper return CoroWrapper(gen, None) /home/gourab/rasa/rasabot/MyIo.py:106: RuntimeWarning: coroutine ‘register..handler’ was never awaited on\_new\_message(UserMessage(text, collector, sender\_id)) collector MSG:: \<rasa.core.channels.channel.CollectingOutputChannel object at 0x7f88b06a48d0\> hi from name method 2020-01-23 13:33:13 DEBUG rasa.core.tracker\_store - Creating a new tracker for id ‘Me’. 2020-01-23 13:33:13 DEBUG rasa.core.processor - Received user message ‘hi’ with intent ‘{‘name’: ‘greet’, ‘confidence’: 0.9369099140167236}’ and entities ‘[]’ 2020-01-23 13:33:13 DEBUG rasa.core.processor - Logged UserUtterance - tracker now has 2 events 2020-01-23 13:33:13 DEBUG rasa.core.policies.memoization - Current tracker state [None, None, None, {}, {‘prev\_action\_listen’: 1.0, ‘intent\_greet’: 1.0}] 2020-01-23 13:33:13 DEBUG rasa.core.policies.memoization - There is a memorised next action ‘12’ 2020-01-23 13:33:14 DEBUG rasa.core.policies.form\_policy - There is no active form 2020-01-23 13:33:14 DEBUG rasa.core.policies.ensemble - Predicted next action using policy\_0\_MemoizationPolicy 2020-01-23 13:33:14 DEBUG rasa.core.processor - Predicted next action ‘utter\_greet’ with confidence 1.00. 2020-01-23 13:33:14 DEBUG rasa.core.processor - Action ‘utter\_greet’ ended with events ‘[‘BotUttered(text: Hello I’m customer service assistant! How can I help you?, data: {“elements”: null, “quick\_replies”: null, “buttons”: null, “attachment”: null, “image”: null, “custom”: null}, metadata: {})’]’ 2020-01-23 13:33:14 DEBUG rasa.core.policies.memoization - Current tracker state [None, None, {}, {‘prev\_action\_listen’: 1.0, ‘intent\_greet’: 1.0}, {‘prev\_utter\_greet’: 1.0, ‘intent\_greet’: 1.0}] 2020-01-23 13:33:14 DEBUG rasa.core.policies.memoization - There is a memorised next action ‘0’ 2020-01-23 13:33:14 DEBUG rasa.core.policies.mapping\_policy - There is no mapped action for the predicted intent, ‘greet’. 2020-01-23 13:33:14 DEBUG rasa.core.policies.form\_policy - There is no active form 2020-01-23 13:33:14 DEBUG rasa.core.policies.ensemble - Predicted next action using policy\_0\_MemoizationPolicy 2020-01-23 13:33:14 DEBUG rasa.core.processor - Predicted next action ‘action\_listen’ with confidence 1.00. 2020-01-23 13:33:14 DEBUG rasa.core.processor - Action ‘action\_listen’ ended with events ‘[]’ 2020-01-23 13:33:14 DEBUG rasa.core.lock\_store - Deleted lock for conversation ‘Me’. Inside receive User message ::- i have a lenovo laptop sender\_id is ::- Me text is ::- i have a lenovo laptop 2020-01-23 13:33:42 ERROR asyncio - \<CoroWrapper register..handler() running at /home/gourab/rasa/rasa-project-1/lib/python3.6/site-packages/rasa/core/channels/channel.py:81, created at /usr/lib/python3.6/asyncio/coroutines.py:85\> was never yielded from Coroutine object created at (most recent call last, truncated to 10 last lines): File “/home/gourab/rasa/rasa-project-1/lib/python3.6/site-packages/rasa/core/run.py”, line 206, in serve\_application endpoints.lock\_store if endpoints else None File “/home/gourab/rasa/rasa-project-1/lib/python3.6/site-packages/sanic/app.py”, line 1133, in run serve(\*\*server\_settings) File “/home/gourab/rasa/rasa-project-1/lib/python3.6/site-packages/sanic/server.py”, line 885, in serve loop.run\_forever() File “/usr/lib/python3.6/asyncio/coroutines.py”, line 126, in send return self.gen.send(value) File “/home/gourab/rasa/rasa-project-1/lib/python3.6/site-packages/spf/framework.py”, line 512, in \_handle\_request stream\_callback) File “/usr/lib/python3.6/asyncio/coroutines.py”, line 110, in **next** return self.gen.send(None) File “/home/gourab/rasa/rasa-project-1/lib/python3.6/site-packages/sanic/app.py”, line 942, in handle\_request response = await response File “/usr/lib/python3.6/asyncio/coroutines.py”, line 110, in **next** return self.gen.send(None) File “/home/gourab/rasa/rasabot/MyIo.py”, line 106, in receive on\_new\_message(UserMessage(text, collector, sender\_id)) File “/usr/lib/python3.6/asyncio/coroutines.py”, line 85, in debug\_wrapper return CoroWrapper(gen, None) collector MSG:: \<rasa.core.channels.channel.CollectingOutputChannel object at 0x7f88b06a4470\> hi from name method 2020-01-23 13:33:42 DEBUG rasa.core.tracker\_store - Recreating tracker for id ‘Me’ 2020-01-23 13:33:42 DEBUG rasa.core.processor - Received user message ‘i have a lenovo laptop’ with intent ‘{‘name’: ‘details\_provider’, ‘confidence’: 0.9882424473762512}’ and entities ‘[{‘start’: 9, ‘end’: 15, ‘value’: ‘lenovo’, ‘entity’: ‘brand’, ‘confidence’: 0.9828931437502632, ‘extractor’: ‘CRFEntityExtractor’}, {‘start’: 16, ‘end’: 22, ‘value’: ‘laptop’, ‘entity’: ‘item’, ‘confidence’: 0.9987055595943064, ‘extractor’: ‘CRFEntityExtractor’}]’ 2020-01-23 13:33:42 DEBUG rasa.core.processor - Current slot values: brand: lenovo issue\_duration: None issue\_location: None issue\_nature: None item: laptop part: None requested\_slot: None 2020-01-23 13:33:42 DEBUG rasa.core.processor - Logged UserUtterance - tracker now has 8 events 2020-01-23 13:33:42 DEBUG rasa.core.policies.memoization - Current tracker state [None, {}, {‘prev\_action\_listen’: 1.0, ‘intent\_greet’: 1.0}, {‘prev\_utter\_greet’: 1.0, ‘intent\_greet’: 1.0}, {‘prev\_action\_listen’: 1.0, ‘entity\_brand’: 1.0, ‘entity\_item’: 1.0, ‘intent\_details\_provider’: 1.0}] 2020-01-23 13:33:42 DEBUG rasa.core.policies.memoization - There is no memorised next action 2020-01-23 13:33:42 DEBUG rasa.core.policies.form\_policy - There is no active form 2020-01-23 13:33:42 DEBUG rasa.core.policies.ensemble - Predicted next action using policy\_1\_KerasPolicy 2020-01-23 13:33:42 DEBUG rasa.core.processor - Predicted next action ‘issue\_form’ with confidence 0.70. 2020-01-23 13:33:42 DEBUG rasa.core.actions.action - Calling action endpoint to run action ‘issue\_form’. 2020-01-23 13:33:42 DEBUG rasa.core.processor - Action ‘issue\_form’ ended with events ‘[‘BotUttered(text: which part of your laptop?, data: {“elements”: null, “quick\_replies”: null, “buttons”: null, “attachment”: null, “image”: null, “custom”: null}, metadata: {“brand”: “lenovo”, “item”: “laptop”})’, ‘Form(issue\_form)’, ‘SlotSet(key: item, value: laptop)’, ‘SlotSet(key: brand, value: lenovo)’, ‘SlotSet(key: requested\_slot, value: part)’]’ 2020-01-23 13:33:42 DEBUG rasa.core.processor - Current slot values: brand: lenovo issue\_duration: None issue\_location: None issue\_nature: None item: laptop part: None requested\_slot: part 2020-01-23 13:33:42 DEBUG rasa.core.policies.memoization - Current tracker state [None, {}, {‘prev\_action\_listen’: 1.0, ‘intent\_greet’: 1.0}, {‘prev\_utter\_greet’: 1.0, ‘intent\_greet’: 1.0}, {‘prev\_action\_listen’: 1.0, ‘entity\_brand’: 1.0, ‘entity\_item’: 1.0, ‘intent\_details\_provider’: 1.0}] 2020-01-23 13:33:42 DEBUG rasa.core.policies.memoization - There is no memorised next action 2020-01-23 13:33:42 DEBUG rasa.core.policies.mapping\_policy - There is no mapped action for the predicted intent, ‘details\_provider’. 2020-01-23 13:33:42 DEBUG rasa.core.policies.form\_policy - There is an active form ‘issue\_form’ 2020-01-23 13:33:42 DEBUG rasa.core.policies.ensemble - Predicted next action using policy\_3\_FormPolicy 2020-01-23 13:33:42 DEBUG rasa.core.processor - Predicted next action ‘action\_listen’ with confidence 1.00. 2020-01-23 13:33:42 DEBUG rasa.core.processor - Action ‘action\_listen’ ended with events ‘[]’ 2020-01-23 13:33:42 DEBUG rasa.core.lock\_store - Deleted lock for conversation ‘Me’. Inside receive User message ::- i have a acer laptop sender\_id is ::- Me1 text is ::- i have a acer laptop 2020-01-23 13:34:06 ERROR asyncio - \<CoroWrapper register..handler() running at /home/gourab/rasa/rasa-project-1/lib/python3.6/site-packages/rasa/core/channels/channel.py:81, created at /usr/lib/python3.6/asyncio/coroutines.py:85\> was never yielded from Coroutine object created at (most recent call last, truncated to 10 last lines): File “/home/gourab/rasa/rasa-project-1/lib/python3.6/site-packages/rasa/core/run.py”, line 206, in serve\_application endpoints.lock\_store if endpoints else None File “/home/gourab/rasa/rasa-project-1/lib/python3.6/site-packages/sanic/app.py”, line 1133, in run serve(\*\*server\_settings) File “/home/gourab/rasa/rasa-project-1/lib/python3.6/site-packages/sanic/server.py”, line 885, in serve loop.run\_forever() File “/usr/lib/python3.6/asyncio/coroutines.py”, line 126, in send return self.gen.send(value) File “/home/gourab/rasa/rasa-project-1/lib/python3.6/site-packages/spf/framework.py”, line 512, in \_handle\_request stream\_callback) File “/usr/lib/python3.6/asyncio/coroutines.py”, line 110, in **next** return self.gen.send(None) File “/home/gourab/rasa/rasa-project-1/lib/python3.6/site-packages/sanic/app.py”, line 942, in handle\_request response = await response File “/usr/lib/python3.6/asyncio/coroutines.py”, line 110, in **next** return self.gen.send(None) File “/home/gourab/rasa/rasabot/MyIo.py”, line 106, in receive on\_new\_message(UserMessage(text, collector, sender\_id)) File “/usr/lib/python3.6/asyncio/coroutines.py”, line 85, in debug\_wrapper return CoroWrapper(gen, None) collector MSG:: \<rasa.core.channels.channel.CollectingOutputChannel object at 0x7f894167aeb8\> hi from name method

Now can you please help me why its showing the error, and how can I respond back to frond-end with not only just the string but also with some metadata like slotvalues, intent of the string etc…

---

<div class="post-metadata">

**Author:** ![grb25](https://avatars.discourse-cdn.com/v4/letter/g/bbe5ce/32.png) [@grb25](https://forum.rasa.com/u/grb25)\
**Post date:** [January 23, 2020, 9:15am UTC](https://forum.rasa.com/t/api-call-to-get-response/23783/7 "2020-01-23T09:15:13Z")

</div>

2020-01-23 13:34:06 ERROR asyncio - \<CoroWrapper register..handler() running at /home/gourab/rasa/rasa-project-1/lib/python3.6/site-packages/rasa/core/channels/channel.py:81, created at /usr/lib/python3.6/asyncio/coroutines.py:85\> was never yielded from Coroutine object created at (most recent call last, truncated to 10 last lines): File “/home/gourab/rasa/rasa-project-1/lib/python3.6/site-packages/rasa/core/run.py”, line 206, in serve\_application endpoints.lock\_store if endpoints else None File “/home/gourab/rasa/rasa-project-1/lib/python3.6/site-packages/sanic/app.py”, line 1133, in run serve(\*\*server\_settings) File “/home/gourab/rasa/rasa-project-1/lib/python3.6/site-packages/sanic/server.py”, line 885, in serve loop.run\_forever() File “/usr/lib/python3.6/asyncio/coroutines.py”, line 126, in send return self.gen.send(value) File “/home/gourab/rasa/rasa-project-1/lib/python3.6/site-packages/spf/framework.py”, line 512, in \_handle\_request stream\_callback) File “/usr/lib/python3.6/asyncio/coroutines.py”, line 110, in **next** return self.gen.send(None) File “/home/gourab/rasa/rasa-project-1/lib/python3.6/site-packages/sanic/app.py”, line 942, in handle\_request response = await response File “/usr/lib/python3.6/asyncio/coroutines.py”, line 110, in **next** return self.gen.send(None) File “/home/gourab/rasa/rasabot/MyIo.py”, line 106, in receive on\_new\_message(UserMessage(text, collector, sender\_id)) File “/usr/lib/python3.6/asyncio/coroutines.py”, line 85, in debug\_wrapper return CoroWrapper(gen, None)

I get this error as mentioned earlier

---

<div class="post-metadata">

**Author:** ![grb25](https://avatars.discourse-cdn.com/v4/letter/g/bbe5ce/32.png) [@grb25](https://forum.rasa.com/u/grb25)\
**Post date:** [January 23, 2020, 9:17am UTC](https://forum.rasa.com/t/api-call-to-get-response/23783/8 "2020-01-23T09:17:17Z")

</div>

I want to send these info to the API caller from front-end:

2020-01-23 13:35:24 DEBUG rasa.core.tracker\_store - Recreating tracker for id ‘Me1’ 2020-01-23 13:35:24 DEBUG rasa.core.processor - Received user message ‘flickering’ with intent ‘{‘name’: ‘issue\_provider’, ‘confidence’: 0.7306471467018127}’ and entities ‘[]’ 2020-01-23 13:35:24 DEBUG rasa.core.processor - Logged UserUtterance - tracker now has 19 events 2020-01-23 13:35:24 DEBUG rasa.core.policies.memoization - Current tracker state [None, None, None, {}, {‘prev\_action\_listen’: 1.0, ‘entity\_brand’: 1.0, ‘entity\_item’: 1.0, ‘intent\_details\_provider’: 1.0}] 2020-01-23 13:35:24 DEBUG rasa.core.policies.memoization - There is no memorised next action 2020-01-23 13:35:24 DEBUG rasa.core.policies.form\_policy - There is an active form ‘issue\_form’ 2020-01-23 13:35:24 DEBUG rasa.core.policies.ensemble - Predicted next action using policy\_3\_FormPolicy 2020-01-23 13:35:24 DEBUG rasa.core.processor - Predicted next action ‘issue\_form’ with confidence 1.00. 2020-01-23 13:35:24 DEBUG rasa.core.actions.action - Calling action endpoint to run action ‘issue\_form’. 2020-01-23 13:35:24 DEBUG rasa.core.processor - Action ‘issue\_form’ ended with events ‘[‘BotUttered(text: Is the problem in the entire screen or only in parts of it?, data: {“elements”: null, “quick\_replies”: null, “buttons”: [{“payload”: “entire”, “title”: “entire”}, {“payload”: “left-side”, “title”: “left-side”}, {“payload”: “right-side”, “title”: “right-side”}, {“payload”: “top-part”, “title”: “top-part”}, {“payload”: “bottom-part”, “title”: “bottom-part”}, {“payload”: “center”, “title”: “center”}], “attachment”: null, “image”: null, “custom”: null}, metadata: {“brand”: “acer”, “issue\_nature”: “flickering”, “item”: “laptop”, “part”: “screen”, “requested\_slot”: “issue\_nature”})’, ‘SlotSet(key: issue\_nature, value: flickering)’, ‘SlotSet(key: requested\_slot, value: issue\_location)’]’ 2020-01-23 13:35:24 DEBUG rasa.core.processor - Current slot values: brand: acer issue\_duration: None issue\_location: None issue\_nature: flickering item: laptop part: screen requested\_slot: issue\_location

---

<div class="post-metadata">

**Author:** ![grb25](https://avatars.discourse-cdn.com/v4/letter/g/bbe5ce/32.png) [@grb25](https://forum.rasa.com/u/grb25)\
**Post date:** [January 23, 2020, 9:34am UTC](https://forum.rasa.com/t/api-call-to-get-response/23783/9 "2020-01-23T09:34:07Z")

</div>

there is no method called send\_message in that link…

---

<div class="post-metadata">

**Author:** ![amn41](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/amn41/32/20_2.png) [@amn41](https://forum.rasa.com/u/amn41)\
**Post date:** [January 23, 2020, 4:22pm UTC](https://forum.rasa.com/t/api-call-to-get-response/23783/10 "2020-01-23T16:22:17Z")

</div>

my mistake, you want to override the method in the `OutputChannel` [rasa/channel.py at master · RasaHQ/rasa · GitHub](https://github.com/RasaHQ/rasa/blob/master/rasa/core/channels/channel.py#L160)

---

<div class="post-metadata">

**Author:** ![FSamina](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/fsamina/32/14675_2.png) [@FSamina](https://forum.rasa.com/u/FSamina)\
**Post date:** [May 11, 2021, 4:31pm UTC](https://forum.rasa.com/t/api-call-to-get-response/23783/11 "2021-05-11T16:31:35Z")

</div>

Hello, I was trying to implement this (add intent and entity information to the rest response). However, we did not find any send\_message function, only send\_response (part of the OutputChannel class), which doesn’t look suitable for getting this additional info, since there is only a message: Dict[Text, Any] that does not include metadata (intents, entities,…).

Example: {‘elements’: None, ‘quick\_replies’: None, ‘buttons’: None, ‘attachment’: None, ‘image’: None, ‘custom’: {‘answers’: [{‘ssml’: ‘Farewell! Have a great day!’, ‘type’: ‘ssml’}, {‘text’: ‘Farewell! Have a great day!’, ‘type’: ‘html’}]}, ‘text’: None, ‘timestamp’: 1620744219.7953184}

---

<div class="post-metadata">

**Author:** ![abhi](https://avatars.discourse-cdn.com/v4/letter/a/b487fb/32.png) [@abhi](https://forum.rasa.com/u/abhi)\
**Post date:** [September 13, 2021, 8:17pm UTC](https://forum.rasa.com/t/api-call-to-get-response/23783/12 "2021-09-13T20:17:12Z")

</div>

Were you able to find a way to find a way to include metadata?
