Outgoing Action

  • It is stored in the context variable $outgoing_action.

  • Aside from messages, actions can also be sent by the chatbot.

  • Actions can be used for triggering certain events within Conversational Hub

Types of outgoing action

  1. Normal - sending specific actions to Conversational Hub.

    • type - set type property to β€œnormal”

    • action - set action property to any value.

Developers are free to define their own list of outgoing_action. These are ways for chatbot developers to send signals with frontend developers. In e.g. web widgets , channels and custom channels.

Example use cases

  1. You want to popup a google maps modal in the parent website whenever the user says. I want a map

While on the frontend You ask the developer to implement this.

2. Redirect user to another page

While on the frontend you ask the developer to implement this

There are many use cases and it is up to the developers to maximize and use this feature that was made possible through Captivate Hub

It is to be noted that we will be migrating outgoing_action format to be in parity with incoming_action format. This means that instead of just having action as property. We will replace it with id and data. Next update will have this kind of format.

This will allow more flexibility in sending actions outside the bot. Allowing to send object data throughout the backend of CH and frontend

Reserved actions

  1. Escalate to Human - This action triggers the escalation of the conversation between the user and agent.

    • set action to β€œescalateToHuman”

2. Get Location - This action gets the current location of the user.

  • Initialize $getLocation context variable in Watson Assistant.

  • In $getLocation variable, field, storeTo and done properties are required.

    • field - property where the location will be stored.

    • storeTo - object where the location will be stored.

    • done - value to be set to $incoming_action.id to check if get location action is completed.

    • Trigger get location by setting $outgoing_action context variable to {β€œtype”:”normal”,”action”:”getLocation”}

    • Once location is received, access the location in $formdata context variable. Location variable will be stored on $formdata.userInfoForm.location for this example. ($formdata..)

2. API Call – action for sending API calls.

  • type - set type property to β€œapiCall”

  • url - set url property to the link you will send the request to

  • authentication - set authentication property for any authentication needed.

  • cookies - set cookies property to add cookies as part of the request.

  • method - set method property for the request type such as β€œGET” and β€œPOST”

  • data - set data property to be sent as part of the body of a POST request, only applicable when the method is set to β€œPOST”.

  • result - set result property to be the variable name which contains the response.

  • done - set done property to be the value set to $incoming_action.id when the API call is successful. If the done property is set to β€œcallDone”, after the API call, $incoming_action.id will be set to β€œcallDone”.

This should not be confused with Watson's own action invoke which calls cloud functions in IBM cloud. While both achieve the same feat. Captivate's own webhook is more diverse as you can freely use it directly and you will not be just limited to IBM Cloud functions. It is also a consistent format across all future NLP integrations in our roadmap. So it will have the same format as using LUIS or any other chatbot vendor

File Upload - uploading files or images on Conversational Hub

  • Set your $getFileUpload context variable.

  • field and storeTo properties are required.

    • field - property where the file/s are stored.

    • storeTo - object where the file/s are stored.

  • Upon upload of files, the files will be accessible at $formdata..[index].

  • For this example, files are accessible on $formdata.form1.file[0], Index 0 for the first file. Index 1 for the second file if available.

Send transcript - send transcript to user.

  • idChat, name and email are required.

    • idchat - conversation ID.

    • name - user's name.

    • email - user's email.

  • The transcript will be sent to the email provided by the user.

Last updated