Purpose of SAP Commerce Cloud previewwebservices

When we open SAP Commerce Cloud SmartEdit, we can observe the following OCC API:

Complete request url: https://localhost:9002/previewwebservices/v1/preview

This previewwebservices is one of the extensions necessary for the normal operation of SmartEdit.

There is a field called ticketId in the response structure.

Later this ticket is used as the query parameter of the request:

smartEditAfter the cmsTicketId field is included in the OCC request, there will be additional dynamic attributes in the HTTP response .

The Preview API enables SmartEdit to load the store into an iframe within the context of the requested experience. An experience context is a store for a specific site, directory, and directory version, and can also be a specified language and date time.

  • To render a store in a specified experience context, SmartEdit loads the requested store into an iframe in the requested experience context.

  • In order to load the store in the context of the requested experience, the SmartEdit framework performs the following operations:

  • Send a POST request for the requested experience context to the Preview API and obtain the preview ticket ID from it.

  • The experience context's store home page is called using a URI appended with /cx-preview and a cmsTicketId request parameter whose value is the preview ticket ID.

  • Load the requested page into an iframe.

The following payload must be published to /previewwebservices/v1/preview:

{
    
    
"catalog":"apparel-ukContentCatalog",
"catalogVersion":"Staged",
"language":"en",
"resourcePath":"/the/path/to/my/storefront/site"
"time": "2016-12-20T08:51:36-0500",
"catalogVersions" : [{
    
    
      "catalog" : "apparelProductCatalog",
      "catalogVersion" : "Online"
   }, {
    
    
      "catalog" : "apparel-ukContentCatalog",
      "catalogVersion" : "Staged"
   }]
}

example:

If the URL of a homepage is /the/path/to/my/storefront/site, then your storefront should also support the URL /the/path/to/my/storefront/site/cx-preview?cmsTicketId=< preview_ticket_id>·. The second URL must provide the storefront site for the experience context identified by the preview ticket ID. Once this URL is called on the homepage, any deep links or direct access to other pages must provide the same experience context, even without adding /cx-preview or cmsTicketId to the URL.

Guess you like

Origin blog.csdn.net/i042416/article/details/132780058