Getting certain properties from document libraries and SharePoint admin center

Dancing Strawberry 101 Reputation points
2021-04-14T23:13:18.387+00:00

Using the SharePoint REST API to get certain properties (Graph API didn't seem to provide the properties that I'm looking for):

  • "EnableVersioning" property; was able to get the property for document libraries on the default "Communication site". How can I get this same property for document-libraries of user-created sites? API call I used to get settings for default site libraries: "{site_url}/_api/web/lists?$filter=BaseTemplate eq 101"
  • Settings under the SharePoint admin center, screenshot provided:
    87919-image.png

Looking to get resources represented on this page; for example, the value for the duration to expiration for "Anyone links".

Could I get some guidance on REST API endpoints that could be used to get these resources?

Microsoft 365 and Office SharePoint For business Windows
Microsoft Security Microsoft Graph
0 comments No comments
{count} votes

Accepted answer
  1. MichaelHan-MSFT 18,126 Reputation points
    2021-04-15T02:24:48.923+00:00

    Hi @Dancing Strawberry ,

    1. It's the same as you get on the default "Communication site". For example: the site url is https://tenant.sharepoint.com/sites/test. The api call would be like this: https://tenant.sharepoint.com/sites/test/_api/web/lists?$filter=BaseTemplate eq 101&$select=EnableVersioning,Title .

    If you want to get the porperty for a specific library, you could use this api call :

    https://tenant.sharepoint.com/sites/test/_api/web/lists/getbytitle('Documents')  
    

    87994-image.png

    2.To get settings for SharePoint admin center, the api should be: https://tenant-admin.sharepoint.com/_api/Microsoft.Online.SharePoint.TenantManagement.Office365Tenant

    The property RequireAnonymousLinksExpireInDays is the duration to expiration for "Anyone links".


    If an Answer is helpful, please click "Accept Answer" and upvote it.
    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.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.