Quantcast
Channel: Using Optimizely Platforms
Viewing all articles
Browse latest Browse all 8020

Struggling with the basics

$
0
0

Hi All,

Can anyone help me out here? Essentially I am getting a load of 404 errors and I don't understand why.

What I've done so far

installed 

<package id="EPiServer.ContentDeliveryApi.Cms" version="2.14.0" targetFramework="net472" />
<package id="EPiServer.ContentDeliveryApi.Core" version="2.14.0" targetFramework="net472" />

I've added a initialisation module and added:

config.Default()
.SetMinimumRoles(string.Empty)
.SetSiteDefinitionApiEnabled(true);

I've launched the site locally and in the CMS configured the permissions for the ContentApiRead role to have Read access to my site's startpage and set all decendants to inherit those access rights.

What I am experiencing

navigate to /api/episerver/v2.0/site/ and I am returned my site definition JSON as expected.

from that returned data I can see my site and within 'contentRoots'> 'startPage' is can see the content reference id, lets say it' 49747. So my next api call would be for the content of that startpage. There is some data in properties of the startpage that I want to use.

navigate to /api/episerver/v2.0/content/49747/ and I get a 404. Odd. At some point I'll want to get all the pages that exist under the start page anyway, so lets carry on.

navigation to /api/episerver/v2.0/content/49747/children/ and I get a response of []. Even though there are child pages under the startpage.

Upon further digging:

when I navigate to /api/episerver/v2.0/content/ for different kinds of content, I get different results. for example:

for pages = 404
for blocks = 404
for folders = yes, proper JSON response
for files = yes, same for files

/api/episerver/v2.0/content/{page content ref}/children/ = []
/api/episerver/v2.0/content/{folder content ref}/children/ = yes

So am I just misunderstanding the API or have I forgotten to configure something? 

Really appreciate a steer on this!

Alex


Viewing all articles
Browse latest Browse all 8020

Trending Articles