Create and Manage Teams using Graph API

Views: 0

Here we will test the Graph API capabilities for specific automation plans of an organization with Teams. For this task, let’s create a new team, called Engineering Team with minimal settings, such as Public join options, and another team with multiple channels, called Engineering Meetings.

  • Open URL in IR/Edge and navigate Graph Explorer as shown below:

https://developer.microsoft.com/graph/graph-explorer

  • Sign-in to Graph Explorer. You are currently using a sample account. This will be different once you login successful.
  • Sign with your credentials(vdahiya@<tenant>on.microsoft.com) and if you login for the 1st time, you will see a Permissions requested page. Choose Accept.
  • Now, your username will be displayed under Graph Explorer.
  • Select the GET button and select POST from the dropdown menu.
  • Now, choose Modify permissions and scroll to provide your Consent for Team.Create.
  • Another Permissions requested page appears. Select Accept.
  •  Changes are visible now, it’s Consented.
  • Select the Request body tab and enter the following JSON code:
  • Now, run query and it will be accepted as shown below:
  • It’s Public Team with email id. Administrator/ Person whose username used to login into Graph API is the only member of Team.
  • Now, go back to Graph API and remove the previous content and add new content to create more Teams.
  • I got an error while running a new JSON code query to create another team- Engineering Meeting. ☹

Malformed JSON body – Review the request body and fix any malformed JSON. SyntaxError: Unexpected token E in JSON at position 439

  1. Fixed a few syntax errors and still getting similar error.

“Bad Request – 400 – 363ms”

  • Fixed rest of syntax errors (a few only😉) and finally, JSON template has been corrected and below is a successful query result.

Query Accepted😊😊

  • Navigate back to Admin Center and check new stuff. You might need a refresh or re-login for changes to take effect.
  • See the arrow direction and it shows 5 new Standard Channels created using Graph API JSON Template.
  • Here is the list of newly created channels inside the team- Engineering Meetings.
  • You can add new members in Team and also new channels.

Bravo!

With this, 2 new teams via Graph API have been successfully created. Test results of the Graph functionality is shown in this document are complete.