Episerver Content Delivery API empowers you to expose your content via HTTP protocol. This enables  Recently Episerver enterprises to use their content in the mobile apps or any third party which needs the content of your website. Episerver released a beta version of Content Delivery API recently and can be used via Nuget Package. This would be a big step for Episerver to add the ability to Enterprises to go toward the concept of Content as a Service (CaaS).

What features does it have? It allows you to expose all content of your site via HTTP using JSON

That scary!? Na, you already exposing your content via HTTP using a browser! That is correct, some content is restricted content and should be exposed to all and that is facilitated by authenticating users via OAuth.

Query the content, that could be slow? The API will leverage Episerver Find to query the content and this means query will be run efficiently without affecting your website performance.

Mmm..So what I need to have to start? It is quite simple, create new Episerver Alloy Sample and go through below steps:

In this stage Episerver Content Delivery API would be just one package but I expect this would be change

  1. Register a new Episerver Find service and put the content into the sample website
  2. Install Content Delivery API Nuget Package
     Install-Package EPiServer.ContentDeliveryApi
  3. Add below code to your ‘ConfigureContainer’ function:
    context.InitializeContentApi();
    context.InitializeContentSearchApi();
    
    GlobalConfiguration.Configure(config =>
    {
        config.IncludeErrorDetailPolicy = IncludeErrorDetailPolicy.LocalOnly;
        config.Formatters.JsonFormatter.SerializerSettings = new JsonSerializerSettings();
        config.Formatters.XmlFormatter.UseXmlSerializer = true;
        config.DependencyResolver = new StructureMapResolver(context.StructureMap());
        config.MapHttpAttributeRoutes();
        config.EnableCors();
    });

     

Leave a Reply

Your email address will not be published. Required fields are marked *