Jump to content

OperatorAPI options: Difference between revisions

From Wiki 7Kas
Operator API reference (generated from func=help)
 
Operator API reference: multi-line response shape
 
Line 20: Line 20:


== Response ==
== Response ==
Success is <code>{"ok":true,"data":{...}}</code>; on refusal <code>{"ok":false,"code":"...","message":"..."}</code>. This function's data shape: <code>{"ok":true,"data":{"section":s,"scope":s,"default_order":s,"fields":[{"name":s,"type":s,"sortable":b,"searchable":b}],"writable":[{"name":s,"type":s,"required":b,"immutable":b}],"write_groups":{...}|null,"can":{"insert":b,"update":b,"delete":b,"import":b},"export":{...},"delete":{...}}}</code>.
Success is <code>{"ok":true,"data":{...}}</code>; on refusal <code>{"ok":false,"code":"...","message":"..."}</code>. This function's data shape (<code>n</code> = number, <code>s</code> = string, <code>?</code> = present only when set):
<pre>
{
  "ok":true,
  "data":{
    "section":s,
    "scope":s,
    "default_order":s,
    "fields":[
      {
        "name":s,
        "type":s,
        "sortable":b,
        "searchable":b
      }
    ],
    "writable":[
      {
        "name":s,
        "type":s,
        "required":b,
        "immutable":b
      }
    ],
    "write_groups":{
      ...
    }|null,
    "can":{
      "insert":b,
      "update":b,
      "delete":b,
      "import":b
    },
    "export":{
      ...
    },
    "delete":{
      ...
    }
  }
}
</pre>


== Errors ==
== Errors ==

Latest revision as of 08:28, 19 August 2026

newadmapi (Operator API) function. Available to: Operator, SuperRoot.

Description

What a SECTION offers, and what THIS caller may do with it: the readable fields with their types and whether each is sortable or searchable, the writable fields with required/immutable, the group writes demand, the export choices, and what a delete would cascade to. func=help describes the FUNCTIONS; this describes a section, because with one engine over many sections "what may I do here" is a property of the section rather than of the verb. Computed from the same declarations the routes enforce, so a panel built from it cannot offer what the route refuses.

A generic verb: it works over any section via the section parameter. Discover sections with OperatorAPI sections and a section's fields/capabilities with OperatorAPI options.

Call

GET|POST https://YOUR_HOST:9089/newadm?func=options

Send your API key with every request (header X-API-Key: YOUR_KEY, or Authorization: Bearer YOUR_KEY, or the ukey query parameter).

Parameters

Parameter Type Required Default Meaning
section string Yes The section key, e.g. bonos.

Example

https://host:port/newadm?func=options&section=bonos

Response

Success is {"ok":true,"data":{...}}; on refusal {"ok":false,"code":"...","message":"..."}. This function's data shape (n = number, s = string, ? = present only when set):

{
  "ok":true,
  "data":{
    "section":s,
    "scope":s,
    "default_order":s,
    "fields":[
      {
        "name":s,
        "type":s,
        "sortable":b,
        "searchable":b
      }
    ],
    "writable":[
      {
        "name":s,
        "type":s,
        "required":b,
        "immutable":b
      }
    ],
    "write_groups":{
      ...
    }|null,
    "can":{
      "insert":b,
      "update":b,
      "delete":b,
      "import":b
    },
    "export":{
      ...
    },
    "delete":{
      ...
    }
  }
}

Errors

Refusals carry a machine-readable code (branch on the code, never the message). See OperatorAPI#Error codes.


Back to OperatorAPI