Do you enable MultiSiteFilteringEnabled option?
If enabled, Optimizely Content Delivery API returns only the contents of the current site based on the request context.
Do you use the correct Accept-Language header?
Content Delivery API returns content based on the language passed in the Accept-Language header. Use the Accept-Language header to specify the locale variant of content that the client prefers (see Mozilla - MDN Web Docs for more information).
The problem is some browsers, such as Chrome, automatically add its preferred language to the Accept-Language header, if the header value is not manually set by the user. In this case, the client should manually pass the Accept-Language header to prevent the browser from adding its own header value.
If you are using the Content Delivery API in an AJAX application, you can specify/override the Accept-Language header value in your front-end code. See this external blog post for a code sample.
- Have you registered Content Delivery API services?
To enable Content Delivery API endpoints, you need to call this line in your _Startup _file:
Make sure you have added the following lines at the bottom in Startup.cs file (see API authentication.
var application = new OpenIDConnectApplication()
ClientId = "client",
ClientSecret = "secret"
Use a property model converter (
IPropertyModelConverter) which lets you customize the output sent to the Content Delivery API. See an example in the Music Festival project. See also Serialization and How to customize data returned to clients.
Updated about 1 year ago