action_="api"

<do action_="api"> sends a 1010data API transaction.

Description

<do action_="api> is a bridge to the XML API of 1010data. It was created as a stopgap before specific <do> actions were created. If there is an XML API function that has a specific <do> action, you should use the specific <do> action rather than using <do action_="api">. For example, use <do action_="dbupdate"> instead of <do action_="api" api_="dbupdate">.

Syntax

<dynamic>
    <do action_="api" api_="[TRANSACTION_NAME]>
        [XML_INPUT_TO_SERVER]
    </do>
</dynamic>

Attributes for action_="api"

api_
Specifies the name of the API transaction. This attribute is required.

Valid values for the api_ attribute are the names of 1010data API transactions. See the 1010data API Reference Manual for a list of transaction names.

The XML input for the API transaction is placed between the opening and closing <do> tags.

Example: action_="api"

In this example, the gettab API transaction is specified in the first <do> clause. The XML for that transaction is specified between the opening and closing <do> tags.

<defblock name="get_attributes"  
 tab_attrs="{lst('id' 'name' 'type' 'display' 'report' 'chart' 'title' 'sdesc' 
 'ldesc' 'link' 'rows' 'bytes' 'segs' 'tstat' 'access' 'secure' 'maxdown' 'own' 
 'owner' 'segby' 'update' 'favorite' 'users')}">
  <table depth="1"/>
  <foreach returns="{@tab_attrs}" tally="@i">
    <willbe name="trans_{@i}" value="'{@returns}'"/>
  </foreach>
  <transpose/>
</defblock>
<dynamic path="" selected="{mklst(0;'')}">
  <do onsubmit_="apiexample" action_="api" api_="gettab" value_="@result">
    <name>{@path}
    </name>
  </do>
  <do onchange_="@path" when_="{@path<>''}">
    <set selected="{mklst(0;'')}"/>
  </do>
  <layout arrange_="v">
    <widget class_="browser" accept_="table" label_="Path:" value_="@path"/>
    <widget class_="dropdown" multi_="1" listvalue_="@selected" 
     halign_="right" insert_="get_attributes"/>
    <widget class_="button" type_="submit" submit_="apiexample" 
     halign_="right" text_="Get Table Info" 
     require_="@path" invmode_="hide"/>
  </layout>
  <layout arrange_="v">
    <widget class_="nest" require_="{lst_len(@selected)>0}" invmode_="hide">
      <dynamic>
        <layout arrange_="v">
          <foreach tab_vals="{@selected}">
            <widget invmode_="hide" require_="@selected" class_="text" type_="html" 
             text_="<b>{@tab_vals}</b> {@result..tab[@tab_vals]._or_empty}"/>
          </foreach>
        </layout>
      </dynamic>
    </widget>
  </layout>
</dynamic>