I need to retrieve Sitecore item fields and its properties with more than few levels and while running the below query
https://sc92instance/sitecore/api/ssc/aggregate/content/Items('76516a9f-203d-4006-b46e-a12fc87d8bc0')?$expand=Children($expand=Children($expand=Children,FieldValues), FieldValues), FieldValues
i get error. How can we increase MaxDepth of OData API in sitecore?
{
"error": {
"code": "",
"message": "The query specified in the URI is not valid. The request includes a $expand path which is too deep. The maximum depth allowed is 2. To increase the limit, set the 'MaxExpansionDepth' property on EnableQueryAttribute or ODataValidationSettings, or set the 'MaxDepth' property in ExpandAttribute."
}
}
https://sc92instance/sitecore/api/ssc/aggregate/content/Items('76516a9f-203d-4006-b46e-a12fc87d8bc0')/Children?$expand=Fields
. It looks your url string with query is not correct