Unable to access the Sharepoint List using Microsoft Graph API--

后端 未结 3 1268
你的背包
你的背包 2020-12-18 07:26

Working with the Microsoft graph api and especially the sharepoint beta api and i am constantly running into issues. I know its beta, but still;)

SO the issue is Whe

3条回答
  •  旧巷少年郎
    2020-12-18 08:06

    @Ryan Gregg has the correct answer

    The SiteId is not just one GUID but a combination of .

    Example:

    The whole string in the above example is what you should pass for {SiteId} in your request

    If you dont have the SPSite.ID but have the URL for the site, you can make a GRAPH API call with relative path to the site

    https://graph.microsoft.com/v1.0/sites/contoso.sharepoint.com:/sites/Documetation
    

    This call will return all the properties for the site and you can grab the full SiteId from here:

    {
        "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#sites/$entity",
        "createdDateTime": "2020-04-23T12:18:48.653Z",
        "description": "Documentation",
        "id": "contoso.sharepoint.com,fc016e3c-d8ae-4ee0-a10c-de6d26788b6a,9a4ea7a5-c3c4-44ae-9f80-273bd67431b8",
        "lastModifiedDateTime": "2020-12-09T19:17:21Z",
        "name": "Documentation",
        "webUrl": "https://contoso.sharepoint.com/sites/Documentation",
        "displayName": "Documentation",
        "root": {},
        "siteCollection": {
            "hostname": "contoso.sharepoint.com"
        }
    }
    

提交回复
热议问题