# Webchat Custom Data

**URL:** <https://forum.rasa.com/t/webchat-custom-data/4757>\
**Category:** Rasa Open Source\
**Created:** [January 30, 2019, 1:57am UTC](https://forum.rasa.com/t/webchat-custom-data/4757 "2019-01-30T01:57:00Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![rappix](https://avatars.discourse-cdn.com/v4/letter/r/f07891/32.png) [@rappix](https://forum.rasa.com/u/rappix)\
**Post date:** [January 30, 2019, 1:57am UTC](https://forum.rasa.com/t/webchat-custom-data/4757/1 "2019-01-30T01:57:00Z")

</div>

Hello everyone, I am new at Rasa. Could someone help me with sending custom data from WebChat to custom actions.py? Let say for example, I want to send bot\_id to actions, and depending on bot\_id to format the answer from 3rd party API. I appreciate any help.

WebChat.default.init({ selector: “#webchat”, initPayload: “/greet”, interval: 500, socketUrl: “[https://domain.com/](https://domain.com/)”, socketPath: “/socket.io”, customData: {“bot\_id”: “123456879”}, title: “Sara”, subtitle: “I’m still in development”, profileAvatar: “[https://rasa.com/assets/img/demo/sara\_avatar.png](https://rasa.com/assets/img/demo/sara_avatar.png)”, showCloseButton: true, fullScreenMode: false, params: { storage: “local” }})

---

<div class="post-metadata">

**Author:** ![suryateja](https://avatars.discourse-cdn.com/v4/letter/s/dec6dc/32.png) [@suryateja](https://forum.rasa.com/u/suryateja)\
**Post date:** [March 4, 2019, 6:51am UTC](https://forum.rasa.com/t/webchat-custom-data/4757/2 "2019-03-04T06:51:47Z")

</div>

I too am stuck here. Did you find the solution for passing Custom Data to actions.py . @rappix. I would really appreciate any kind of information.

---

<div class="post-metadata">

**Author:** ![rappix](https://avatars.discourse-cdn.com/v4/letter/r/f07891/32.png) [@rappix](https://forum.rasa.com/u/rappix)\
**Post date:** [March 4, 2019, 1:54pm UTC](https://forum.rasa.com/t/webchat-custom-data/4757/3 "2019-03-04T13:54:56Z")

</div>

Hi @suryateja. I found a solution for this case. I am creating sender\_id manually, which is in format bot\_id+random\_string. Then on my backend in actions controller, I get bot\_id from sender\_id.

---

<div class="post-metadata">

**Author:** ![suryateja](https://avatars.discourse-cdn.com/v4/letter/s/dec6dc/32.png) [@suryateja](https://forum.rasa.com/u/suryateja)\
**Post date:** [March 5, 2019, 5:57am UTC](https://forum.rasa.com/t/webchat-custom-data/4757/4 "2019-03-05T05:57:34Z")

</div>

Thanks for the reply … 🙂 @rappixIn my case ,I have generated a unique\_ID for each user ,using the chatbot .Do you know, how can I change sender\_id dynamically according to the different user talking to out bot. i.e , I need to add unique\_ID of user to sender\_ID dynamically.

---

<div class="post-metadata">

**Author:** ![rappix](https://avatars.discourse-cdn.com/v4/letter/r/f07891/32.png) [@rappix](https://forum.rasa.com/u/rappix)\
**Post date:** [March 5, 2019, 2:19pm UTC](https://forum.rasa.com/t/webchat-custom-data/4757/5 "2019-03-05T14:19:49Z")

</div>

Just use javascript to create sender\_id and save it in cookie. That way you can also use RASA built-in API to retrieve conversation history for current user.

---

<div class="post-metadata">

**Author:** ![soundaraj](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/soundaraj/32/2123_2.png) [@soundaraj](https://forum.rasa.com/u/soundaraj)\
**Post date:** [September 23, 2019, 7:34am UTC](https://forum.rasa.com/t/webchat-custom-data/4757/6 "2019-09-23T07:34:47Z")

</div>

please give me the sample code

---

<div class="post-metadata">

**Author:** ![siva\_g](https://avatars.discourse-cdn.com/v4/letter/s/a698b9/32.png) [@siva\_g](https://forum.rasa.com/u/siva_g)\
**Post date:** [June 11, 2020, 12:47pm UTC](https://forum.rasa.com/t/webchat-custom-data/4757/7 "2020-06-11T12:47:14Z")

</div>

Hi,

please try this [solution](http://forum.rasa.com/t/rasa-webchat-integration/19930/9) will help for custom data using socket
