Documentation / Reference
Data API
Make a table public to publish it at its own address, query it with list parameters, hide columns, and read each module's OpenAPI description.
Applies to Glyphox 1.0.10
A table is either public or not public. A public table has two uses: the modules that reference its module can relate to it and query it, and the table is published over HTTP at its own address, so that other systems can read and write its records. The table's Access rules still decide who may read and write the records.
Make a table public
Open the table in its editor and turn on Public, at the top of the Access section. The line under the switch gives the table's address, for example "Other modules can use this table. Published at /api/tickets." The Solution tree shows public beside a public table.
A new table is not public. A table that is not public serves the pages and the logic of its own module only: other modules cannot relate to it or query it, it accepts no list parameters and it is not in the module's OpenAPI description.
A table saved by version 1.0.7 or earlier is public when the workspace is opened, so that the modules that use it keep working. In the Acme Service Desk sample, the Ticket table is public.
A public table that anyone can read is reported as a warning, in the Problems view and under the switch. Set who may read it under Read, or make the table not public. A lookup table is not reported.
Make a table not public
When you turn Public off for a table that is in use, Glyphox first names what uses it, such as another module's relationship or a query, and asks for confirmation with Make Not Public. Those uses stop working until the table is public again. Undo restores the table and the modules that use it.
The address
The address is relative to the module's API. On a local run of the Acme Service Desk sample, the Ticket table is at this address:
http://localhost:13000/service-desk/api/tickets| Request | What it does | Access rule |
|---|---|---|
| `GET /api/tickets` | Lists the records. | Read |
| `GET /api/tickets/{id}` | Returns one record. | Read |
| `POST /api/tickets` | Creates a record. | Create |
| `PUT` or `PATCH /api/tickets/{id}` | Changes a record. | Update |
| `DELETE /api/tickets/{id}` | Deletes a record. | Delete |
The key and the columns that the application fills in on every save are returned with each record. A value sent for one of them in a create or an update is ignored.
List parameters
The list of a public table accepts these parameters, which follow OData version 4.01.
| Parameter | What it does |
|---|---|
| `$filter` | Returns the records that match a condition. A condition compares a column with eq, ne, gt, ge, lt or le, tests it with in, contains, startswith or endswith, and is combined with and, or and not. |
| `$select` | The columns to return, separated by commas. |
| `$orderby` | Sorts by one column, followed by desc for descending order. |
| `$top` | The largest number of records to return. |
| `$skip` | The number of records to pass over, for paging. |
| `$expand` | Includes the related records of a relationship. In brackets after the relationship's name, it accepts $select, $filter, $orderby and $top, separated by semicolons. |
| `$count` | With $count=true, the answer includes the number of records that match. |
GET /api/tickets?$filter=priority eq 'high' and status eq 'open'&$select=Id,title&$orderby=title&$top=10&$count=trueA request that uses any of these parameters is answered with an object: value holds the records, @odata.count holds the count when it was requested, and @odata.nextLink gives the address of the next page when the server shortened the page. A request without them is answered with a plain array of records.
A request that names another $ parameter, or a column or relationship that the table does not publish, is refused with status 400. The message names the parameter and what was wrong with it.
Hidden columns
On a public table, Hidden columns lists the table's columns, each with a Hidden checkbox. A hidden column is never sent, and a request that names it is refused. This applies to the table's address and to the modules that reference this one, which are not offered a hidden column. The key cannot be hidden.
The list of hidden columns is kept when Public is turned off, and applies again when the table is made public.
The OpenAPI description
Each module describes its API in an OpenAPI 3.1 document at /openapi.json, with a page to read and try it at /api-docs/. The document lists every public table with its operations, every operation of a published service, and who may call each one.
The solution's gateway combines the documents of every module, with each module's API under its own prefix. On a local run:
http://localhost:13000/openapi.json
http://localhost:13000/api-docs/Where a module requires sign-in, its description is available to signed-in callers. Otherwise it is open. In a deployment, the API_DOCS environment variable of a service or of the gateway sets this to public, signed-in or off.
Export and Publish also write the document as openapi.json in each service's folder, for tools that generate a client from it.
Ask the Assistant
The Assistant and a connected coding agent can make a table public or not public and set its hidden columns. They are refused when they would make a table not public while something still uses it.
Related articles
Roles and permissions, under How-to guides, describes the Access rules. Add a table and generate its pages describes relationships to another module's table. Call an external API and publish your own describes published services, which give server actions their own addresses.
If a step fails, see Troubleshoot the first run or contact support.