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
- Content types – Contains detailed descriptions and instructions on communicating with the API and its different endpoints for managing content types.
- Content Definitions Manifest – Contains detailed descriptions and instructions on communicating with the API and its different endpoints for content definitions manifest.
- Content Definitions REST API 3.4.0 reference and Content Definitions REST API 3.0.0 reference – (OpenAPI/Swagger) documentation. Automatically generated documentation from the source code contains descriptions of the endpoints and models used for reference purposes.
Updated 7 months ago