Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

As an admin user, you can load a different flow studio flow based on the webpage the chatbot user launches the chatbot from. This document will brief you on how to use the URL

...

Parameters and

...

Query Strings in your Experience Designer flows.

Image Added
Table of Contents
exclude

You can use the params and queries passed from the chatbot URL to customize your flow in the Experience Designer.

Table of Contents
excludeRelated Articles

For example, you can initiate the flow studio based on the flowId passed in the chatbot URL.

Related Articles

URL Parameter

Defining a URL Parameter

You should first define a variable in URL/Endpoint fields of the http in nodes and the Bot View Template node.

<chatbot endpoint>/:<variable-name>

Image Added
Image Added
Image Added

The URL Parameter used in the chatbot URL will be available at msg.req.params.<variable-name>

In the Bot In Parser of the Bot Provider V2 Node, you should assign the fetched URL Parameter to the originalRequest object.

Code Block
msg.payload.originalRequest.data.<userPARAM> = msg.req.params.<variable-name>;
Image Added

Using the URL Parameter

You can then obtain the URL Parameter in the msg object at msg.payload.originalDetectIntentRequest.payload.<userdefined variable>

Invoking the Chatbot with the URL parameter

You can add any string as the URL Parameter to the Chatbot URL.

https://<domain-name>.orbita.cloud:8443/oeapi/<ChatbotURI>/<URL Parameter>

For example, you can use the https://<domain-name>.orbita.cloud:8443/oeapi/<ChatbotURI>/button to invoke the corresponding flow studio flow.

Warning

If you have defined a URL Parameter, you cannot load the chatbot without a URL Parameter.

Query strings

Defining a query parameter

The query params used in the chatbot URL will be available at msg.req.query.

...

<query parameter>

In the Bot In Parser of the Bot Provider V2 Node, you should assign the fetched Query to the originalRequest object.

In this example, we are assigning the obtained flowId to the originalRequest object.

Code Block
msg.payload.originalRequest.data.

...

<userdefined variable>=msg.req.query.

...

<query parameter>;

...

Image Added

Using the query

You can then obtain the Query value in the msg object at msg.payload.originalDetectIntentRequest.payload.

...

In this example, we will assign the flowId to msg.payload.flowId in the function node connected to the Flow Manager node in the Experience Designer.

...

<userdefined variable>

Invoking the Chatbot with the query parameter

You can add the query parameter to the Chatbot URL.

https://<domain-name>.orbita.cloud:8443/oeapi/<ChatbotURI>?<queryparameter>=

...

<query value>

...

For example, you can use

...

...

Import the flow attached to this document.

Note

After importing the

...

flow, ensure you do the following:

  1. Disable any other Bot Manager flows you have

...

  1. in the project.

    1. Doubleclick on the Bot Manager flow tab.

    2. Set the status to “Disabled“.

      Image Added
  2. Delete the launch node in the Launch flow.

Attachments
previewfalse
oldfalse
patterns.*json

Related Articles

Filter by label (Content by label)
showLabelsfalse
max5
showSpacefalse
cqllabel in ( "chatbot" , "experience-designer" )