I have a page in Episerver / Optimizely, with a page that has some blocks, but I want to access the blocks through https://localhost:5000/api/episerver/v3.0/content/57 (whith episerver content delivery api), but the blocks won't follow. Is it possible to return the blocks with the page?
Get page's blocks in EPiServer Content delivery API
592 Views Asked by Axel_s At
2
There are 2 best solutions below
1

Strangely enough, for me using expand does work but I can't even access a page by calling its id. I get a 404 response from the call if I try something like:
https://localhost:5000/api/episerver/v3.0/content/5&expand=*
And if I try to call a none existing id, I get a 500 response.
But if I assign a friendly url (ie: start
) to my page whose id is 5, I can call it through that:
https://localhost:5000/api/episerver/v3.0/content?ContentUrl=start&expand=*
This is an ODATA api, you'll need to tell it to expand the properties you want to see
To expand everything
To expand a certain property
Comma separate properties to expand if multiple
Optimize your query by using select (you should)