|
| 1 | +--- |
| 2 | +'@objectstack/rest': minor |
| 3 | +--- |
| 4 | + |
| 5 | +feat(rest): `GET /api/v1/data/:object/export?template=true` answers an xlsx import template for the object (#18386) |
| 6 | + |
| 7 | +Clause-②: yes (widening) |
| 8 | + |
| 9 | +The export door takes one more query parameter, `template`. `template=true` |
| 10 | +answers an `.xlsx` workbook with no data rows; `template=false` answers the export. |
| 11 | +Without a `template` parameter the export is exactly as before, byte for byte. |
| 12 | + |
| 13 | +- **Columns.** Every field of the object except |
| 14 | + those marked `system` or `readonly`, and `formula`, `summary` and |
| 15 | + `autonumber` fields, in the order the object declares them. A `hidden` field |
| 16 | + that can be written is a column. The seven columns the platform adds to every |
| 17 | + object (`organization_id`, `created_at`, `created_by`, `updated_at`, |
| 18 | + `updated_by`, `owner_id`, `owning_business_unit_id`) are never template |
| 19 | + columns. A field the caller's field-level security does not let them edit is |
| 20 | + left out. If the security service cannot say which fields the caller can edit, |
| 21 | + the columns are narrowed by the fields the caller can read instead. The |
| 22 | + instructions sheet then says so, and the `X-Export-Template-Projection` |
| 23 | + response header reads `readable` instead of `writable` (`none` when no |
| 24 | + field-level security applies). An explicit `?fields=` list is used as sent. |
| 25 | +- **First sheet.** The header row, with ` *` after each field that is required |
| 26 | + and has no default value, and one example row to replace or delete. Select, |
| 27 | + radio and boolean columns carry a dropdown. |
| 28 | +- **Second sheet.** One row per column: the field's API name, its type, whether |
| 29 | + it is required, and the values the import accepts for it. |
| 30 | +- **Language.** The sheets are in Chinese for a `zh` request locale |
| 31 | + (`?locale=` or `Accept-Language`) and in English otherwise. |
| 32 | + |
| 33 | +The same two permission checks as the export apply: an object that does not |
| 34 | +expose export answers `405`, and a caller without the export permission answers |
| 35 | +`403`. `template` with a value other than `true` or `false`, a `format` other |
| 36 | +than `xlsx`, or any of `limit`, `page`, `filter`, `search`, `searchFields`, |
| 37 | +`orderby` or `header` beside `template=true`, answers `400 VALIDATION_ERROR`. |
0 commit comments