HomeDev GuideAPI Reference
Dev GuideAPI ReferenceUser GuideGitHubNuGetDev CommunitySubmit a ticketLog In
GitHubNuGetDev CommunitySubmit a ticket

Import files in bulk

Describes available bulk operation calls in the Optimizely Service API. The calls and their formats are described in detail, together with the integration service work process and supported bulk file formats.

Work process

The general process of working with the integration service is as follows:

  1. Authenticate with a call to /episerverapi/token, capturing the returned token.
  2. Import with a call to /episerverapi/commerce/import/{import_type}, passing along the authentication token and capturing the returned job ID.
  3. Check on the import status with a call to /episerverapi/commerce/task/{job_id}/status.

📘

Note

The task manager backing this runs the imports sequentially, but multiple jobs can be queued. The queue is held entirely in memory, so an IIS restart wipes out the pending tasks and breaks the running import.

Supported bulk file formats

  • Catalog Import XML (provided in the compressed ZIP format) – The older format for manual catalog imports. It was extended to include a section for importing links between existing assets and catalog nodes and entries (but not for adding new assets). See Catalog service.
  • EPISERVERDATA file – The format for data exported from the CMS. See CMS content import service. The file format is undocumented and there is no guarantee of backwards compatibility.
  • Asset Linking XML file – A newer format that supports the linking of catalog nodes/entries and assets, see Catalog asset linking service. You can include these data in the Catalog Import XML file, but for convenience, there is a separate action to improve testability.
  • Media Assets ZIP file – A newer format that supports the bulk upload of assets into your systems, see Media service.

Bulk operation calls

  • Authenticate and get security token
    • HTTP Method – POST
    • Package – EPiServer.ServiceApi
    • URI – /episerverapi/token
    • Header – Content-Type: application/x-www-form-urlencoded
    • Returns – Security Token for use in successive calls
  • Upload & import Catalog Import XML (ZIP) file
    • HTTP Method – POST
    • Package – EPiServer.ServiceApi.Commerce
    • URI – /episerverapi/commerce/import/catalog
    • Header – Authorization: Bearer <<token>> and Content-Type: multipart/form-data
    • Returns – Task ID (GUID) for use in status requests
  • Upload & import EPISERVERDATA file
    • HTTP Method – POST
    • Package – EPiServer.ServiceApi
    • URI – /episerverapi/commerce/import/cms/site/ {siteName}/{hostname}/{culture=}
    • Header – Authorization: Bearer <<token>> and Content-Type: multipart/form-data
    • Returns – Task ID (GUID) for use in status requests
  • Upload & import Catalog <-> Assets Linking XML file
    • HTTP Method – POST
    • Package – EPiServer.ServiceApi.Commerce
    • URI – /episerverapi/commerce/import/links
    • Header – Authorization: Bearer <<token>> and Content-Type: multipart/form-data
    • Returns – Task ID (GUID) for use in status requests
  • Upload & import Media Assets (ZIP) file
    • HTTP Method – POST
    • Package – EPiServer.ServiceApi
    • URI – /episerverapi/commerce/import/assets
    • Header – Authorization: Bearer <<token>> and Content-Type: multipart/form-data
    • Returns – Task ID (GUID) for use in status requests
  • Get current status on prior import job
    • HTTP Method – GET
    • Package – EPiServer.ServiceApi
    • URI – /episerverapi/commerce/task/ {taskId:GUID}/status
    • Header – Authorization: Bearer <<token>>
    • Returns – Latest status record for import task with given Task ID
  • Get full log of prior import job messages
    • HTTP Method – GET
    • Package – EPiServer.ServiceApi
    • URI – /episerverapi/commerce/task/ {taskId:GUID}/log
    • Header – Authorization: Bearer <<token>> and Content-Type: multipart/form-data
    • Returns – Full history of status records (to current point) for import task with given Task ID