Hi @Jyoti Kale ,
Thank you for posting in this community.
To retrieve the root site and all subsites of a SharePoint site collection using the REST API, you can follow these steps:
- Fetch the Root Site: Use the following endpoint to get the root site of the site collection:
GET https://{site_url}/_api/site
- Fetch All Subsites of a SharePoint site collection: To retrieve all subsites, you can use the following endpoint:
GET https://{site_url}/_api/web/webs
Output:
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.