首页 文章

无法使用MS Graph API(beta)创建列表

提问于
浏览
2

我尝试执行那里描述的MS Graph API调用https://developer.microsoft.com/en-us/graph/docs/api-reference/beta/api/list_create

它是一个sharepoint站点列表的创建 .

我需要创建它以便能够使用MS图形API在我的sharepoint站点的根目录中创建文件夹 . 那里描述了我最初的要求和问题MS graph API sharepoint site. Create a folder in root

没有人提供解决方案 . 看起来在网站根目录中创建文件夹的唯一方法是使用此BETA API创建列表 .

但是,API无法按照文档中的说明运行 .

当我尝试做的时候

POST https://graph.microsoft.com/beta/sites/{site-id}/lists
Content-Type: application/json

{
  "name": "Books",
  "columns": [
    {
      "name": "Author",
      "text": { }
    },
    {
      "name": "PageCount",
      "number": { }
    }
  ],
  "list": {
    "template": "generic"
  }
}

我对该消息有错误响应

Cannot define a 'name' for a list as it is assigned by the server. Instead, provide 'displayName'

如果我在JSON文档中将“nme”更改为“displayName”,则错误为“其中一个提供的参数不可接受” .

我也试着设置

,"list":{"template":"documentLibrary"}

还是一样的错误

我做错了什么?或者说BETA API不起作用?

1 回答

相关问题