HomeDev GuideAPI Reference
Dev GuideAPI ReferenceUser GuideGitHubNuGetDev CommunitySubmit a ticketLog In
GitHubNuGetDev CommunitySubmit a ticket

Get started with Content Definitions API

Explains how to install and configure the Optimizely Content Definitions API.

The Optimizely Content Definitions API is a REST API that lets system integrators and external clients remotely manage definitions, such as Content types, Property Groups, and Property Data Types without deploying code to the Optimizely application or using the admin user interface. Changes made through this API are reflected in the admin user interface and vice versa.

📘

Note

All settings available in the admin UI are not available through the API yet. For example, you cannot not manage websites, languages, or translations.

Conflicts could affect existing content because changes could be made to the same content types but from different sources. To reduce the risk of conflicts, you should add version information to the content types. This can be done per content type or for all content types. See Semantic versioning.

Install

Install the EPiServer.ContentDefinitionsApi NuGet package from the NuGet feed.

Configure

The Optimizely Content Definitions API has the ContentDefinitionsApiOptions class (located in the EPiServer.ContentDefinitionsApi namespace) where you can configure the API. In startup.cs enable and configure the API with the following code:

public void ConfigureServices(IServiceCollection services) {
  services.AddContentDefinitionsApi("authenticationscheme", options => {
    // Configure options
  });
}

Security

The Content Definitions API uses claims-based authorization, and you should use OpenID Connect and Bearer Tokens (JWT) to authorize the requests. See Authenticate the API.

By default, the API requires the scope claim epi_content_definitions but you can configure it to use any scope or claim type. ContentDefinitionsApiOptions contains the setting AllowedScopes and ScopeClaimType where you can specify which scopes are required to call this API and the scope claim type name to use.

Additional resources