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

使用Power Automate为SharePoint列表项添加注释失败的问题排查

问题解答

1. 操作错误点

  • Uri拼写错误:报错提示找不到Commnets资源,说明你在Uri里把正确的Comments拼写成了Commnets(多了一个n,少了一个e),这是直接触发错误的原因。
  • 端点路径错误:即便修正拼写,直接调用/items(<Item ID>)/Comments发起POST请求也不符合SharePoint Online现代列表评论的API规范,该路径并非用于新增评论的正确端点。

2. 可用的API端点

以下两种API端点可用于添加列表项评论:

方法一:使用SP.Comments.CommentsUtility.AddComment

配置参数如下:

  • Method: POST
  • Uri: _api/SP.Comments.CommentsUtility.AddComment
  • Headers:
    • Content-Type: application/json;odata=verbose
    • Accept: application/json;odata=verbose
  • Body:
{
  "comment": "This is a comment.",
  "itemId": "<Item ID>",
  "listId": "<List GUID>",
  "serverRelativeUrl": "<Site Server Relative URL>"
}

说明:列表GUID可通过调用_api/web/lists/getbytitle('Project Tracker')获取返回结果中的Id字段;站点相对URL格式类似/sites/YourSiteName。

方法二:使用Social Feed API

配置参数如下:

  • Method: POST
  • Uri: _api/social.feed/my/feed/posts
  • Headers:
    • Content-Type: application/json;odata=verbose
  • Body:
{
  "restCreationData": {
    "__metadata": { "type": "SP.Social.SocialRestCreationData" },
    "contentText": "This is a comment.",
    "target": {
      "__metadata": { "type": "SP.Social.SocialLink" },
      "Uri": "<Full URL of the List Item>"
    }
  }
}

说明:列表项完整URL格式类似https://yourtenant.sharepoint.com/sites/YourSite/Lists/Project Tracker/DispForm.aspx?ID=<Item ID>。

3. 权限要求

你拥有列表的完全控制权限,已满足添加评论的核心权限要求。需额外确认两点:

  • Power Automate中使用的SharePoint连接账户,必须具备该列表的编辑或完全控制权限(若使用服务账户需单独验证权限)。
  • 列表的评论功能已开启:进入列表设置的「高级设置」,确认「允许评论」选项设置为「是」。

内容的提问来源于stack exchange,提问作者Asit Das

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.06.15 23:23:17