Question about running External Events in Rasa X/Callback Input

Hi everyone, I am not able to run my chatbot with External Events via Rasa X or Callback Input. I have two questions:

  1. Could you tell if I can run chatbot with External Events (Reaching Out to the User) in Rasa X local mode or do I need to add Rasa X on the server?
  2. Do I need to add my chatbot to an existing website or server to run my assistant with External Events via Callback Input?

Thanks in advance

You should be able to trigger an external event with Rasa X in local mode, you just need to make sure you have the endpoint defined and that that event can hit that endpoint.

Is it working only in the command line and not in Rasa X? If so, that sounds like it might be a bug.

Thanks for your response.

I’m afraid that after running rasa x command I can’t properly run this post request:

curl -H "Content-Type: application/json" -X POST -d \

'{"name": "EXTERNAL_dry_plant", "entities": {"plant": "Orchid"}}' \

"http://localhost:5005/conversations/user1234/trigger_intent?output_channel=latest"

I really don’t know how to hit localhost5005 with this post request. Could you provide some info on how to run post request?

Not sure where you’re getting stuck, so apologies if any of this is reception for you.

Start by launching a rasa server using rasa run and take note of the line of output that looks like “INFO root - Starting Rasa server on http://localhost:5005”. (If you’re using an action server an action server in a different terminal window using rasa run actions).

From there open another terminal you should be able to do something like curl localhost:5005 and get the message back “Hello from Rasa: [version number]”. If that works then try the full curl command & see if the POST request is going through.

Hi, curl http://localhost:5005 went good but after running curls from rasa/examples/reminderbot at master · RasaHQ/rasa · GitHub and Reaching Out to the User I got following errors:

(env) PS E:\dev\project007\pro007> curl http://localhost:5005

StatusCode        : 200
StatusDescription : OK
Content           : Hello from Rasa: 2.0.3
RawContent        : HTTP/1.1 200 OK
                    Access-Control-Expose-Headers: filename
                    Access-Control-Allow-Credentials: true
                    Connection: keep-alive
                    Keep-Alive: 5
                    Content-Length: 22
                    Content-Type: text/plain; charset=utf-8

                    ...
Headers           : {[Access-Control-Expose-Headers, filename], [Access-Control-Allow-Credentials, true], [Connection, keep-alive], [Keep-Alive, 5]...}
Images            : {}
InputFields       : {}
Links             : {}
ParsedHtml        : System.__ComObject
RawContentLength  : 22


(env) PS E:\dev\project007\pro007> curl -H "Content-Type: application/json" -X POST -d \
Invoke-WebRequest : Cannot bind parameter 'Headers'. Cannot convert the "Content-Type: application/json" value of type "System.String" to type "System.Collecti 
ons.IDictionary".
At line:1 char:9
+ curl -H "Content-Type: application/json" -X POST -d \
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [Invoke-WebRequest], ParameterBindingException
 
(env) PS E:\dev\project007\pro007> '{"name": "EXTERNAL_dry_plant", "entities": {"plant": "Orchid"}}' \
At line:1 char:67
+ '{"name": "EXTERNAL_dry_plant", "entities": {"plant": "Orchid"}}' \
+                                                                   ~
Unexpected token '\' in expression or statement.
    + CategoryInfo          : ParserError: (:) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : UnexpectedToken
 
(env) PS E:\dev\project007\pro007> "http://localhost:5005/conversations/b3aaaf43c7314a28a85b3addfd897c00/trigger_intent?output_channel=latest"
http://localhost:5005/conversations/b3aaaf43c7314a28a85b3addfd897c00/trigger_intent?output_channel=latest
(env) PS E:\dev\project007\pro007> curl -XPOST http://localhost:5005/webhooks/callback/webhook \
Invoke-WebRequest : A parameter cannot be found that matches parameter name 'XPOST'.
At line:1 char:6
+ curl -XPOST http://localhost:5005/webhooks/callback/webhook \
+      ~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [Invoke-WebRequest], ParameterBindingException
    + FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.PowerShell.Commands.InvokeWebRequestCommand
(env) PS E:\dev\project007\pro007>    -d '{"sender": "tester", "message": "hello"}' \
-d : The term '-d' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was incl 
uded, verify that the path is correct and try again.
At line:1 char:4
+    -d '{"sender": "tester", "message": "hello"}' \
+    ~~
    + CategoryInfo          : ObjectNotFound: (-d:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException
 
(env) PS E:\dev\project007\pro007>    -H "Content-type: application/json"
-H : The term '-H' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was incl
uded, verify that the path is correct and try again.
At line:1 char:4
+    -H "Content-type: application/json"
+    ~~
    + CategoryInfo          : ObjectNotFound: (-H:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

Also when I clicked on http://localhost:5005/conversations/b3aaaf43c7314a28a85b3addfd897c00/trigger_intent?output_channel=latest I got: 405 — Method Not Allowed

Method GET not allowed for URL /conversations/b3aaaf43c7314a28a85b3addfd897c00/trigger_intent

It looks like you left off the -X POST from the curl command because error shows you issued a GET instead of a POST.

(env) PS E:\dev\project007\pro007> curl -XPOST http://localhost:5005
Invoke-WebRequest : A parameter cannot be found that matches parameter name 'XPOST'.
At line:1 char:6
+ curl -XPOST http://localhost:5005
+      ~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [Invoke-WebRequest], ParameterBindingException
 
(env) PS E:\dev\project007\pro007> curl -XPOST http://localhost:5005/webhooks/callback/webhook
Invoke-WebRequest : A parameter cannot be found that matches parameter name 'XPOST'.
At line:1 char:6
+ curl -XPOST http://localhost:5005/webhooks/callback/webhook
+      ~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [Invoke-WebRequest], ParameterBindingException
    + FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.PowerShell.Commands.InvokeWebRequestCommand

I got this

It seems that I must have a problem with triggering an intent vide Reaching Out to the User and I am not able to post request to inject the intent so I will start a new Topic.

Hi, you have the solution of this problem? Could you kindly share it? I have the same problem. Thanks

1 Like

Second that. Any solution?

I can’t get past a “Expecting value: line 1 column 1 (char 0)” error.