Create Microsoft Team for Classes programmatically

拥有回忆 提交于 2019-12-12 18:35:36

问题


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.


回答1:


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.




回答2:


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




回答3:


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:

{
  "template@odata.bind": "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 created this awesome team, with OneNote Tab. Created Team

Please note, in above requestBody "template@odata.bind": "https://graph.microsoft.com/beta/teamsTemplates('educationClass')": educationClass is a template.

Read more about Teams Templates here.

Good luck. Happy teams :)



来源:https://stackoverflow.com/questions/45624064/create-microsoft-team-for-classes-programmatically

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!