You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

SharePoint REST API是否支持SP.ObjectSharingInformation.getObjectSharingInformation方法?

Can I use SP.ObjectSharingInformation.getObjectSharingInformation via SharePoint REST API to get list shared users?

Great question! Let's break this down clearly: There isn't a direct 1:1 REST API equivalent for the SP.ObjectSharingInformation.getObjectSharingInformation JSOM method, but you absolutely can retrieve the list of users a SharePoint list is shared with using alternative REST endpoints that deliver the same (or even more) relevant information.

Here are two reliable approaches to get the shared user list for your SharePoint list:

1. Use Role Assignments to retrieve all authorized users/groups

This endpoint gives you a full breakdown of all role assignments on the list, including the users/groups and their associated permissions. You can filter this data to extract your shared users list.

Example REST Request

GET /_api/web/lists/getbytitle('YourListName')/roleAssignments?$expand=Member,RoleDefinitionBindings

What this returns:

  • Each entry in the response includes a Member object (either a user or SharePoint group) and RoleDefinitionBindings that detail the permission level (like "Edit", "Read") assigned to that member. You can parse this to extract only user entries and their corresponding access levels.

2. Use the getSharingInformation method (SharePoint 2013+)

This method is designed specifically to return sharing-related details, mirroring much of what the JSOM SP.ObjectSharingInformation.getObjectSharingInformation method provides. It requires a POST request with a body specifying which details you want to include.

Example REST Request

POST /_api/web/lists/getbytitle('YourListName')/getSharingInformation
Content-Type: application/json;odata=verbose

Request Body

{
  "request": {
    "__metadata": { "type": "SP.SharingInformationRequest" },
    "IncludeAnonymousLinks": false,
    "IncludeUserInfo": true,
    "IncludePermissions": true
  }
}

What this returns:

  • A response containing properties like SharedUsers (an array of user objects with their permission details), HasUniquePermissions, and other sharing-related metadata. This is the closest you'll get to the output of the JSOM method you mentioned.

Both approaches work well depending on your needs—if you want a full view of all permissions (including groups), go with the role assignments endpoint. If you want a focused set of sharing-specific data, getSharingInformation is your best bet.

内容的提问来源于stack exchange,提问作者Jesse Lynn

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.27 09:28:31