【问题标题】:Adding permissions on SharePoint ListItem using Graph API使用图形 API 在 SharePoint ListItem 上添加权限
【发布时间】:2022-01-04 01:46:45
【问题描述】:

有没有办法使用 Grpah API 在 SharePoint ListItem 上添加权限或将 ListItem 共享给其他用户?

https://docs.microsoft.com/en-us/graph/api/resources/listitem?view=graph-rest-1.0

类似于我们在 DriveItems https://docs.microsoft.com/en-us/graph/api/driveitem-invite?view=graph-rest-1.0&tabs=http 上的那个

【问题讨论】:

  • 请编辑问题以将其限制为具有足够详细信息的特定问题,以确定适当的答案。

标签: sharepoint microsoft-graph-api


【解决方案1】:

请使用以下端点添加权限

POST /sites/{siteId}/drive/items/{itemId}/invite
Content-type: application/json

{
  "recipients": [
    {
      "email": "ryan@contoso.com"
    }
  ],
  "message": "Here's the file that we're collaborating on.",
  "requireSignIn": true,
  "sendInvitation": true,
  "roles": [ "write" ],
  "password": "password123",
  "expirationDateTime": "2018-07-15T14:00:00.000Z"
}

【讨论】:

  • 谢谢@RaytheonXie-MSFT。我已经为 ListItem 看到并尝试过这个并且正在抛出 belo 错误。似乎端点适用于 DriveItems 但不适用于 ListItems。 Status Code: BadRequest Microsoft.Graph.ServiceException: Code: invalidRequest Message: Cannot request driveItem for an item that is not in a document library我想知道我们是否有办法使用 ListItems。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2020-10-22
  • 2017-08-20
  • 1970-01-01
  • 2020-05-09
相关资源
最近更新 更多