CMS
Des tables de contenu lues par vos sites et applications.
Une table CMS est une table ordinaire dans la base de données de l'espace de travail. Vous gérez les tables avec les méthodes CMS, et vous lisez et écrivez leurs enregistrements avec les méthodes d'enregistrement. Chaque appel est un POST vers /cpi/<method> avec un corps JSON qui contient votre clé d'API.
La réponse contient chaque table avec ses champs et son nombre d'enregistrements, ainsi que la base de données où elle se trouve (l'app_id que prennent les méthodes d'enregistrement).
Depuis le tableau de bord
Chaque table a une fenêtre API : cliquez sur API et JSON sur une carte ou dans une table ouverte. Elle montre les cinq appels d'enregistrement pour cette table, les champs de la table sous forme de JSON, la même requête en cURL ou en JavaScript, et un endroit pour l'envoyer. Son sélecteur de clé liste les clés qui atteignent l'espace de travail, et peut en créer une nouvelle. Une clé à accès complet fonctionne. Une clé personnalisée a besoin de dbs_read pour lire et de dbs_create, dbs_update et dbs_delete pour écrire.
Enregistrements
Les cinq appels de la fenêtre exécutent ces méthodes. Chacune prend l'app_id de la base de données de l'espace de travail et l'identifiant de la table.
Un enregistrement est un objet dont les clés sont les identifiants des champs de la table. Envoyez table_data sous forme de tableau pour ajouter plusieurs enregistrements à la fois. La suppression déplace les enregistrements vers Archivé, et dbs_restore avec les mêmes identifiants les ramène. Ajoutez permanent pour les supprimer définitivement.
DBS Read
Reads records from an app table with optional row range, single-row lookup, sorting, filtering, and archived-record selection.
DBS Create
Creates a new record in the specified app table from the provided key-value table data.
DBS Update
Replaces the data of an existing record, identified by row_id, in the specified app table.
DBS Delete
Soft-deletes (or permanently deletes when 'permanent' is set) the listed record IDs from an app table.
DBS Restore
Restores previously soft-deleted records, identified by their IDs, in the specified app table.
Tables
Get CMS Tables
The CMS tables of one workspace, active and archived, each with its fields and how many records it holds, plus the database the records live in (the app_id to hand dbs_read, dbs_create, dbs_update, dbs_delete and dbs_restore), whether that database is ready, and the plan with what it allows. The first open of a workspace other than Main installs the database plugin there and answers preparing until it is ready.
Get CMS Table
One CMS table as Xuda Studio stores it (its fields and indexes), with its record count and the database it lives in.
Save CMS Table
Create a CMS table, or change one when table_id is sent. A table has a name, an optional description and its fields, each a name, a type (string, number, boolean, date, array, object, or relation) and whether it is required. A relation field relates the table to the Contacts module ({ kind: 'module', module: 'contacts' }) or to another CMS table of the workspace ({ kind: 'table', table_id }), holding one id or, with many, several; a saved relation keeps what it relates to and its shape. Field names start with a letter and use letters, digits and underscores. A new table counts against the plan's tables, and every table against its fields per table. The table is an ordinary Xuda Studio table in the workspace's database, so it opens in Studio too.
Archive CMS Table
Archive a CMS table (it leaves the list and its records stay) or bring it back with archived false, which counts against the plan's tables again.
Get CMS Records Of An Item
The CMS tables related to one item of another module (a ticket, a delivery, an order, a product, a finance document or a contact), each with its fields and the records that point at that item, so the item can show them to fill. A workspace with CMS switched off answers no tables.
Une nouvelle table compte dans les tables de votre forfait, chaque table dans ses champs, et l'ajout ou la restauration d'enregistrements dans ses enregistrements. Un appel au-delà d'une limite est refusé avec un message qui dit laquelle.