使用 HTTP 请求将用户插入 SharePoint 组
Insert user into SharePoint group with HTTP request
我正在使用 HTTP 请求连接器将用户插入 SharePoint。在所有透明度中,这是使用 MS Flow/Power 自动化。
我有 URL 从 SharePoint 组读取用户。
https://我的公司.sharepoint.com/sites/planning-test/_api/web/SiteGroups/GetById(37)/用户
我的 header 构造为:
{
"accept": "application/json;odata=verbose",
"content-type": "application/json;odata=verbose"
}
请求正文构造为:
{
'_metadata':{'type':'SP.User'},
‘LoginName’:’i:0#.f|membership|dducolon@starbucks.com’
}
这是给我一个状态输出代码“400”
我收到一个详细的错误:
无效JSON。 属性 名称“”无效。一个名字
属性 不能为空。 clientRequestId:
f6aec2b4-822d-4a6e-90e9-f4aa0162d182 serviceRequestId:
b499689f-e0a8-0000-6122-5f43f6ec0327
有人知道为什么我会收到一条错误消息,说我的 属性 是空白的吗?
Image of "Send an HTTP request to SharePoint" in MS Flow
试试这个 body:
{
'__metadata': {
// Type that you are modifying.
'type': 'SP.User'
},
'LoginName': 'i:0#.f|membership|dducolon@starbucks.com'
}
你的引用有误,元数据前应该有两个_。
正文第二行的单引号似乎是反引号,而不是预期的 ' 引号。这来自 PowerAutomate UI.
中的复制粘贴
在我的例子中,由于额外的括号,我得到了完全相同的错误:
{
"__metadata": {
"type": "SP.Data.TestListListItem"
},
{
"Title": "dddd",
"AnotherColumn": "xxxx"
}
}
请注意,不应使用方括号括起列名及其值。
我正在使用 HTTP 请求连接器将用户插入 SharePoint。在所有透明度中,这是使用 MS Flow/Power 自动化。
我有 URL 从 SharePoint 组读取用户。
https://我的公司.sharepoint.com/sites/planning-test/_api/web/SiteGroups/GetById(37)/用户
我的 header 构造为:
{
"accept": "application/json;odata=verbose",
"content-type": "application/json;odata=verbose"
}
请求正文构造为:
{
'_metadata':{'type':'SP.User'},
‘LoginName’:’i:0#.f|membership|dducolon@starbucks.com’
}
这是给我一个状态输出代码“400”
我收到一个详细的错误:
无效JSON。 属性 名称“”无效。一个名字 属性 不能为空。 clientRequestId: f6aec2b4-822d-4a6e-90e9-f4aa0162d182 serviceRequestId: b499689f-e0a8-0000-6122-5f43f6ec0327
有人知道为什么我会收到一条错误消息,说我的 属性 是空白的吗?
Image of "Send an HTTP request to SharePoint" in MS Flow
试试这个 body:
{
'__metadata': {
// Type that you are modifying.
'type': 'SP.User'
},
'LoginName': 'i:0#.f|membership|dducolon@starbucks.com'
}
你的引用有误,元数据前应该有两个_。
正文第二行的单引号似乎是反引号,而不是预期的 ' 引号。这来自 PowerAutomate UI.
中的复制粘贴在我的例子中,由于额外的括号,我得到了完全相同的错误:
{
"__metadata": {
"type": "SP.Data.TestListListItem"
},
{
"Title": "dddd",
"AnotherColumn": "xxxx"
}
}
请注意,不应使用方括号括起列名及其值。