Sitecore Omni: Sitecore APIs Explained

Whether you are looking to leverage the headless CMS capabilities of Sitecore XP or simply looking to federate content and presentation via Sitecore's APIs, Sitecore Omni has exactly what you are looking for.

Sitecore Omni

Peeling the layers behind Sitecore Omni, here is everything you can get from Sitecore XP.

Sitecore APIs

For the purpose of this post, I will focus on the API layer of Sitecore. Sitecore provides the following APIs:


  1. Sitecore Services Client API
  2. Sitecore GraphQL API
  3.  Sitecore Layout Services API

Sitecore Services Client API

  • Uses ASP.NET Web API as foundation for a RESTful API.
  • Provide ItemService (Sitecore content items) and EntityService (custom business objects).
  • Allows execution of Sitecore Search.

Pros

  • Available OOTB in older and newer versions of Sitecore XP.
  • Provides read-only access to content item as JSON OData. No server-side code needed.
  • Provide RESTful API for CRUD operations on items and executing Sitecore Search queries.
  • Supports authentication and authorization.
  • No extra licensing cost.
  • Support request throttling (limit frequency of requests) & CORS.

Cons


  • Can be inefficient with bulky payload offering full content item definition instead of fetching a custom schema definition.
  • Can tend to be slower in performance depending on the usage.

Sitecore's GraphQL API


  • Sitecore GraphQL API is a generic GraphQL service platform on top of Sitecore.
  • Aimed at front-end development for SPA, PWAs, mobile apps.

Pros

  • Efficient and modern API returning light-weight response for queried data. Eliminated data over-fetching.
  • Help avoid the need for large number of RESTful API calls.
  • Better performance, saves bandwidth with advanced features like query batching.
  • Built-in schema introspection makes GUI query authoring tools, self-documentation, static analysis, and API mocking capabilities possible.
  • More maintainable than REST APIs and easily discoverable and queryable.
  • Seems to be the future of APIs and tends to replace traditional RESTful services.

Cons

  • Difficult to move from GraphQL to another technology.
  • Takes longer to build.
  • Comes as a paid add-on from Sitecore. (Please confirm with your Sitecore rep).

Sitecore's Layout Service

  • It is a REST endpoint providing data for Sitecore JSS apps.
  • Provides page layout (presentation) as structured data (JSON).
  • Supports Sitecore’s personalization, A/B & multivariate testing and Experience Editor.
  • Supports working with modern JavaScript frameworks & libraries like React, Angular and Vue.
  • Provides support for full headless architecture.
  • Requires additional licensing from Sitecore. (Please confirm with your Sitecore rep).

Comments

Popular posts from this blog

Is Rendered Item Valid XHtml Document Could not find schema information warnings during publish item Sitecore 7.2

RESOLVED: Solr Exceptions - Document contains at least one immense term in field

First look at Sitecore XM Cloud: Part 4 - Creating a new Site