Import Operations
An Import Operation is a status of the import of an individual resource. Import Operations can be retrieved by ID or can be queried within a specific Import Container. Both Import Operations and Import Summary can be used to monitor import progress. The former focuses on the status of each import resource. The latter reports the status of an Import Container by the number of resources in each Processing State.
An Import Operation is automatically deleted in 48 hours after it is created.
Representations
ImportOperation
An Import Operation is automatically deleted in 48 hours after it is created.
Import Operation describes the import status of a specific resource.
idString | The ID of the ImportOperation. |
versionInt | The version of the ImportOperation. |
createdAt | The time when the ImportOperation was created. |
lastModifiedAt | The last time When the ImportOperation was modified. |
importContainerKeyString | The key of the importContainer. |
resourceKeyString | The key of the resource. |
state | The import status of the resource. Set to |
resourceVersionInt | The version of the impmorted resource when the import was successful. |
errorsArray of ErrorObject | Contains an error if the import of the resource was not successful. See Errors. |
unresolvedReferencesArray of UnresolvedReferences | In case of unresolved status this array will show the unresolved references |
expiresAt | The expiration time of the ImportOperation. |
{"version" : 1,"state" : "unresolved","importContainerKey" : "category-import-container","resourceKey" : "child-category","resourceType" : "category","id" : "252c6ed3-c668-4610-afe9-87b9255e62e0","createdAt" : "2018-02-05T09:47:16.648Z","lastModifiedAt" : "2018-02-05T09:47:16.649Z","expiresAt" : "2018-02-08T09:47:16.649Z"}
{"version" : 3,"state" : "validationFailed","errors" : [ {"code" : "RequiredField","message" : "The required field 'key' is missing.","field" : "key"} ],"importContainerKey" : "category-import-container","id" : "252c6ed3-c668-4610-afe9-87b9255e62e0","resourceKey" : "root-category","resourceType" : "category","createdAt" : "2018-02-05T09:47:16.648Z","lastModifiedAt" : "2018-02-05T09:47:16.649Z","expiresAt" : "2018-02-08T09:47:16.649Z"}
ImportOperationPagedResponse
PagedQueryResult for Import Operations.
limitInt | The number of results requested in the query request. |
offsetInt | The number of elements skipped, not a page number. Supplied by the client or the server default. |
countInt | The actual number of results returned. |
totalInt | The total number of import operations matching the query. |
resultsArray of ImportOperation | The array of Import Operations matching the query. |
ImportResponse
A list of the ID's and validation statuses of newly created ImportOperations. Used as a response at each resource-specific import endpoint, for example, at Import Categories and Import ProductTypes.
operationStatusArray of ImportOperationStatus | MaxItems: 20 |
ImportOperationStatus
operationIdString | The ID of the ImportOperation. |
state | The validation state of the ImportOperation. |
errorsArray of ErrorObject | The validation errors for the ImportOperation. See Errors. |
ImportOperationState
Describes the validation state of a newly created ImportOperation.
processingThis is an initial state of import resource and is currently processing.
validationFailedThe validation of the import resource failed.
Get ImportOperation
Retrieves the ImportOperation of a given ID.
manage_import_containers:{projectKey}, view_import_containers:{projectKey}regionString | The Region in which the Project is hosted. |
projectKeyString | The commercetools Project key. |
idString | The operation identifier |
curl -X GET https://import.{region}.commercetools.com/{projectKey}/import-operations/{id} -i \--header 'Authorization: Bearer ${BEARER_TOKEN}'
{"version" : 1,"state" : "unresolved","importContainerKey" : "category-import-container","resourceKey" : "child-category","resourceType" : "category","id" : "252c6ed3-c668-4610-afe9-87b9255e62e0","createdAt" : "2018-02-05T09:47:16.648Z","lastModifiedAt" : "2018-02-05T09:47:16.649Z","expiresAt" : "2018-02-08T09:47:16.649Z"}
Query ImportOperations
Retrieves all ImportOperations of a given ImportContainer key.
manage_import_containers:{projectKey}, view_import_containers:{projectKey}regionString | The Region in which the Project is hosted. |
projectKeyString | The commercetools Project key. |
importContainerKeyString | The key of the import container. |
sortString | See Sorting. The parameter can be passed multiple times. |
resourceKeyString | The key of the ImportOperation to retrieve. |
state | The state of the ImportOperations to retrieve. |
debugBoolean | In case of |
limitFloat | |
offsetFloat |
curl -X GET https://import.{region}.commercetools.com/{projectKey}/import-containers/{importContainerKey}/import-operations -i \--header 'Authorization: Bearer ${BEARER_TOKEN}'