I am trying to get all subsites from a parent web using REST API. I tried following query which shows "The page cannot be found".



Suppose, your site url is like this: http://yourcompany.com/sites/projects

Then in order to get sus site under projects site use:


Suppose you have site under projects named "Project1" and you want to find subsite under it, then use:

| improve this answer | |
  • thanks, unfortunately the url can be changed. I wanted to get all siblings by going up one step and get all subsites. – Medes Mar 10 '14 at 8:37

The following REST endpoint


will return the collection of sub webs (WebInfo objects) under root web

Using Search REST API

The following REST query demonstrates how to find all webs under the specified path:

| improve this answer | |
  • thanks, this piece of code is running almost everywhere and I want to get all siblings by going up only one step and get all subsites. – Medes Mar 10 '14 at 8:35
  • Medes,in that case you could utilize search based approach in order to return all webs, the answer has been updated. – Vadim Gremyachev Mar 10 '14 at 8:52
  • yes, still I need to have a dynamic value of "Path"? am I right? – Medes Mar 10 '14 at 9:03
  • it depends, you could specify site collection path (static), or if needed to return results relative to specific parent web, then path should be constructed (dynamic) – Vadim Gremyachev Mar 10 '14 at 9:17
  • Vadim, I tested your query but it didn't work, – Medes Mar 10 '14 at 10:30

For up to date list (contrary to search) that also works for users with read-only permissions (contrary to /_api/web/webs), use this REST api:

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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