Interacting with your endpoint in the GUI
The Dynamic API GUI interface was designed so that you can interact with any Dynamic API endpoint in your browser.
By default, the HTML interface shows a grid for data
widgets and the raw
data in k syntax for the value
widgets.
You can provide interactive documentation for your endpoint in the Insights Platform GUI
by providing HTML in a widget <layer>
named apidoc
.
For examples, see any of the built-in endpoints under default.api
in
the Object Manager. The example below is a section of default.api.dbm
,
the QuickApp for the dbm
endpoint, showing the apidoc
layer containing the online documentation for the endpoint.
<widget name="index" class_="value" label_="result" value_="@result"> <layer name="apidoc"> <html><![CDATA[ <h1><tt>dbm</tt> API Endpoint</h1> <p>This endpoint wraps <tt><do action_="dbm"/></tt>.</p> <p>Input is a list of two items called <tt>@cmd</tt>. It contains:</p> <ol> <li>a string indicating the transaction (<tt>trans_</tt>) to run</li> <li>a dictionary containing the parameters (<tt>data_</tt>) for that transaction</li> </ol> <p>The result is a dictionary containing:</p> <dl> <dt><tt>rc</tt></dt> <dd>A result code (0 for success, 1 for error).</dd> <dt><tt>msg</tt> (when <tt>rc=1</tt>)</dt> <dd>The error message.</dd> <dt><tt>value</tt> (when <tt>rc=0</tt>)</dt> <dd>This can be any json object, depending on the transaction named in <tt>@cmd.1</tt>.</dd> </dl> ]]> </html> </layer> </widget>
You will see the documentation when you access your endpoint in the GUI through
/api/[path_to_quickapp]
.