We’re currently working on a project for one of our clients whereby as part of this we need to migrate large sets of content pages and media assets from Sitecore over to Optimizely CMS 12.
As part of this we’ll be using the new Content Management APIs as apposed to the ContentRepositories method available in V11, which makes this much easier.
We’re currently working on a project for one of our clients whereby as part of this we need to migrate large sets of content pages and media assets from Sitecore over to Optimizely CMS 12.
As part of this we’ll be using the new Content Management APIs as apposed to the ContentRepositories method available in V11, which makes this much easier.
However, when it came to work with the media content and use the API to import the this into the CMS 12 I couldn’t get this to work, even when following Optimizely’s documentation (https://docs.developers.optimizely.com/content-cloud/v1.6.0-content-management-api/docs/api-fundamentals) I search loads of forums, Stack Overflow, and the only post I could find was this (https://world.optimizely.com/forum/developer-forum/CMS/Thread-Container/2021/11/importing-assets-and-media-files-to-optimizely-through-api/) which gave me a starting point, however this was for commerce and for V11 not 12.
I have since now, been able to mock up a solution, so thought it would be good to share this,
my code:
New Imported media asset using the Content Managment API.
One thing to note, this is only supported in Content Managment API 3.4.x
Hope this helps anyone else that has come across the same problem.