November Happy Hour will be moved to Thursday December 5th.

MartinOttosen
Apr 22, 2021
  2573
(7 votes)

Pushing content to Optimizely CMS

If you want to integrate external content sources into Optimizely CMS you are spoilt for choice, in fact it can be hard to figure out which approach to take. You could build a content provider, which provides the deepest integration, but is also the most complicated option. You could also use the import / export UI to handhold content packages between systems, and the service API has an endpoint for importing product content. You could of course also build your own controller or scheduled job to push or pull content using the .Net content repository or dynamic data store for simple objects you don’t need to interact with through the edit UI.

You could also take a look at the content management API which provides a handy REST API for basic content management tasks:

Want to create a new content object? Either PUT or POST the whole thing as JSON. Using PUT will upsert the object, replacing any existing object with matching id in one go.

{
  "name": "Alloy Track",
  "language": { "name": "sv" },
  "contentType": ["ProductPage"],
  "parentLink": { "id": 5 },
  "status": "CheckedOut",
  "metaTitle":  "Alloy track",
  "pageImage": {
    "id": 152,
    "workId": 0,
    "guidValue": "59e22d5b-b238-4185-85f8-338f4f29c93d",
    "providerName": null,
    "url": "/globalassets/alloy-track/alloytrack.png"
   }
}

 

The PATCH endpoints let you specify only the properties you care to change, and leaves the remaining properties as they are, which is e.g., useful  for publishing a draft object:

{
  "language": { "name": "en" },
  "status": "Published"
}

You could of course just publish an object immediately by setting “status”: “Published” while creating or upserting and object using POST or PUT.

If this has piqued your interest, there are more capabilities and usage examples to be found in the API fundamentals section, and a downloadable swagger specification in the REST API reference.

You may need to install or update the nuget package first and maybe check out the getting started section on world.

Apr 22, 2021

Comments

Praful Jangid
Praful Jangid Apr 22, 2021 01:26 PM

Nice post. I loved the new api and features included by the Optimizely.

Joe Mayberry
Joe Mayberry May 27, 2021 08:58 PM

Great post. I haven't had the oportunity to use these apis yet, but it's nice to know more about the options available.

Please login to comment.
Latest blogs
Optimizely SaaS CMS + Coveo Search Page

Short on time but need a listing feature with filters, pagination, and sorting? Create a fully functional Coveo-powered search page driven by data...

Damian Smutek | Nov 21, 2024 | Syndicated blog

Optimizely SaaS CMS DAM Picker (Interim)

Simplify your Optimizely SaaS CMS workflow with the Interim DAM Picker Chrome extension. Seamlessly integrate your DAM system, streamlining asset...

Andy Blyth | Nov 21, 2024 | Syndicated blog

Optimizely CMS Roadmap

Explore Optimizely CMS's latest roadmap, packed with developer-focused updates. From SaaS speed to Visual Builder enhancements, developer tooling...

Andy Blyth | Nov 21, 2024 | Syndicated blog

Set Default Culture in Optimizely CMS 12

Take control over culture-specific operations like date and time formatting.

Tomas Hensrud Gulla | Nov 15, 2024 | Syndicated blog