# How to send metadata (extra info) in Restful api bot response (bot side)?

**URL:** <https://forum.rasa.com/t/how-to-send-metadata-extra-info-in-restful-api-bot-response-bot-side/21681>\
**Category:** Rasa Open Source\
**Created:** [November 25, 2019, 12:53pm UTC](https://forum.rasa.com/t/how-to-send-metadata-extra-info-in-restful-api-bot-response-bot-side/21681 "2019-11-25T12:53:37Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![taguhi](https://avatars.discourse-cdn.com/v4/letter/t/41988e/32.png) [@taguhi](https://forum.rasa.com/u/taguhi)\
**Post date:** [November 25, 2019, 12:53pm UTC](https://forum.rasa.com/t/how-to-send-metadata-extra-info-in-restful-api-bot-response-bot-side/21681/1 "2019-11-25T12:53:37Z")

</div>

What is an optimal way of **sending extra information (metadata) in the response message** (from bot side) in restful api (webhooks/rest/webhook).

To be clear, I want to send some metadata along with the form question (and every other bot utterance) so that the mobile side could know how to configure the interface based on that info.

For example, now the response has the following structure:

```json
[
    {
        "recipient_id": "1",
        "text": "What color do you prefer?"
    }
]

```

But I would like it to be like this:

```json
[
    {
        "recipient_id": "1",
        "text": "What color do you prefer?",
        "type": "color_question" 
    }
]

```

Are there any implemented ways for doing this?

Any ideas?"

---

<div class="post-metadata">

**Author:** ![JiteshGaikwad](https://avatars.discourse-cdn.com/v4/letter/j/77aa72/32.png) [@JiteshGaikwad](https://forum.rasa.com/u/JiteshGaikwad)\
**Post date:** [November 25, 2019, 1:21pm UTC](https://forum.rasa.com/t/how-to-send-metadata-extra-info-in-restful-api-bot-response-bot-side/21681/2 "2019-11-25T13:21:34Z")

</div>

Hey @taguhi, you can send the metadata using utter\_custom\_method. Check this out, it may help you:

[Restaurant-Search-Bot/actions.py at bcc069e2d10b71ae78f0989484373e43ca70cc65 · JiteshGaikwad/Restaurant-Search-Bot · GitHub](https://github.com/JiteshGaikwad/Restaurant-Search-Bot/blob/bcc069e2d10b71ae78f0989484373e43ca70cc65/actions.py#L114)

---

<div class="post-metadata">

**Author:** ![taguhi](https://avatars.discourse-cdn.com/v4/letter/t/41988e/32.png) [@taguhi](https://forum.rasa.com/u/taguhi)\
**Post date:** [November 25, 2019, 3:55pm UTC](https://forum.rasa.com/t/how-to-send-metadata-extra-info-in-restful-api-bot-response-bot-side/21681/3 "2019-11-25T15:55:06Z")

</div>

Thanks for the response @JiteshGaikwad.

I looked it through but there is still one problem. I have a form action and there is nowhere to manually write `dispatcher.utter_custom_json({"payload": "something"})` line. I would like my form action to send specific payloads with each question in the form.

Is there a way to include it in domain.yml file?

---

<div class="post-metadata">

**Author:** ![taguhi](https://avatars.discourse-cdn.com/v4/letter/t/41988e/32.png) [@taguhi](https://forum.rasa.com/u/taguhi)\
**Post date:** [November 25, 2019, 4:31pm UTC](https://forum.rasa.com/t/how-to-send-metadata-extra-info-in-restful-api-bot-response-bot-side/21681/4 "2019-11-25T16:31:00Z")

</div>

Well I guess I found the answer here [Domains](https://rasa.com/docs/rasa/core/domains/#custom-output-payloads)

---

<div class="post-metadata">

**Author:** ![JiteshGaikwad](https://avatars.discourse-cdn.com/v4/letter/j/77aa72/32.png) [@JiteshGaikwad](https://forum.rasa.com/u/JiteshGaikwad)\
**Post date:** [November 25, 2019, 4:32pm UTC](https://forum.rasa.com/t/how-to-send-metadata-extra-info-in-restful-api-bot-response-bot-side/21681/5 "2019-11-25T16:32:06Z")

</div>

Hey @taguhi, check out this:

> <https://github.com/JiteshGaikwad/Restaurant-Search-Bot/blob/bcc069e2d10b71ae78f0989484373e43ca70cc65/domain.yml#L50>

---

<div class="post-metadata">

**Author:** ![taguhi](https://avatars.discourse-cdn.com/v4/letter/t/41988e/32.png) [@taguhi](https://forum.rasa.com/u/taguhi)\
**Post date:** [November 25, 2019, 4:39pm UTC](https://forum.rasa.com/t/how-to-send-metadata-extra-info-in-restful-api-bot-response-bot-side/21681/6 "2019-11-25T16:39:05Z")

</div>

Thanks! It worked.

---

<div class="post-metadata">

**Author:** ![taguhi](https://avatars.discourse-cdn.com/v4/letter/t/41988e/32.png) [@taguhi](https://forum.rasa.com/u/taguhi)\
**Post date:** [November 25, 2019, 4:51pm UTC](https://forum.rasa.com/t/how-to-send-metadata-extra-info-in-restful-api-bot-response-bot-side/21681/7 "2019-11-25T16:51:16Z")

</div>

@JiteshGaikwad I’m sorry, one more question 🙂

I didn’t find anywhere in the documentation about the difference between elements and payloads. When to use which one?
