Skip to content

Download an example file

View as Markdown
get /api/imports/types/{type}/sample

Downloads an example file for an ImportType.

Downloads an example file for an import type. The response is the file itself, as an attachment - not JSON - with the generated name in the Content-Disposition header:

Content-Disposition: attachment; filename="products-sample.csv"
  • mode=sample (default) - a hand-crafted illustrative file showing the expected columns and a few example rows.
  • mode=data - a full re-importable export of your tenant data for this type, to bulk-edit and load back.

format=csv (default) or format=xlsx. An unsupported value is rejected with 422 and the slug import.invalid_sample_format.

Path parameters

NameTypeRequiredDescription
typestringrequiredImportType identifier

Query parameters

NameTypeRequiredDescription
modestring-sample (default) returns a hand-crafted illustrative file; data returns a full re-importable export of the tenant data.
formatstring-File format of the downloaded sample.
properties[]string[]-Allows you to reduce the response to contain only the properties you need. If your desired property is nested, you can address it using nested arrays. Example: properties[]={propertyName}&properties[]={anotherPropertyName}&properties[{nestedPropertyParent}][]={nestedProperty}

Response

200 - The example file, as an attachment named "{type}-{mode}.{format}".

Content-Type:

Errors

403 - Access denied. The caller is missing one or more permissions required for this operation.

Content-Type: application/problem+json

PropertyTypeRequiredDescription
@contextstring | object-
@idstringrequired
@typestringrequired
detailstring-
missingPermissionsstring[]-Permissions that the caller is missing for this operation. Present only when the 403 is caused by a denied permission.
statusinteger-
titlestring-
typestring-

404 - Not found

PropertyTypeRequiredDescription
@contextstring | object-
@idstringrequired
@typestringrequired
codestring-Stable identifier of the error in the error code catalogue (see /api/error-codes). Present on catalogued errors only.
descriptionstring | null-
detailstring | null-A human-readable explanation specific to this occurrence of the problem.
instancestring | null-A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced.
messagestring-End-user message localized in the request locale, with this occurrence's values substituted. Present on catalogued errors only.
slugstring-Stable, readable key of the error in the error code catalogue. Present on catalogued errors only.
statusinteger | null-
titlestring | null-A short, human-readable summary of the problem. For a catalogued error it repeats the slug.
typestring-A URI reference that identifies the problem type. For a catalogued error it is the error code resource, /api/error-codes/{code}.

422 - The requested mode or format is not supported.

Content-Type: application/problem+json