api:info

Version 23.0.9145


api:info


Use the api:info keyword to describe the metadata for scripts. The application uses this information to implement basic error checking on user input and to set default values. api:info can contain the following:

  • Column definitions
  • Input parameters the script expects
  • Output the script produces

Script Parameters

You can define the following parameters for the script itself:

  • desc[ription]: The script description. If you do not provide a description, the script name is used.
  • title: The script title. If you do not provide a title, the script name is used.
  • methods: The HTTP methods that can be executed against this script. SELECT, INSERT, UPDATE, and DELETE correspond to HTTP GET, POST, PUT/PATCH/MERGE, and DELETE, respectively.
  • url: The URL of the script author.
  • keywords: The keywords that describe the script.

Input, Output, and Column Parameters

The api:info keyword has additional parameters contained in its scope that define columns as well as script inputs and outputs.

Note: These parameters are not APIScript keywords, but they provide additional information to api:info.

input

Input parameters describe inputs to the script.

<input
  name="name"
  desc="Example of an input parameter"
  default="defValue"
  req="true"
  values="value1, value2, value3"
  xs:type="string" 
/>
  • name: The name of the input. An alphanumeric string that can also contain the following:
    • # denotes that the input can have multiple values
    • myprefix:* denotes a set of inputs with the same prefix
    • * denotes arbitrary input parameters
  • desc[ription]: A short description of the input.
  • xs:type: The data type of the input. The supported types are string, int, double, datetime, and boolean.
  • def[ault]: The default value to be used when no input value is supplied in the script call.
  • key: Whether the input is a primary key.
  • req[uired]: Whether the input is mandatory. The engine throws an error if the required input is not supplied and no default value is defined. Allowed values are true and false.
  • values: A comma-separated list of the allowed values for the input. If specified, the engine throws an error if the specified input does not match one of the allowed values.
  • alias: The alias of the input.
  • other: Attributes prefixed with other: that provide extra information. These other properties can be operation-specific.

output

Output parameters describe the operation output. However, they are ignored by the application. Thus, the output of the operation can be entirely independent of what is defined in the info block.

<output  name="Id" 
         desc="The unique identifier of the record."
         xs:type="string"
         other:xPath="content/properties/Id" 
/>
  • name: The name of the output. myprefix:* denotes a set of outputs with the same prefix, and * denotes arbitrary output parameters.
  • xs:type: The data type of the output. The supported types are string, int, double, datetime, and boolean.
  • desc[ription]: A short description of the output.
  • columnsize: The maximum character length of a string or the precision of a numeric output. (Precision is the number of digits.)
  • other: Attributes prefixed with other: that provide extra information about the output. For example, other:xPath specifies the XPath to a node in a local or remote resource. The XPath can be relative to a RepeatElement.

Example

Describes the inputs to the After Receive event:

<api:info title="After Receive"  desc="This event is fired after receiving a file.">
  <input name="Filename"         desc="The name of the file that was sent." />
  <input name="FilePath"         desc="The path of the file that was received." />
  <input name="MessageId"        desc="The Id of the transmission." />
  <input name="ErrorMessage"     desc="If an error occurred, this will contain the error message." />
</api:info>

See Also