{ "opencollection": "1.0.0", "info": { "name": "Grist attachments records API", "version": "1.0.1" }, "request": { "auth": { "type": "bearer", "token": "{{bearerToken}}" } }, "items": [ { "info": { "name": "records", "type": "folder" }, "items": [ { "info": { "name": "Fetch records from a table", "type": "http" }, "http": { "method": "GET", "url": "https://{gristhost}/api/docs/:docId/tables/:tableId/records", "headers": [ { "name": "X-Sort", "value": "pet,-age" }, { "name": "X-Limit", "value": "5" } ], "params": [ { "name": "docId", "value": "", "type": "path", "description": "A string id (UUID)" }, { "name": "tableId", "value": "", "type": "path", "description": "normalized table name (see `TABLE ID` in Raw Data) or numeric row ID in `_grist_Tables`" }, { "name": "filter", "value": "{\"pet\": [\"cat\", \"dog\"]}", "type": "query", "description": "This is a JSON object mapping column names to arrays of allowed values. For example, to filter column `pet` for values `cat` and `dog`, the filter would be `{\"pet\": [\"cat\", \"dog\"]}`. JSON contains characters that are not safe to place in a URL, so it is important to url-encode them. For this example, the url-encoding is `%7B%22pet%22%3A%20%5B%22cat%22%2C%20%22dog%22%5D%7D`. See https://rosettacode.org/wiki/URL_encoding for how to url-encode a string, or https://www.urlencoder.org/ to try some examples. Multiple columns can be filtered. For example the filter for `pet` being either `cat` or `dog`, AND `size` being either `tiny` or `outrageously small`, would be `{\"pet\": [\"cat\", \"dog\"], \"size\": [\"tiny\", \"outrageously small\"]}`." }, { "name": "sort", "value": "pet,-age", "type": "query", "description": "Order in which to return results. If a single column name is given (e.g. `pet`), results are placed in ascending order of values in that column. To get results in an order that was previously prepared manually in Grist, use the special `manualSort` column name. Multiple columns can be specified, separated by commas (e.g. `pet,age`). For descending order, prefix a column name with a `-` character (e.g. `pet,-age`). To include additional sorting options append them after a colon (e.g. `pet,-age:naturalSort;emptyLast,owner`). Available options are: `orderByChoice`, `naturalSort`, `emptyLast`. Without the `sort` parameter, the order of results is unspecified." }, { "name": "limit", "value": "5", "type": "query", "description": "Return at most this number of rows. A value of 0 is equivalent to having no limit." }, { "name": "hidden", "value": "", "type": "query", "description": "Set to true to include the hidden columns (like \"manualSort\")" } ] }, "docs": "Fetch records from a table" }, { "info": { "name": "Add records to a table", "type": "http" }, "http": { "method": "POST", "url": "https://{gristhost}/api/docs/:docId/tables/:tableId/records", "params": [ { "name": "docId", "value": "", "type": "path", "description": "A string id (UUID)" }, { "name": "tableId", "value": "", "type": "path", "description": "normalized table name (see `TABLE ID` in Raw Data) or numeric row ID in `_grist_Tables`" }, { "name": "noparse", "value": "", "type": "query", "description": "Set to true to prohibit parsing strings according to the column type." } ], "body": { "type": "json", "data": "{}" } }, "docs": "Add records to a table" }, { "info": { "name": "Add or update records of a table", "type": "http" }, "http": { "method": "PUT", "url": "https://{gristhost}/api/docs/:docId/tables/:tableId/records", "params": [ { "name": "docId", "value": "", "type": "path", "description": "A string id (UUID)" }, { "name": "tableId", "value": "", "type": "path", "description": "normalized table name (see `TABLE ID` in Raw Data) or numeric row ID in `_grist_Tables`" }, { "name": "noparse", "value": "", "type": "query", "description": "Set to true to prohibit parsing strings according to the column type." }, { "name": "onmany", "value": "", "type": "query" }, { "name": "noadd", "value": "", "type": "query" }, { "name": "noupdate", "value": "", "type": "query" }, { "name": "allow_empty_require", "value": "", "type": "query" } ], "body": { "type": "json", "data": "{}" } }, "docs": "Add or update records of a table" }, { "info": { "name": "Modify records of a table", "type": "http" }, "http": { "method": "PATCH", "url": "https://{gristhost}/api/docs/:docId/tables/:tableId/records", "params": [ { "name": "docId", "value": "", "type": "path", "description": "A string id (UUID)" }, { "name": "tableId", "value": "", "type": "path", "description": "normalized table name (see `TABLE ID` in Raw Data) or numeric row ID in `_grist_Tables`" }, { "name": "noparse", "value": "", "type": "query", "description": "Set to true to prohibit parsing strings according to the column type." } ], "body": { "type": "json", "data": "{}" } }, "docs": "Modify records of a table" }, { "info": { "name": "Delete records of a table", "type": "http" }, "http": { "method": "POST", "url": "https://{gristhost}/api/docs/:docId/tables/:tableId/records/delete", "params": [ { "name": "docId", "value": "", "type": "path", "description": "A string id (UUID)" }, { "name": "tableId", "value": "", "type": "path", "description": "normalized table name (see `TABLE ID` in Raw Data) or numeric row ID in `_grist_Tables`" } ], "body": { "type": "json", "data": "{}" } }, "docs": "Delete records of a table" } ] } ], "bundled": true }