Microsoft Graph Explorer Way To Create Teams In Office 365

Graph Explorer is a great tool to test all the Microsoft Graph API endpoints. This helps to handle all the cloud-based services from the single tool with single endpoint. Here, we are going to test the Microsoft Graph API with Microsoft Teams. Yes, I am going to show the steps for creating a new Team in Microsoft Teams using Graph Explorer. 
 
There are two editions available for this tool and we are going to use the new preview version of it.
We will do all our activities using the new edition of new Graph Explorer (preview). To know more about this React-based Graph explorer from The New Modern Look of Microsoft Graph Explorer To create a new Team for Microsoft teams, we have to follow the below sequential steps,
  • Create a new Group in Office 365
  • Get the new created Group Id 
  • Create a new Team under newly created Group based on Id

Create New Office 365 Group

 
Navigate to the Graph Explorer.
 
Login to tool using the button called Sign in Graph Explorer.
 
Select the POST method from Request dropdown.
 
Select the version as v1.0.
 
Enter the below Graph API endpoint for creating a new Office 365 Group.
 
https://graph.microsoft.com/v1.0/groups
 
Ensure any one of the below ReadWrite permission scopes are consented. 
  • Group.ReadWrite.All
  • Directory.ReadWrite.All
  • Directory.AccessAsUser.All
 
Under the Request Body Tab, add the below json text, 
  1. {  
  2.     "displayName""New Group Name",  
  3.     "mailNickname""NewgroupName",  
  4.     "mailEnabled"true,  
  5.     "securityEnabled"false,  
  6.     "description""Description for creating new group",  
  7.     "groupTypes": [  
  8.         "Unified"  
  9.     ],  
  10.     "[email protected]": [  
  11.         "https://graph.microsoft.com/v1.0/users/[email protected]"  
  12.     ]  
  13. }  
Property
Remarks
displayName
Display name for Office 365 Group
mailNickName
Name will be used for creating Email Id for the group
mailEnabled
Enable / disable the mail for Group
securityEnabled
True makes the group as a SecurityGroup
description
Description for Office 365 group
groupTypes
Unified – makes the Office 365 group
DynamicMembership – makes the group as dynamic membership
Owners for the group while creation
Members for the group while creation
 
After the body is entered, click Run Query button.
 
If the JSON format is valid and has a valid permission, the tool creates a new office 365 group with the name as New Group Name and email id as [email protected] and owner is [email protected].
 

Get the new Group Id

 
From the Response Preview, copy the value of the id. This is the id of the newly created group.
 
 

Create New Team

 
Now we have the id of the newly created Office 365 group. Based on that we will create a new team.
 
In the top of the tool, select the PUT method from Request dropdown
 
Select the version as v1.0.
 
Enter the below Graph API endpoint for creating a new Team based on group id.
 
https://graph.microsoft.com/v1.0/groups/84379a58-5525-4cb2-8f4b-3e367ad4fd7a/team
 
Ensure any one of the below Group.ReadWrite permission scope is consented
 
 
Under the Request Body Tab, add the empty json text to apply default properties to Team on creation.
  1. {}  
If you want to specify any properties to Team while creation, use the below json format.
  1. {  
  2.     "memberSettings": {  
  3.         "allowCreateUpdateChannels"true  
  4.     },  
  5.     "messagingSettings": {  
  6.         "allowUserEditMessages"true,  
  7.         "allowUserDeleteMessages"true  
  8.     },  
  9.     "funSettings": {  
  10.         "allowGiphy"true,  
  11.         "giphyContentRating""strict"  
  12.     }  
  13. }  
After the body is entered, click Run Query button.
 
If the JSON format is valid and has a valid permission, the tool creates a new Team with the associated group New Group Name.
 
I hope you enjoyed this. The snippets tab in the response section has the different programing codes ( C#, Javascript, Java and Objective-C ) for what we have done with the Graph Explorer.


Similar Articles