尝试使用主名使用所有者创建团队,这给出了错误的“未能找到使用用户主名”的用户。但是用户是365帐户的所有者

发布于 2025-01-28 11:06:13 字数 1506 浏览 4 评论 0原文

请求URL https://graph.microsoft.com/v1.0/teams

请求物体

{
    "[email protected]": "https://graph.microsoft.com/v1.0/teamsTemplates('standard')",
    "displayName": "Team22",
    "description": "My Sample Team’s Description",
    "members": [
        {
            "@odata.type": "#microsoft.graph.aadUserConversationMember",
            "roles": [
                "owner"
            ],
            "[email protected]": "https://graph.microsoft.com/v1.0/users('[email protected]')"
        }
    ]
}

响应代码404

响应预览


{
    "error": {
        "code": "NotFound",
        "message": "Failed to find users with user principal name '[email protected]'",
        "innerError": {
            "date": "2022-05-13T06:55:15",
            "request-id": "9df9a8fa-21cc-4455-b39f-ef1aca1d4b07",
            "client-request-id": "24d55bd6-3f77-b808-221e-3f1a7af7dd5a"
        }
    }
}

Request URL
https://graph.microsoft.com/v1.0/teams

Request Body

{
    "[email protected]": "https://graph.microsoft.com/v1.0/teamsTemplates('standard')",
    "displayName": "Team22",
    "description": "My Sample Team’s Description",
    "members": [
        {
            "@odata.type": "#microsoft.graph.aadUserConversationMember",
            "roles": [
                "owner"
            ],
            "[email protected]": "https://graph.microsoft.com/v1.0/users('[email protected]')"
        }
    ]
}

Response Code 404

Response Preview


{
    "error": {
        "code": "NotFound",
        "message": "Failed to find users with user principal name '[email protected]'",
        "innerError": {
            "date": "2022-05-13T06:55:15",
            "request-id": "9df9a8fa-21cc-4455-b39f-ef1aca1d4b07",
            "client-request-id": "24d55bd6-3f77-b808-221e-3f1a7af7dd5a"
        }
    }
}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

黑寡妇 2025-02-04 11:06:13

以下有效载荷对我有用:
参考文档: https://learn.microsoft.com/en-us/graph/graph/papi/team-post?view=graph=graph-rest-rest-1.0&amp.amp@amp@amp@amp@; tabs = http #example-9-application-permissions-used-user-user-principal-name

   "[email protected]":"https://graph.microsoft.com/v1.0/teamsTemplates('standard')",
   "displayName":"My Sample Team",
   "description":"My Sample Team’s Description",
   "members":[
      {
         "@odata.type":"#microsoft.graph.aadUserConversationMember",
         "roles":[
            "owner"
         ],
         "[email protected]":"https://graph.microsoft.com/v1.0/users('[email protected]')"
      }
   ]
}```

Keep in mind you can add only one owner at the time of Team creation using Graph API

The following payload worked for me:
Ref Doc: https://learn.microsoft.com/en-us/graph/api/team-post?view=graph-rest-1.0&tabs=http#example-9-application-permissions-using-user-principal-name

   "[email protected]":"https://graph.microsoft.com/v1.0/teamsTemplates('standard')",
   "displayName":"My Sample Team",
   "description":"My Sample Team’s Description",
   "members":[
      {
         "@odata.type":"#microsoft.graph.aadUserConversationMember",
         "roles":[
            "owner"
         ],
         "[email protected]":"https://graph.microsoft.com/v1.0/users('[email protected]')"
      }
   ]
}```

Keep in mind you can add only one owner at the time of Team creation using Graph API
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文