Utilize Action Method V2
    • PDF

    Utilize Action Method V2

    • PDF

    Article Summary

    Action Method V2.0 User Guide

    • Describe how to utilize action method V2.0.
    • Action method V2.0 must be requested in POST method, and the analyzed entity value and user variable value are transmitted through the body.
    Note

    For details on Action Method V2.0, please refer to Action Method V2.0.

    How to use with answers

    Note
    • You must respond by referring to the response format in the backend.
    • Please use the variableName value in the response format when used in an answer.



    Set response

    chatbot-chatbot-3-10-1_en.png


    Response format

    {
        "data": [
            {
                "variableName": "var1",
                "value": "VAR1"
            },
            {
                "variableName": "var2",
                "value": "VAR2"
            }
        ]
    }
    



    Test conversation

    chatbot-chatbot-3-10-2_en.png


    How to use user variables

    • By calling the action method, you can set the value of the user variable to be used within the session.
    • For details on Type, Action, and valueType for setting user variables, refer to Action Method V2.0.
    • For more information on user variables, see User Variables.

    Set user variables

    chatbot-chatbot-3-10-3_en.png


    Response format

    {
        "data": [
            {
                "variableName": "var1",
                "value": "VAR1"
            },
            {
                "variableName": "var2",
                "value": "VAR2"
            }
        ],
        "userVariable": [
            {
                "name": "userVarString",
                "value": "USERVAR1",
                "type": "TEXT",
                "action": "EQ",
                "valueType": "TEXT"
            },
            {
                "name": "userVarNumber",
                "value": 100,
                "type": "NUMBER",
                "action": "EQ",
                "valueType": "NUMBER"
            },
            {
                "name": "date.year",
                "value": "2022",
                "type": "JSON",
                "action": "EQ",
                "valueType": "TEXT"
            },
            {
                "name": "date.month",
                "value": 10,
                "type": "JSON",
                "action": "EQ",
                "valueType": "NUMBER"
            },
            {
                "name": "date.day",
                "value": 24,
                "type": "JSON",
                "action": "ADD",
                "valueType": "NUMBER"
            }
        ]
    }
    



    Test user variables

    chatbot-chatbot-3-10-4_en.png


    How to use arguments

    • When calling the action method, you can request it with arbitrary arguments, and it is data that can be used in the backend.
    • In the answer, it is used like $2{action method name(arg1, arg2).variableName}.

    Set response

    chatbot-chatbot-3-10-5_en.png

    • You can check the arguments set in the answer on the backend.



    Check argument information in backend

    chatbot-chatbot-3-10-6_en.png

    Note

    For action method related errors, please refer to the Error code.


    Was this article helpful?

    What's Next
    Changing your password will log you out immediately. Use the new password to log back in.
    First name must have atleast 2 characters. Numbers and special characters are not allowed.
    Last name must have atleast 1 characters. Numbers and special characters are not allowed.
    Enter a valid email
    Enter a valid password
    Your profile has been successfully updated.