HomeGuidesAPI Reference
Submit Documentation FeedbackJoin Developer CommunityOptimizely GitHubOptimizely NuGetLog In

Bulk importing

This topic 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

ActionHTTP
method
PackageURIHeaderReturns
Authenticate and get security token  POSTEPiServer.ServiceApi/episerverapi/token Content-Type: application/x-www-form-urlencodedSecurity Token for use in successive calls
Upload & import Catalog Import XML (ZIP) filePOSTEPiServer.ServiceApi.Commerce/episerverapi/commerce/import/catalogAuthorization: Bearer <<token>>
Content-Type: multipart/form-data
Task ID (GUID) for use in status requests
Upload & import EPISERVERDATA filePOSTEPiServer.ServiceApi/episerverapi/commerce/import/cms/site/ {siteName}/{hostname}/{culture=}Authorization: Bearer <<token>>
Content-Type: multipart/form-data
Task ID (GUID) for use in status requests
Upload & import Catalog <-> Assets Linking XML filePOSTEPiServer.ServiceApi.Commerce/episerverapi/commerce/import/linksAuthorization: Bearer <<token>>
Content-Type: multipart/form-data
Task ID (GUID) for use in status requests
Upload & import Media Assets (ZIP) file POSTEPiServer.ServiceApi/episerverapi/commerce/import/assetsAuthorization: Bearer <<token>>
Content-Type: multipart/form-data 
Task ID (GUID) for use in status requests
Get current status on prior import jobGETEPiServer.ServiceApi/episerverapi/commerce/task/ {taskId:GUID}/statusAuthorization: Bearer <<token>>Latest status record for import task with given Task ID
Get full log of prior import job messagesGETEPiServer.ServiceApi/episerverapi/commerce/task/ {taskId:GUID}/logAuthorization: Bearer <<token>>Full history of status records (to current point) for import task with given Task ID

What’s Next