【发布时间】:2020-03-26 07:15:20
【问题描述】:
是否可以通过 REST API 批量创建用户。与我们在以下 URL 中为单个用户所做的相同。
https://graph.windows.net/{MYADB2C}.onmicrosoft.com/users?api-version=1.6
我们通过 Azure 门户进行了配置,但无法使用 REST API 找到任何内容。
更新 批处理的示例请求
POST https://graph.windows.net/{}.onmicrosoft.com/$batch?api-version=1.6
Headers :
Authorization : {token}
Content-Type : multipart/mixed; boundary=changeset_***********
Body :
{
"requests": [
{
"id": "1",
"method": "POST",
"url": "/users",
"body": {
"accountEnabled": true,
"creationType": "LocalAccount",
"displayName": "test1@gamil.com",
"passwordPolicies": "DisablePasswordExpiration, DisableStrongPassword",
"passwordProfile": {
"password": "***",
"forceChangePasswordNextLogin": false
},
"signInNames": [
{
"type": "emailAddress",
"value": "test1@gamil.com"
}
]
},
"headers": {
"Content-Type": "application/json"
}
},
{
"id": "2",
"method": "POST",
"url": "/users",
"body": {
"accountEnabled": true,
"creationType": "LocalAccount",
"displayName": "test2@gmail.com",
"passwordPolicies": "DisablePasswordExpiration, DisableStrongPassword",
"passwordProfile": {
"password": "***",
"forceChangePasswordNextLogin": false
},
"signInNames": [
{
"type": "emailAddress",
"value": "test1@gamil.com"
}
]
},
"headers": {
"Content-Type": "application/json"
}
}
]
}
【问题讨论】:
标签: azure rest azure-active-directory