Jump to content

OperatorAPI export

From Wiki 7Kas

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

Description

The SAME query as list, rendered as a delimited file. Every view parameter is identical - fields, order, dir, filterby, filter - so exporting "what I am looking at" is this call with the parameters the grid was already using, never a second code path that could disagree about what that was. Columns may be NARROWED with fields and never widened: a name that is not declared by the section is refused. A separator inside a value is quoted (RFC4180), so a value containing the delimiter cannot silently split into two columns as the legacy export does. Refuses rather than truncates above 50000 rows.

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=export

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.
fields string No Comma-separated subset of the declared fields, in the order you want the columns. (Empty = every declared field. An undeclared name is refused BY NAME)
sep string No tab Field separator: tab, comma, semicolon, pipe, or one literal character. (The legacy default was TAB (export_separator). A quote or a newline is refused)
decimal string No . Decimal mark for numeric columns: "." or ",". (The legacy wrote "," (export_floatsig). Refused when it equals sep)
header boolean No true Write a header row of field names.
order string No Sort field, from the declared set.
dir string No asc asc or desc.
filterby string No Field to search, from the declared set.
filter string No Literal substring, case-insensitive.

Example

https://host:port/newadm?func=export&section=bonos&fields=name,price&sep=semicolon&decimal=,&order=name

Response

Success is {"ok":true,"data":{...}}; on refusal {"ok":false,"code":"...","message":"..."}. This function's data shape: text/csv attachment - not a JSON envelope. Errors ARE JSON envelopes..

Errors

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


Back to OperatorAPI