|
| 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`, or no |
| 11 | +`template` parameter, answers the export exactly as before, byte for byte. |
| 12 | + |
| 13 | +- **Columns.** The fields an import stores: every field of the object except |
| 14 | + those marked `system`, `hidden` or `readonly`, and `formula`, `summary` and |
| 15 | + `autonumber` fields, in the order the object declares them. The seven columns |
| 16 | + the platform adds to every object (`organization_id`, `created_at`, |
| 17 | + `created_by`, `updated_at`, `updated_by`, `owner_id`, |
| 18 | + `owning_business_unit_id`) are never template columns. A field the caller's |
| 19 | + field-level security does not let them read is left out. An explicit |
| 20 | + `?fields=` list is used as sent. |
| 21 | +- **First sheet.** The header row, with ` *` after each field that is required |
| 22 | + and has no default value, and one example row to replace or delete. Select, |
| 23 | + radio and boolean columns carry a dropdown. |
| 24 | +- **Second sheet.** One row per column: the field's API name, its type, whether |
| 25 | + it is required, and the values the import accepts for it. |
| 26 | +- **Language.** The sheets are in Chinese for a `zh` request locale |
| 27 | + (`?locale=` or `Accept-Language`) and in English otherwise. |
| 28 | + |
| 29 | +The same two permission checks as the export apply: an object that does not |
| 30 | +expose export answers `405`, and a caller without the export permission answers |
| 31 | +`403`. `template` with a value other than `true` or `false`, a `format` other |
| 32 | +than `xlsx`, or any of `limit`, `page`, `filter`, `search`, `searchFields`, |
| 33 | +`orderby` or `header` beside `template=true`, answers `400 VALIDATION_ERROR`. |
0 commit comments