2
votes

I need to create a Microsoft Team for Classes (special Team with an "Assignments" tab).

I cannot figure out how to create a new Team that has the Assignments tab using using Microsoft Graph API (Beta).

Also, is there anything special with how the Class Notebook (OneNote) is created?

I need to be able to do this programmatically.

3

3 Answers

1
votes

Creating new Teams isn't supported by Microsoft Graph at the moment. From the documentation:

The following are the differences at the API level:

  • Persistent chat is available only to Microsoft Teams. This feature is hierarchically represented by the channel, chatThread, and chatMessage resources.
  • Group conversations are available only to Office 365 groups. This feature is hierarchically represented by the conversation, conversationThread, and post resources.
  • Currently, you can use the Create groups API to create an Office 365 group, but not a team in Microsoft Teams.
  • The List joined teams method applies only to Microsoft Teams.
  • See also the known issues for these APIs.

This is a known issue but I don't ETA for when it might be available.

0
votes

We will have an API for this in preview later in the year.

0
votes

I have Just tested creating teams using Microsoft Graph Explorer (Beta). And found it very useful. Below tests can be useful for your scenario. The use of templates is very much useful.

Kindly follow the steps.

  1. Go to Graph Explorer

  2. Sign in with your Office 365 account where you have permissions to Graph API and can create teams

  3. Try to run below query in Graph Explorer

Post: https://graph.microsoft.com/beta/teams

request Body:

{
  "[email protected]": "https://graph.microsoft.com/beta/teamsTemplates('educationClass')",
  "displayName": "MySampleTeam",
  "description": "My Sample Team’s Description ",
  "channels": [
    {
      "displayName": "Announcements 📢",
      "isFavoriteByDefault": true,
      "description": "This is a sample announcements channel that is favorited by default. Use this channel to make an important team, product, and service announcements."
    },
    {
      "displayName": "Planning 📅 ",
      "description": "This is a sample of a channel that is not favorited by default, these channels will appear in the more channels overflow menu.",
      "isFavoriteByDefault": false
    }
  ]
}

Above query creats the team using education template, with OneNote Tab.

Please note, in above requestBody "[email protected]": "https://graph.microsoft.com/beta/teamsTemplates('educationClass')": educationClass is a template.

Read more about Teams Templates here.

Good luck. Happy teams :)