我刚刚通过管理中心创建了一个自定义团队模板,然后复制了teamplateid 然后尝试使用图API来请求新的团队网站,但失败了。 我的请求正文是
{
"template@odata.bind":"https://graph.microsoft.com/v1.0/teamsTemplates('xxxxxxxxx-a6b0-4bd5-8a4e-dabf9bb4b702')",
"displayName":"My Sample Team1",
"description":"My Sample Team’s Description",
"visibility": "Public",
"members":[
{
"@odata.type":"#microsoft.graph.aadUserConversationMember",
"roles":[
"owner"
],
"userId":"xxxxxxxx-f0a3-4105-b41e-1ba89f05911c"
}
]
}
遇到此错误
{
"error": {
"code": "BadRequest",
"message": "Failed to execute Templates backend request CreateTeamFromTemplateRequest. Request Url: https://teams.microsoft.com/fabric/emea/templates/api/team, Request Method: POST, Response Status Code: BadRequest, Response Headers: Strict-Transport-Security: max-age=2592000\r\nx-operationid: c9ea1a0ae318f144b5b2fa88663f7d2a\r\nx-telemetryid: 00-c9ea1a0ae318f144b5b2fa88663f7d2a-ff60c4978218794d-00\r\nX-MSEdge-Ref: Ref A: 9406390A3B7E4E3C8408DC1F620A6AE5 Ref B: DB3EDGE1021 Ref C: 2020-11-12T09:09:34Z\r\nDate: Thu, 12 Nov 2020 09:09:33 GMT\r\n, ErrorMessage : {\"errors\":[{\"message\":\"A template with id 'ffc586b1-a6b0-4bd5-8a4e-dabf9bb4b702' and locale 'en-US' could not be found.\"}],\"operationId\":\"c9ea1a0ae318f144b5b2fa88663f7d2a\"}",
"innerError": {
"date": "2020-11-12T09:09:34",
"request-id": "7d148a1c-6de7-42c6-9580-760bcc56eecf",
"client-request-id": "7d148a1c-6de7-42c6-9580-760bcc56eecf"
}
}
}
通过使用默认模板并复制basetemplateid,我可以成功提交请求。 但是不能使用自定义模板ID!