form_request (GET)

Purpose

Provides a function configuration form client code with additional information to be displayed in the form.


Input parameters

  • id: Identifier of the function that owns the form, as returned by the get_function_info command in the id parameter.
  • data: A JSON object with the following format:

    {
       "app":"myapplication",
       "input":"...",
       "language":"en",
       "trigger_output_vars":{
          "from":"text",
          "send_date":"date",
          "amount":"decimal",
          "var1":"custom1"
       }
       "authentication":{
          "user_id":"theUser",
          "auth_saved_data":"..."
       },
       "form_data":{
          "city":"Tokyo",
          "time":"12:34"
       }
    }
    
  • app: Application identifier, same value as the “app” input parameter.
  • input: A string passed as a parameter to the Javascript form_request method that has triggered the invocation of this command.
  • language: The language that Botize is using for the user interface served to the user that is configuring the task.
  • trigger_output_vars, authentication, form_data: Same meaning as in the validate_form command.

Output data

A JSON object with this format:

{
   "output":"...",
}


  • output: A string with data that will be passed to the function configuration form client code as the return value of the Javascript validate_form method.

Notes

Botize will invoke this command when the form invokes the validate_form Javascript method that is included by Botize as part of the task configuration page. The parameter passed to the method will be passed to the command in the input element, and the data returned in the output element will be the return value of the Javascript method.

The language, trigger_output_vars, authentication and form_data elements are included in the input data in order to provide the command code with appropriate context information for the task in which the function is participating. It is up to the command code to use this information or not for generating the output data. See the Ajax calls from function forms section for details.