# Accessing RASA NLU only server from python code using API

**URL:** <https://forum.rasa.com/t/accessing-rasa-nlu-only-server-from-python-code-using-api/51126>\
**Category:** Feedback on Rasa Open Source\
**Tags:** community\
**Created:** [February 4, 2022, 9:03am UTC](https://forum.rasa.com/t/accessing-rasa-nlu-only-server-from-python-code-using-api/51126 "2022-02-04T09:03:13Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![sandeeppandey456](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/sandeeppandey456/32/17527_2.png) [@sandeeppandey456](https://forum.rasa.com/u/sandeeppandey456)\
**Post date:** [February 4, 2022, 9:03am UTC](https://forum.rasa.com/t/accessing-rasa-nlu-only-server-from-python-code-using-api/51126/1 "2022-02-04T09:03:13Z")

</div>

I want to use Rasa NLU server only for my custom dialogue management , which is written in a python code. For that i want to post messages to the nlu server and get the intent rankings. I tried -

```auto
text=str(input("Enter the message"))
payload = json.dumps({"sender": "Rasa","message": text})
headers = {'content-type': 'application/json'}
response = requests.request("POST",'http://10.101.1.239:5005/model/parse', json=payload, headers=headers)
response = response.json()
print("response :\n",response)

```

However it throws an error, -

> response : {‘version’: ‘2.8.18’, ‘status’: ‘failure’, ‘message’: ‘An unexpected error occurred. Error: string indices must be integers’, ‘reason’: ‘ParsingError’, ‘details’: {}, ‘help’: None, ‘code’: 500}

But if the payload is -

```auto
payload = {'text':'hi how are you?'}
headers = {'content-type': 'application/json'}
r = requests.post('http://10.101.1.239:5005/model/parse', json=payload, headers=headers)

```

then i get the list of intent rankings properly.

The sender id is necessary as I am trying to manage dialogues externally through my code. Please help

---

_[View the full topic](https://forum.rasa.com/t/accessing-rasa-nlu-only-server-from-python-code-using-api/51126)._
