ubpost – http interface for applications

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.

ubpost is for use with http POST request while ubcgi is for use with http GET. This description is for ubpost. The ubcgi page describes the differences when using GET.

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/ubpost.

Sample call

A typical call to Unibase might be http://somedomain/cgi-bin/ubpost

ubpost is the target of the unibase.js functions such as unibase.dataCGI (), unibase.idCGI(), and the function key/button clicks in ubprompt.

Arguments

The ubpost query string can be specified as multipart/form-data or application/x-www-form-urlencoded.

  1. PROMPT_NAME
    • Run a unibase form program (ubprompt)
    • Content-type: text/html
    • ARGUMENTS
      • FORM=Y to run the screen form
      • KEY_F<number>. Run the script for function key <number>
      • General arguments
  2. 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
      • INPUT_<variable>=<value>. <variable>=<value> is passed as input variables to the report.
      • <value>=YES. <value> is passed as an argument to the report.
      • <variable>=<value>. New environment <variable> with <value>.
      • General arguments
  3. 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
      • INPUT_<variable>=<value>. <variable>=<value> is passed as input variables to the report.
      • <value>=YES. <value> is passed as an argument to the report.
      • <variable>=<value>. New environment <variable> with <value>.
      • General arguments
  4. 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
      • INPUT_<variable>=<value>. <variable>=<value> is passed as input variables to the report.
      • <value>=YES. <value> is passed as an argument to the report.
      • <variable>=<value>. New environment <variable> with <value>.
      • General arguments
  5. 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
  6. 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