Import data endpoints

The following information shows how you can perform an import.

When you perform an import, you perform the following steps:
  1. Upload the data file.
  2. Trigger the import using the executeImport endpoint.
  3. Monitor the import status using the getImportProcess endpoint. Once the import has finished, you then download the error and status files.
  4. You can end the import process using the abortImprotProcess endpoint if necessary.
  1. Use the following endpoint to upload your import file:
    POST /ccadmin/v1/files
    Use the following form parameters with this endpoint:
    • fileUpload - The file to upload.
    • fileName - An optional file name.
    • uploadType - Use the bulkImport parameter.
  2. Initiate the import by using the importProcess endpoint. The following is an example of an archive import:
    {
      "fileName" : "profilesAndAccounts.zip"
    }

    Refer to the Archived Mode section for information on what is contained in the ZIP file.

    The following example is of a standalone import:

    POST /ccadmin/v1/importProcess
         {
           "fileName": "product.json",
           "mode" : "standalone",
           "id"  : "Products",
           "format": "json"
         }
  3. You can review the progress of the import using the process ID that is returned from the importProcess API. For example:
    GET /ccadmin/v1/importProcess/{processId}
  4. Once the import job is complete, the resulting payload provides the links that you can use to download the error and status files. The following is an example of a completed import in standalone mode:
    {
        "completedPercentage":100,
        "progress":"succeeded",
        "startTime":"2020-04-04T20:25:01.982Z",
        "links":[
            {
                "rel":"meta",
                "href":"<baseUrl>/import/ ezzPxcPRmJIlXYOTQNT9HMacA _10000/importStatus.json"
            },
            {
                "rel":"failedRecordsFile",
                "href":"<baseUrl>/import/ ezzPxcPRmJIlXYOTQNT9HMacA _10000/importFile.json"
            },
            {
                "rel":"failedAssociationRecordsFile",
                "href":"<baseUrl>/ezzPxcPRmJIlXYOTQNT9HMacA_10000/failedAssociationRecordsFile.json"
            },
            {
                "rel":"self",
                "href":"<baseUrl>/importProcess/ezzPxcPRmJIlXYCyOTQNT9HMacA_10000"
            }
        ],
        "endTime":"2020-04-04T20:25:02.190Z",
        "completed":true,
        "requestStatus":200
    }
    The meta URL is the status file that contains the following data:
    • startTime - Indicates the start time of the export process.
    • endTime - Indicates that the time that the export process ended.
    • successCount - This indicates the number of records that were successfully exported.
    • failureCount - The number of records that failed to successfully export.
    • failureExceptions - This provides error details if there are any errors that were created during the export process.

    The status file may look similar to the following:

    {
      "endTime" : 1587782346639,
      "startTime" : 1587782346602,
      "failureCount" : 1,
      "successCount" : 202,
      "failureExceptions" : [Invalid Phone Number is provided for 133]
    }

The failedRecordsFile contains the errors generated during the import process. The details in this meta file can be used to fix the error records in the failedRecordsFile, which can be re-imported once you have fixed the data.

For the ProductsV2 import process, the failedAssociationRecordsFile contains the records for which most of the data was correctly processed, but some specific associations failed. The failedAsociationRecordsFile can also be re-imported once the data has been fixed.

Abort an import

An import can be aborted any time after triggering the import and before completion of the import. The import is terminated only after the current batch of records has been processed.

To abort an import, use the POST /ccadmin/v1/importProcess/{processId}/abort REST endpoint.

Update import data

By default, when performing an import, existing records are updated if they are found in the repository. You can set the update flag to false if you do not want to update existing records as setting this flag to false can increase the speed of the import process if all of the records being imported are new records. For example:

{
   "fileName": "product.json",
    "id" : "Products",
    "mode" : "standalone",
    "format" : "json",
    "params" :{
       "update":"false"
    }
}