问题
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.
Go to Graph Explorer
Sign in with your Office 365 account where you have permissions to Graph API and can create teams
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