0

I have a sharepoint site hosted at:

https://xxxxx.sharepoint.com, which has a subsite named abc

when I type in https://xxxx.sharepoint.com/abc in the browser, it redirects to the welcome page of the subsite automatically, which is https://xxxxx.sharepoint.com/abc/Pages/Home.aspx.

But when I try to access this subsite using postman, it does not redirects to the welcome page by itself, even if I try to access the welcome page like this:

https://graph.microsoft.com/v1.0/sites/xxxx.sharepoint.com/abc/Pages/Home.aspx,

it gives me the error:

{
    "error": {
        "code": "BadRequest",
        "message": "Resource not found for the segment 'abc'.",
        "innerError": {
            "request-id": "59ba6f24-2411-444c-b1f8-247d874f6543",
            "date": "2020-02-28T06:19:11"
        }
    }
}

How to let postman redirect rest WS requests directly to the Hompage of the sharepoint site? and be able to see its html response?

Kiran Mistry
  • 2,614
  • 3
  • 12
  • 28
  • https://thebitguru.com/blog/1429-to-automatically-follow-redirects-or-not – Bill Horvath Feb 28 '20 at 06:27
  • Automatically follow redirects option is automatically enabled in postman, even after disabling it, I get this error: { "error": { "code": "BadRequest", "message": "Resource not found for the segment 'abc'.", "innerError": { "request-id": "27ba9f04-9ab8-4a79-8670-054e66a91cd6", "date": "2020-02-28T07:15:10" } } } – Surbhi Babbar Feb 28 '20 at 07:16

1 Answers1

0

It seems that you want to use Microsoft Graph REST API to access your sharepoint site.

Just as the API documentation shows:

The SharePoint API in Microsoft Graph supports the following core scenarios:

  1. Access to SharePoint sites, lists, and drives (document libraries)
  2. Read-only support for site resources (no ability to create new sites)
  3. Read-write support for lists, listItems, and driveItems
  4. Addressresources by SharePoint ID, URL, or relative path

With REST API, you can only manage it with REST style. It will not redirect you to your sharepoint site.

Jack Jia
  • 5,268
  • 1
  • 12
  • 14
  • I actually need to get the html of the home page, like the way we can hit the page in browser and click on View source, and see its html. If graph is not able to support it, what else can be done to view the html? – Surbhi Babbar Mar 04 '20 at 07:46
  • You may set postman to automatically follow the redirect requests. And then access your sharepoint site url. – Jack Jia Mar 04 '20 at 11:48