/sites/root/sites request returns 404 error "The Resource Cannot Be Found"

Viewed 858

If I use the GET statement: https://graph.microsoft.com/beta/sites/root/sites/ then it correctly returns a list of sub sites under my main SharePoint site. But if I add a new Team Site sub-site to my main site and then run the same command it now returns

{
    "error": {
        "code": "itemNotFound",
        "message": "The resource could not be found.",
        "innerError": {
            "request-id": "604af4de-b2b5-48cf-802b-1952a7d10b42",
            "date": "2017-10-07T16:56:48"
        }
    }
}

When I delete the new sub-site the GET statement works again. I thought it was an issue with my SharePoint site so I reported it to Office 365 SharePoint support. They get the same error. It happens with Graph v1.0 and beta but is not in the Known Issues list. I am trying to use this to get the Drive Id of a SharePoint library on a sub-sub site but cannot get past this issue on the problem sub-site. Is there any other way of getting a Drive Id of libraries on the sub-site that Graph at present seems unable to access?

3 Answers

Whilst the issue of Graph not being able to return a list of more than 7 sub-sites is still there, I have found a work around to enable me to get the Drive Ids of the Drives on the sub-sites. By using the /sites: /{sitepath} option (NB the colon) I was able to go directly to the required sub-sites and then get the relevant drive Ids.

I just wanted to follow up and say we have now made some improvements that should hopefully let these kinds of queries work past 7 subsites. So hopefully this issue is now resolved.

Workaround (v1.0 only) : use

https://graph.microsoft.com/v1.0/sites?search=*

as proposed here

Related