Most robots executed through the API will be parametrized through
input, such as a search keyword, or login credentials. Input to a robot
is part of the request to RoboServer, and is provided using the
createInputVariable method on the request. Let us look at a
short code fragment.
Input using implicit
Here we create a
Request and use
CreateInputVariable to create an input variable named
userLogin. We then use
configure the username and password attributes of the input variable.
The above example is a common shorthand notation, but can
also be expressed move verbosely by using the
Input using explicit
The two examples are identical. The first utilizes the cascading method invocation on the anonymous
RqlObjectBuilder and is therefore shorter.
When RoboServer receives this request the following occurs:
RobotLibraryis configured for the request).
setAttributeare compatible with the type of variable userLogin. Which means that the type must have attributes named username and password and that these must both be text based attributes (the next section will describe the mapping between API and Design Studio attributes).
If a robot requires multiple input variables, you must create all of them in order to execute the robot. You only have to configure required attributes, any no-required attributes that you don't configure through the API will just have a null value. If we assume you have a robot that requires login to both Facebook and Twitter, you could define the input like this.