Forum Discussion
Christoph Weste
Apr 13, 2021Copper Contributor
create group / team is failing with error 400 bad request
hey Guys, I hope someone can push me into the right direction. I having trouble to create a MS teams team via the graph API. I constantly get error 400 Bad request. the wired thing is that I on...
taylosa
Apr 16, 2021Copper Contributor
Hi Christoph,
Interestingly I am also experiencing this issue within our M365 tenant. This has only been a problem for the last few days aswell, which would indicate an issue being present.
Would be interested to hear what Microsoft have to say about this.
Kind regards,
Sam
Interestingly I am also experiencing this issue within our M365 tenant. This has only been a problem for the last few days aswell, which would indicate an issue being present.
Would be interested to hear what Microsoft have to say about this.
Kind regards,
Sam
Christoph Weste
Apr 16, 2021Copper Contributor
hey Sam,
its working now! I think there was a problem in the backend. I got the advice to look deeper into that error response which is not so easy in PowerShell.
So used postman to see if I could get more information.
If I used my custom template, I got the following error
A template with id 'myTemplateID' and locale 'en-US' could not be found
Even if I changed the ID to standard I got an error ... very odd.
And this behavior is gone since yesterday .. So for me its working as expected .
I am not sure if you are using Powershell for your post but I do and I forgot to put -ContentType "application/json" into my invoke-webrequest
Also not sure why this was needed for one tenant but not for the other... make no sence
$requestBody = @"
{
"template@odata.bind": "https://graph.microsoft.com/v1.0/teamsTemplates('f78f97a1-7e03-47db-90e9-421859bc7d71')",
"displayName": "$team_displayname",
"description": "$team_description",
"visibility": "Public",
"owners@odata.bind": [
"https://graph.microsoft.com/v1.0/users/<ownerID>"
]
}
"@
$result = Invoke-WebRequest -Method POST -Uri "https://graph.microsoft.com/beta/teams" -Body $requestBody -Headers $headers -ContentType "application/json"
So my advice give it a shot on your end again 🙂
Have a nice weekend
Christoph