# How to set slots when sending data from an API to the bot

**URL:** <https://forum.rasa.com/t/how-to-set-slots-when-sending-data-from-an-api-to-the-bot/51594>\
**Category:** Rasa Open Source\
**Created:** [February 27, 2022, 3:50am UTC](https://forum.rasa.com/t/how-to-set-slots-when-sending-data-from-an-api-to-the-bot/51594 "2022-02-27T03:50:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![vmanthena](https://avatars.discourse-cdn.com/v4/letter/v/7bcc69/32.png) [@vmanthena](https://forum.rasa.com/u/vmanthena)\
**Post date:** [February 27, 2022, 3:50am UTC](https://forum.rasa.com/t/how-to-set-slots-when-sending-data-from-an-api-to-the-bot/51594/1 "2022-02-27T03:50:18Z")

</div>

We are trying to send entities with a payload like

```auto
{"sender": "12345", "message": "/greet{'language': 'en'}"}

```

but the entities/slots are not getting set. Can you please help us with the same.

Endpoint : `https://127.0.0.1:8443/webhooks/rest/webhook`

Error:

```auto
/opt/venv/lib/python3.8/site-packages/rasa/shared/utils/io.py:99: UserWarning: **Failed to parse arguments in line '/greet{'language': 'en'}'. Failed to decode parameters as a json object (dict).** Make sure the intent is followed by a proper json object (dict). Continuing without entities. Error: Expecting property name enclosed in double quotes: line 1 column 2 (char 1)
  More info at https://rasa.com/docs/rasa/stories

```

Domain.yml file:

```auto
version: "3.0"
config:
  store_entities_as_slots: true
intents:
  - greet
  - goodbye
  - affirm
  - deny
  - mood_great
  - mood_unhappy
  - bot_challenge
  - enter_intent
actions:
  - action_hello_world
  - action_extract_input_text
  - utter_cheer_up
  - action_get_faq
  - action_greet_message
  - action_check_agent
  - action_agent_transfer_confirm
  - action_perform_agent_transfer

entities:
  - language
  - country
  - account_number
  - survey

slots:
  language:
    type: text
    mappings:
    - type: custom

Stories.yml file: 

version: "3.0"

stories:

- story: FAQ Search + Don't need more help with FAQ
  steps:
  - intent: greet
  - action: utter_survey_affirm
  - intent: enter_intent
  - action: action_get_faq
  - intent: affirm
  - action: utter_survey_affirm

```

---

<div class="post-metadata">

**Author:** ![ChrisRahme](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/chrisrahme/32/15572_2.png) [@ChrisRahme](https://forum.rasa.com/u/ChrisRahme)\
**Post date:** [February 27, 2022, 8:27am UTC](https://forum.rasa.com/t/how-to-set-slots-when-sending-data-from-an-api-to-the-bot/51594/3 "2022-02-27T08:27:06Z")

</div>

JSON requires double quotes. Try this:

```json
{"sender": "12345", "message": "/greet{\"language\": \"en\"}"}

```

---

<div class="post-metadata">

**Author:** ![vmanthena](https://avatars.discourse-cdn.com/v4/letter/v/7bcc69/32.png) [@vmanthena](https://forum.rasa.com/u/vmanthena)\
**Post date:** [February 28, 2022, 5:32pm UTC](https://forum.rasa.com/t/how-to-set-slots-when-sending-data-from-an-api-to-the-bot/51594/4 "2022-02-28T17:32:26Z")

</div>

Thanks. I have update it and also had to update the slot mapping to “from\_enity”. Thanks !!!
