Create Team in Graph API returns BadRequest: Unable to read JSON request payload.


Description

When attempting to Create Team using the Graph API, the action results in the message:

"code": "BadRequest",
"message": "Unable to read JSON request payload. Please ensure Content-Type header is set and payload is of valid JSON format.",


This is also present when using the OOTB payload from Create Team in a REST client such as Postman.  The default payload being used is:


Method "PUT"

Headers
[{"attributes":{"omit_if_empty":false},"name":"Content-Type","value":"application/json"}]

Payload
{
"memberSettings": {
"allowCreateUpdateChannels":,
"allowDeleteChannels": ,
"allowAddRemoveApps": true,
"allowCreateUpdateRemoveTabs": true,
"allowCreateUpdateRemoveConnectors":
},
"guestSettings": {
"allowCreateUpdateChannels": ,
"allowDeleteChannels":
},
"messagingSettings": {
"allowUserEditMessages": true,
"allowUserDeleteMessages": true,
"allowOwnerDeleteMessages": true,
"allowTeamMentions": true,
"allowChannelMentions": true
},
"funSettings": {
"allowGiphy": true,
"giphyContentRating": "Strict",
"allowStickersAndMemes": true,
"allowCustomMemes": true
}
}

Release or Environment

Orlando Patch 7

Resolution

Resolved this by limiting the payload and making a change to the endpoint used as follows:

Modified (working) Create Teams:

Method "PUT"

Endpoint: https://graph.microsoft.com/v1.0/groups/${groupID}/team

Payload
{
"memberSettings": {
"allowCreatePrivateChannels": true,
"allowCreateUpdateChannels": true
},
"messagingSettings": {
"allowUserEditMessages": true,
"allowUserDeleteMessages": true
},
"funSettings": {
"allowGiphy": true,
"giphyContentRating": "strict"
}
}