1

I'm using the REST Files API, as documented here, to read the content of an Online Sharepoint (Office 365) site.

Is it possible to get the sub-sites the root site using this API?

I understand I can get a list of sub-sites using the traditional SharePoint API (https://<my-domain>.sharepoint.com/_api/site/rootWeb/webinfos), but I'd rather use the files API because I'm using it for other purposes as well.

(Note that the two APIs are very different. One example: getting the child-elements of a folder in the files API is done using GET {base-url}/Files/{folder-id}/children, which it's done using http://<site url>/_api/web/getfolderbyserverrelativeurl('/<folder name>')/folders in the 'classic' API).

In addition, once I get the list of sub-sites - using the above endpoint or any other means - is it possible to traverse / read these sub-sites using the files REST API?

2
  • This is the REST endpoint https://<my-domain>.sharepoint.com/_api/web/webinfos What sort of content are you intent on reading from the subsites?
    – Oxossi
    Commented Jul 18, 2015 at 15:53
  • I'd like to read all the documents and their content.
    – Roy2012
    Commented Jul 18, 2015 at 16:45

1 Answer 1

0

This is the REST endpoint https://<my-domain>.sharepoint.com/_api/web/webinfos

You can read the content of subsites by using the %site%/_api/web/ endpoint; e.g: %site%/_api/web/lists

Reference: https://msdn.microsoft.com/en-us/library/office/dn499819.aspx

2
  • Thanks, but this doesn't use the REST Files API I was referring to.
    – Roy2012
    Commented Jul 19, 2015 at 6:09
  • 1
    Try using https://<site url>/_api/web/GetFolderByServerRelativeUrl('/Folder Name')/Files('file name')/$value
    – nbi
    Commented Jul 19, 2015 at 20:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.