ubcgi – WWW cgi interface script
ubcgi and ubpost are the cgi interface scripts to interact with Unibase over the web. It is a very fast interface with built in security requirements. It provides an effective buffer an interface between the internet and the SaaS application.
ubcgi is for use with http GET request while ubpost is for use with http POST. This description is for ubcgi. The ubpost page describes the differences when using POST.
Setting up your httpd server
The httpd server should be set up with a cgi endpoint such as cgi-bin. eg http://somedomain/cgi-bin/ will be the location of the cgi scripts. Then the endpoint for making calls to Unibase will be http://somedomain/cgi-bin/ubcgi.
Sample call
A typical call to Unibase might be http://somedomain/cgi-bin/ubcgi?REPORT_NAME=stock&MATCH=12345
Arguments
The ubcgi query string consists of a command arguments to the command. In the sample, REPORT_NAME is the command while MATCH is an argument.
- PROMPT_NAME
- Run a unibase form program (ubprompt)
- Content-type: text/html
- ARGUMENTS
- FORM=Y to run the screen form
- General arguments
- REPORT_NAME
- Run a unibase report (ubreport)
- Content-type: text/html
- ARGUMENTS
- MATCH (optional). The -m flag to ubreport
- MATCH_LAST (optional). The -l flag to ubreport
- General arguments
- JSON_NAME
- Run a unibase report (ubreport)
- Content-type: application/json
- ARGUMENTS
- MATCH (optional). The -m flag to ubreport
- MATCH_LAST (optional). The -l flag to ubreport
- General arguments
- XML_NAME
- Run a unibase report (ubreport)
- Content-type: not specified. Report must provide Content-type
- ARGUMENTS
- MATCH (optional). The -m flag to ubreport
- MATCH_LAST (optional). The -l flag to ubreport
- General arguments
- PROC_NAME
- Run a procedure (script) located in $UG_APP/bin (/usr/local/app/<application>/bin)
- Content-type: not specified. Procedure must provide content-type
- ARGUMENTS
- General arguments
- Command arguments
- ITEM_NAME
- Run a unibase selection list (ubitem)
- Content-type: text/html
- ARGUMENTS
- FORM=Y to run the screen form
- General arguments
General arguments
Other arguments of the form <identifier>=<value> can be passed to ubcgi. <identifier> is put in the environment for the command with the value <value>.
Command arguments
Command line arguments can be passed through ubcgi using the form <argument>=YES, or ARG=<argument>
eg PROC_NAME=ls&-l=YES would execute ls -l
eg PROC_NAME=ls&ARG=-l would also execute ls -l