# Using API with deployed Rasa X

**URL:** <https://forum.rasa.com/t/using-api-with-deployed-rasa-x/47620>\
**Category:** Rasa Open Source\
**Created:** [September 9, 2021, 7:58pm UTC](https://forum.rasa.com/t/using-api-with-deployed-rasa-x/47620 "2021-09-09T19:58:56Z")\
**Posts on this page:** 12\
**Page:** 1

<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 9, 2021, 7:58pm UTC](https://forum.rasa.com/t/using-api-with-deployed-rasa-x/47620/1 "2021-09-09T19:58:56Z")

</div>

Hi!

I am trying to hit the API endpoint in order to have a conversation with my bot with a given message and conversation ID.

When I am running on my local machine, I can send a `POST` to `http://localhost:5005/webhooks/rest/webhook` .

The deployed version is at a different url such as `https://rasa-x.com:8000`. If I want to hit the API where this is deployed I am trying `https://rasa-x.com:8000/webhooks/rest/webhook` and sending the same payload:

```auto
{
    "sender":"test1",
    "message":"thanks"
}

```

I am getting a 404 error with this. I feel as if I am making a very small mistake here but I can’t seem to figure it out. Any idea why this isn’t working?

Thank you!

---

<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:** [September 9, 2021, 8:05pm UTC](https://forum.rasa.com/t/using-api-with-deployed-rasa-x/47620/2 "2021-09-09T20:05:45Z")

</div>

Hello!

What method did you use to deploy? Docker or Helm?

Have you tried sending the object to `rasa-x.com/webhooks/rest/webhook` (without the port)?

---

<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 9, 2021, 8:15pm UTC](https://forum.rasa.com/t/using-api-with-deployed-rasa-x/47620/3 "2021-09-09T20:15:20Z")

</div>

I used Helm. And yes I tried it with and without the port number. If I use the port number, I get a 404 saying not found, and for without the port number, it says that the request timed out.

---

<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:** [September 9, 2021, 8:21pm UTC](https://forum.rasa.com/t/using-api-with-deployed-rasa-x/47620/4 "2021-09-09T20:21:53Z")

</div>

Can you show me your `values.yml`?

Or, if you use Quick-Install, try to do in the shell:

```auto
export ADDITIONAL_CHANNEL_CREDENTIALS="rest=''"
curl -s get-rasa-x.rasa.com | sudo -E bash

```

---

<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 9, 2021, 8:34pm UTC](https://forum.rasa.com/t/using-api-with-deployed-rasa-x/47620/5 "2021-09-09T20:34:53Z")

</div>

Sure no problem. And thanks again for the help!

```auto
rasax:
  initialUser:
    username: "abhi"
    password: "#{RasaXPassword}"
  passwordSalt: "#{RasaXPasswordSalt}"
  token: "#{RasaXToken}"
  jwtSecret: "#{RasaXJwtSecret}"
  livenessProbe:
    initialProbeDelay: 30
  readinessProbe:
    initialProbeDelay: 30
eventService:
  databaseName: "#{Postgres:Database}"
rasa:
  token: "#{RasaToken}"
  versions:
    rasaProduction:
      trackerDatabase: "#{Postgres:RasaProduction}"
    rasaWorker:
      trackerDatabase: "#{Postgres:RasaWorker}"
rabbitmq:
  rabbitmq:
    password: "#{RabbitMqPassword}"
postgresql:
  install: false
  existingHost: "#{Postgres:Host}"
  existingSecretKey: "postgresql-password"
global:
  redis:
    password: "#{RedisPassword}"
  postgresql:
    postgresqlUsername: "#{Postgres:Username}"
    existingSecret: "external-postgres"
    postgresqlDatabase: "#{Postgres:Database}"
debugMode: "#{RasaDebugMode}"

```

---

<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:** [September 9, 2021, 8:46pm UTC](https://forum.rasa.com/t/using-api-with-deployed-rasa-x/47620/6 "2021-09-09T20:46:20Z")

</div>

Try to set the following (last 2 lines) and [upgrade the deployment](https://stackoverflow.com/questions/48927233/updating-kubernetes-helm-values) with the modified values:

```auto
rasa:
  token: "#{RasaToken}"
  versions:
    rasaProduction:
      trackerDatabase: "#{Postgres:RasaProduction}"
    rasaWorker:
      trackerDatabase: "#{Postgres:RasaWorker}"
  additionalChannelCredentials:
      rest:

```

---

<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 9, 2021, 9:05pm UTC](https://forum.rasa.com/t/using-api-with-deployed-rasa-x/47620/7 "2021-09-09T21:05:40Z")

</div>

Ok great. I will try that and let you know!

---

<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 10, 2021, 4:31pm UTC](https://forum.rasa.com/t/using-api-with-deployed-rasa-x/47620/8 "2021-09-10T16:31:50Z")

</div>

That fixed the issue I was having! Thank you for your help!

I do have one other question! I am currently using a custom entity extraction component where the component is in the same working directory as the config file and called `communication_preference.py`.

However, when the project is being deployed, the logs show an exception where the module cannot be found.

This is the error that is logged:

```auto
Traceback (most recent call last):
  File "/opt/venv/lib/python3.8/site-packages/rasa/nlu/registry.py", line 121, in get_component_class
    return rasa.shared.utils.common.class_from_module_path(component_name)
  File "/opt/venv/lib/python3.8/site-packages/rasa/shared/utils/common.py", line 37, in class_from_module_path
    m = importlib.import_module(module_name)
  File "/usr/lib/python3.8/importlib/ __init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 973, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'communication_preference'

```

When I train on my local machine, the module is found and everything works great, but when deployed using Helm, this issue pops up. I’m assuming the module isn’t being added to the PATH but I am not sure how to go about doing this.

Thank you!

---

<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:** [September 11, 2021, 10:32am UTC](https://forum.rasa.com/t/using-api-with-deployed-rasa-x/47620/9 "2021-09-11T10:32:51Z")

</div>

Glad to know I helped 🙂 Can you mark my answer as solution to show the topic as solved?

As for your other problem, sorry I’m not sure how to solve it, I would need more details. Please create a new thread for that since it’s unrelated, more people would read the topic if it is new, and it will appear in search results if anyone has the same problem in the future.

---

<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 14, 2021, 12:28am UTC](https://forum.rasa.com/t/using-api-with-deployed-rasa-x/47620/10 "2021-09-14T00:28:19Z")

</div>

So it turns out, this didn’t completely solve the issue I was having. As I continue testing it, I found that I am not able to hit other Rest endpoints like I was locally. For example, I am attempting to use a GET request to get the conversations tracker. I do a request to

`rasa-x.com:8000/conversations/TrackerTest/tracker`

But when I do, I get back an html response and a 200 code. This is weird b/c it should be a json with a tracker object. Are there any other changes i need to make to the values.yml that I haven’t alread?

Thanks!

---

<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:** [September 14, 2021, 7:52am UTC](https://forum.rasa.com/t/using-api-with-deployed-rasa-x/47620/11 "2021-09-14T07:52:41Z")

</div>

Actually, I remember having problems with that endpoint as well, even in Local Mode. I figured I wasn’t using it correctly and never thought about it again since I didn’t need it.

Did this endpoint work locally for you?

---

<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 14, 2021, 1:08pm UTC](https://forum.rasa.com/t/using-api-with-deployed-rasa-x/47620/12 "2021-09-14T13:08:27Z")

</div>

Gotcha. Yes, I’ve used that end point locally quite a bit to get the tracker object. I send a GET request at:

```auto
http://localhost:5005/conversations/testid/tracker

```

It’s always worked when I did that, so that is odd.
