【发布时间】:2019-11-01 22:29:56
【问题描述】:
我的公司目前在我们的 O365 租户上托管了客户端 SharePoint 网站,以前每当在船上购买新客户端时,我们都会使用 GUI 或 Powershell 为他们创建一个 SharePoint 网站,但为了让事情变得更简单从长远来看更容易我现在正在尝试为任何加入我们的新客户自动创建网站 - 从历史上看,所有网站的设计都相同,结构或多或少相同,唯一的区别是文件本身.我已经设法通过流程(创建网站、中心网站链接、网站所有权、组成员资格、外部访问等)自动化了大部分 SharePoint 网站创建,但我在新创建文档库时遇到了问题创建的网站。总共有 8 个库,虽然我实际上已经弄清楚了如何使用“向 SharePoint 发送 HTTP 请求”操作单独创建它们(我对 Flow 和所有这些都很陌生!),我想尝试并改用 MS Graph 和 JSON 批处理,因此我可以在一个 API 调用中创建所有 8 个库。
我已经在 MS Graph Explorer 上测试了我的 JSON,它可以正常工作并按预期在指定的客户端站点上创建库,但是当我尝试通过 Flow 执行此操作时,我收到以下错误,但我没有确定我哪里错了:
错误消息单独列出了标题,但我不确定问题是什么? 请参阅下面的流中的 HTTP 操作:
{
"inputs": {
"method": "POST",
"uri": "https://graph.microsoft.com/v1.0/$batch",
"headers": {
"content-type": "application/json;odata=verbose",
"authorization": "@{body('Parse_JSON')?['token_type']} @{body('Parse_JSON')?['access_token']}"
},
"body": {
"requests": [
{
"id": "1",
"method": "POST",
"url": "/sites/devsite.sharepoint.com:/sites/BSS:/lists",
"body": {
"displayName": "Management",
"list": {
"template": "documentLibrary"
}
},
"headers": {
"content-type": "application/json"
}
},
{
"id": "2",
"method": "POST",
"url": "/sites/devsite.sharepoint.com:/sites/BSS:/lists",
"body": {
"displayName": "Employees",
"list": {
"template": "documentLibrary"
}
},
"headers": {
"content-type": "application/json"
}
},
{
"id": "3",
"method": "POST",
"url": "/sites/devsite.sharepoint.com:/sites/BSS:/lists",
"body": {
"displayName": "Work Activities",
"list": {
"template": "documentLibrary"
}
},
"headers": {
"content-type": "application/json"
}
},
{
"id": "4",
"method": "POST",
"url": "/sites/devsite.sharepoint.com:/sites/BSS:/lists",
"body": {
"displayName": "Work Equipment",
"list": {
"template": "documentLibrary"
}
},
"headers": {
"content-type": "application/json"
}
},
{
"id": "5",
"method": "POST",
"url": "/sites/devsite.sharepoint.com:/sites/BSS:/lists",
"body": {
"displayName": "Substances",
"list": {
"template": "documentLibrary"
}
},
"headers": {
"content-type": "application/json"
}
},
{
"id": "6",
"method": "POST",
"url": "/sites/devsite.sharepoint.com:/sites/BSS:/lists",
"body": {
"displayName": "Workplaces",
"list": {
"template": "documentLibrary"
}
},
"headers": {
"content-type": "application/json"
}
},
{
"id": "7",
"method": "POST",
"url": "/sites/devsite.sharepoint.com:/sites/BSS:/lists",
"body": {
"displayName": "HR",
"list": {
"template": "documentLibrary"
}
},
"headers": {
"content-type": "application/json"
}
},
{
"id": "8",
"method": "POST",
"url": "/sites/devsite.sharepoint.com:/sites/BSS:/lists",
"body": {
"displayName": "Quality",
"list": {
"template": "documentLibrary"
}
},
"headers": {
"content-type": "application/json"
}
}
]
}
}
}
谁能提供任何见解?
谢谢!
【问题讨论】:
-
您能否更新您的问题并从
Peek code选项添加 HTTP 操作的完整 JSON 表示? -
嗨 - 查看更新的问题!
标签: json sharepoint microsoft-graph-api flow power-automate