首先,我尝试在创建群组的同一个http调用中同时添加群组所有者,所有者和成员:
{
"description": "test group",
"displayName": "test_group",
"groupTypes": [
"Unified"
],
"mailEnabled": true,
"mailNickname": "project.1-TestPreview",
"members@odata.bind": [
"https://graph.microsoft.com/v1.0/users/{id}"
],
"owners@odata.bind": [
"https://graph.microsoft.com/v1.0/users/{id}"
],
"securityEnabled": false,
"visibility": "private"
}
已成功将用户添加为成员和所有者,但没有收到欢迎电子邮件。
然后我尝试拆分http呼叫,以为在添加用户的同时创建群组时,电子邮件存在问题。
我创建了一个组,在创建组http调用中添加了一个用户(与上述相同),并在创建组后约30秒将另外三个用户添加为所有者和成员。为此,我使用了
查询:
{
"type": "POST",
"url": "https://graph.microsoft.com/v1.0/$batch"
}
身体
{
"requests": [
{
"body": {
"@odata.id": "https://graph.microsoft.com/v1.0/users/{id}"
},
"headers": {
"Content-Type": "application/json"
},
"id": "1",
"method": "POST",
"url": "groups/{id}/members/$ref"
},
{
"body": {
"@odata.id": "https://graph.microsoft.com/v1.0/users/{id}"
},
"headers": {
"Content-Type": "application/json"
},
"id": "2",
"method": "POST",
"url": "groups/{id}/members/$ref"
},
{
"body": {
"@odata.id": "https://graph.microsoft.com/v1.0/users/{id}"
},
"headers": {
"Content-Type": "application/json"
},
"id": "3",
"method": "POST",
"url": "groups/{id}/members/$ref"
}
]
}
我使用相同的方法将用户添加为所有者。他们都没有收到欢迎电子邮件。如何确保电子邮件能够触发?
答案 0 :(得分:-1)
您需要适当的Microsoft 365,Office 365或Exchange许可证。你有一个吗?