HomeGuidesAPI Reference
Submit Documentation FeedbackJoin Developer CommunityOptimizely GitHubOptimizely NuGetLog In

Getting started with Content Definitions API

This topic explains how to install and configure the Optimizely Content Definitions API.

Installation

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

Configuration

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

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

Security

The Content Definitions API uses claims-based authorization, and we recommend using OpenID Connect and Bearer Tokens (JWT) to authorize the requests, see API authentication.

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 what the scope claim type name to use.