Try our conversational search powered by Generative AI!

Importing assets via ServiceApi and specifying AssetKey

Vote:
 

We have recently upgraded a customer project to CMS 12 and Commerce 14 and we are at the same time replacing the old PIM system integration with a new architecture that requires the use of ServiceApi for updating Optimizely Commerce content.

I now need to upload assets using ServiceApi and this appears to be possible with the /episerverapi/commerce/import/assets endpoint. But, in our old system we specified the AssetKey explicitely for ease of mapping an asset from the source PIM system to the asset in Optimizely.

I do realize this is likely not a recommended way of working, but is there any way I specify this AssetKey in the call to /episerverapi/commerce/import/assets that is not immediately obvious?

Thanks in advance for any input here!

#312937
Nov 22, 2023 10:51
Vote:
 

For what its worth, I'll post a brief answer to this post in case someone else asks a similar question.

Important to note is that the asset import endpoint referenced above is an entry point to the Media service: https://docs.developers.optimizely.com/customized-commerce/v1.3.0-service-api-developer-guide/docs/media-service 

In brief, the endpoint can upload multiple assets in a single upload and should include and XML file defining how and what to import. Within this XML you can specify the IntegrationId property to indicate the id used in the source system. The XML definition can be seen here: https://docs.developers.optimizely.com/customized-commerce/v1.3.0-service-api-developer-guide/docs/media-service-xml

Also discussed in thread: https://world.optimizely.com/forum/developer-forum/commerce-14/thread-container/2023/11/importing-assets-via-serviceapi-and-assigning-to-entry/#315752

#315753
Jan 17, 2024 8:06
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.