POST https://graph.microsoft.com/v1.0/teams
Content-Type: application/json
{
"template@odata.bind": "https://graph.microsoft.com/v1.0/teamsTemplates('standard')",
"displayName": "My Sample Team",
"description": "My Sample Team’s Description"
}
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
var team = new Team
{
DisplayName = "My Sample Team",
Description = "My Sample Team’s Description",
AdditionalData = new Dictionary<string, object>()
{
{"template@odata.bind", "https://graph.microsoft.com/v1.0/teamsTemplates('standard')"}
}
};
await graphClient.Teams
.Request()
.AddAsync(team);
GraphServiceClient graphClient = GraphServiceClient.builder().authenticationProvider( authProvider ).buildClient();
Team team = new Team();
team.additionalDataManager().put("template@odata.bind", new JsonPrimitive("https://graph.microsoft.com/v1.0/teamsTemplates('standard')"));
team.displayName = "My Sample Team";
team.description = "My Sample Team’s Description";
graphClient.teams()
.buildRequest()
.post(team);
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
var team = new Team
{
DisplayName = "My Sample Team",
Description = "My Sample Team’s Description",
Members = new TeamMembersCollectionPage()
{
new AadUserConversationMember
{
Roles = new List<String>()
{
"owner"
},
AdditionalData = new Dictionary<string, object>()
{
{"user@odata.bind", "https://graph.microsoft.com/v1.0/users('0040b377-61d8-43db-94f5-81374122dc7e')"}
}
}
},
AdditionalData = new Dictionary<string, object>()
{
{"template@odata.bind", "https://graph.microsoft.com/v1.0/teamsTemplates('standard')"}
}
};
await graphClient.Teams
.Request()
.AddAsync(team);
POST https://graph.microsoft.com/v1.0/teams
Content-Type: application/json
{
"template@odata.bind": "https://graph.microsoft.com/v1.0/teamsTemplates('standard')",
"visibility": "Private",
"displayName": "Sample Engineering Team",
"description": "This is a sample engineering team, used to showcase the range of properties supported by this API",
"channels": [
{
"displayName": "Announcements 📢",
"isFavoriteByDefault": true,
"description": "This is a sample announcements channel that is favorited by default. Use this channel to make important team, product, and service announcements."
},
{
"displayName": "Training 🏋️",
"isFavoriteByDefault": true,
"description": "This is a sample training channel, that is favorited by default, and contains an example of pinned website and YouTube tabs.",
"tabs": [
{
"teamsApp@odata.bind": "https://graph.microsoft.com/v1.0/appCatalogs/teamsApps('com.microsoft.teamspace.tab.web')",
"displayName": "A Pinned Website",
"configuration": {
"contentUrl": "https://docs.microsoft.com/microsoftteams/microsoft-teams"
}
},
{
"teamsApp@odata.bind": "https://graph.microsoft.com/v1.0/appCatalogs/teamsApps('com.microsoft.teamspace.tab.youtube')",
"displayName": "A Pinned YouTube Video",
"configuration": {
"contentUrl": "https://tabs.teams.microsoft.com/Youtube/Home/YoutubeTab?videoId=X8krAMdGvCQ",
"websiteUrl": "https://www.youtube.com/watch?v=X8krAMdGvCQ"
}
}
]
},
{
"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
},
{
"displayName": "Issues and Feedback 🐞",
"description": "This is a sample of a channel that is not favorited by default, these channels will appear in the more channels overflow menu."
}
],
"memberSettings": {
"allowCreateUpdateChannels": true,
"allowDeleteChannels": true,
"allowAddRemoveApps": true,
"allowCreateUpdateRemoveTabs": true,
"allowCreateUpdateRemoveConnectors": true
},
"guestSettings": {
"allowCreateUpdateChannels": false,
"allowDeleteChannels": false
},
"funSettings": {
"allowGiphy": true,
"giphyContentRating": "Moderate",
"allowStickersAndMemes": true,
"allowCustomMemes": true
},
"messagingSettings": {
"allowUserEditMessages": true,
"allowUserDeleteMessages": true,
"allowOwnerDeleteMessages": true,
"allowTeamMentions": true,
"allowChannelMentions": true
},
"discoverySettings": {
"showInTeamsSearchAndSuggestions": true
},
"installedApps": [
{
"teamsApp@odata.bind": "https://graph.microsoft.com/v1.0/appCatalogs/teamsApps('com.microsoft.teamspace.tab.vsts')"
},
{
"teamsApp@odata.bind": "https://graph.microsoft.com/v1.0/appCatalogs/teamsApps('1542629c-01b3-4a6d-8f76-1938b779e48d')"
}
]
}
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
var team = new Team
{
Visibility = TeamVisibilityType.Private,
DisplayName = "Sample Engineering Team",
Description = "This is a sample engineering team, used to showcase the range of properties supported by this API",
Channels = new TeamChannelsCollectionPage()
{
new Channel
{
DisplayName = "Announcements 📢",
IsFavoriteByDefault = true,
Description = "This is a sample announcements channel that is favorited by default. Use this channel to make important team, product, and service announcements."
},
new Channel
{
DisplayName = "Training 🏋️",
IsFavoriteByDefault = true,
Description = "This is a sample training channel, that is favorited by default, and contains an example of pinned website and YouTube tabs.",
Tabs = new ChannelTabsCollectionPage()
{
new TeamsTab
{
DisplayName = "A Pinned Website",
Configuration = new TeamsTabConfiguration
{
ContentUrl = "https://docs.microsoft.com/microsoftteams/microsoft-teams"
},
AdditionalData = new Dictionary<string, object>()
{
{"teamsApp@odata.bind", "https://graph.microsoft.com/v1.0/appCatalogs/teamsApps('com.microsoft.teamspace.tab.web')"}
}
},
new TeamsTab
{
DisplayName = "A Pinned YouTube Video",
Configuration = new TeamsTabConfiguration
{
ContentUrl = "https://tabs.teams.microsoft.com/Youtube/Home/YoutubeTab?videoId=X8krAMdGvCQ",
WebsiteUrl = "https://www.youtube.com/watch?v=X8krAMdGvCQ"
},
AdditionalData = new Dictionary<string, object>()
{
{"teamsApp@odata.bind", "https://graph.microsoft.com/v1.0/appCatalogs/teamsApps('com.microsoft.teamspace.tab.youtube')"}
}
}
}
},
new Channel
{
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
},
new Channel
{
DisplayName = "Issues and Feedback 🐞",
Description = "This is a sample of a channel that is not favorited by default, these channels will appear in the more channels overflow menu."
}
},
MemberSettings = new TeamMemberSettings
{
AllowCreateUpdateChannels = true,
AllowDeleteChannels = true,
AllowAddRemoveApps = true,
AllowCreateUpdateRemoveTabs = true,
AllowCreateUpdateRemoveConnectors = true
},
GuestSettings = new TeamGuestSettings
{
AllowCreateUpdateChannels = false,
AllowDeleteChannels = false
},
FunSettings = new TeamFunSettings
{
AllowGiphy = true,
GiphyContentRating = GiphyRatingType.Moderate,
AllowStickersAndMemes = true,
AllowCustomMemes = true
},
MessagingSettings = new TeamMessagingSettings
{
AllowUserEditMessages = true,
AllowUserDeleteMessages = true,
AllowOwnerDeleteMessages = true,
AllowTeamMentions = true,
AllowChannelMentions = true
},
InstalledApps = new TeamInstalledAppsCollectionPage()
{
new TeamsAppInstallation
{
AdditionalData = new Dictionary<string, object>()
{
{"teamsApp@odata.bind", "https://graph.microsoft.com/v1.0/appCatalogs/teamsApps('com.microsoft.teamspace.tab.vsts')"}
}
},
new TeamsAppInstallation
{
AdditionalData = new Dictionary<string, object>()
{
{"teamsApp@odata.bind", "https://graph.microsoft.com/v1.0/appCatalogs/teamsApps('1542629c-01b3-4a6d-8f76-1938b779e48d')"}
}
}
},
AdditionalData = new Dictionary<string, object>()
{
{"template@odata.bind", "https://graph.microsoft.com/v1.0/teamsTemplates('standard')"},
{"discoverySettings", "{\"showInTeamsSearchAndSuggestions\":true}"}
}
};
await graphClient.Teams
.Request()
.AddAsync(team);
const options = {
authProvider,
};
const client = Client.init(options);
const team = {
'template@odata.bind': 'https://graph.microsoft.com/v1.0/teamsTemplates(\'standard\')',
visibility: 'Private',
displayName: 'Sample Engineering Team',
description: 'This is a sample engineering team, used to showcase the range of properties supported by this API',
channels: [
{
displayName: 'Announcements 📢',
isFavoriteByDefault: true,
description: 'This is a sample announcements channel that is favorited by default. Use this channel to make important team, product, and service announcements.'
},
{
displayName: 'Training 🏋️',
isFavoriteByDefault: true,
description: 'This is a sample training channel, that is favorited by default, and contains an example of pinned website and YouTube tabs.',
tabs: [
{
'teamsApp@odata.bind': 'https://graph.microsoft.com/v1.0/appCatalogs/teamsApps(\'com.microsoft.teamspace.tab.web\')',
displayName: 'A Pinned Website',
configuration: {
contentUrl: 'https://docs.microsoft.com/microsoftteams/microsoft-teams'
}
},
{
'teamsApp@odata.bind': 'https://graph.microsoft.com/v1.0/appCatalogs/teamsApps(\'com.microsoft.teamspace.tab.youtube\')',
displayName: 'A Pinned YouTube Video',
configuration: {
contentUrl: 'https://tabs.teams.microsoft.com/Youtube/Home/YoutubeTab?videoId=X8krAMdGvCQ',
websiteUrl: 'https://www.youtube.com/watch?v=X8krAMdGvCQ'
}
}
]
},
{
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
},
{
displayName: 'Issues and Feedback 🐞',
description: 'This is a sample of a channel that is not favorited by default, these channels will appear in the more channels overflow menu.'
}
],
memberSettings: {
allowCreateUpdateChannels: true,
allowDeleteChannels: true,
allowAddRemoveApps: true,
allowCreateUpdateRemoveTabs: true,
allowCreateUpdateRemoveConnectors: true
},
guestSettings: {
allowCreateUpdateChannels: false,
allowDeleteChannels: false
},
funSettings: {
allowGiphy: true,
giphyContentRating: 'Moderate',
allowStickersAndMemes: true,
allowCustomMemes: true
},
messagingSettings: {
allowUserEditMessages: true,
allowUserDeleteMessages: true,
allowOwnerDeleteMessages: true,
allowTeamMentions: true,
allowChannelMentions: true
},
discoverySettings: {
showInTeamsSearchAndSuggestions: true
},
installedApps: [
{
'teamsApp@odata.bind': 'https://graph.microsoft.com/v1.0/appCatalogs/teamsApps(\'com.microsoft.teamspace.tab.vsts\')'
},
{
'teamsApp@odata.bind': 'https://graph.microsoft.com/v1.0/appCatalogs/teamsApps(\'1542629c-01b3-4a6d-8f76-1938b779e48d\')'
}
]
};
await client.api('/teams')
.post(team);
Import-Module Microsoft.Graph.Teams
$params = @{
"Template@odata.bind" = "https://graph.microsoft.com/v1.0/teamsTemplates('standard')"
Visibility = "Private"
DisplayName = "Sample Engineering Team"
Description = "This is a sample engineering team, used to showcase the range of properties supported by this API"
Channels = @(
@{
DisplayName = "Announcements 📢"
IsFavoriteByDefault = $true
Description = "This is a sample announcements channel that is favorited by default. Use this channel to make important team, product, and service announcements."
}
@{
DisplayName = "Training 🏋️"
IsFavoriteByDefault = $true
Description = "This is a sample training channel, that is favorited by default, and contains an example of pinned website and YouTube tabs."
Tabs = @(
@{
"TeamsApp@odata.bind" = "https://graph.microsoft.com/v1.0/appCatalogs/teamsApps('com.microsoft.teamspace.tab.web')"
DisplayName = "A Pinned Website"
Configuration = @{
ContentUrl = "https://docs.microsoft.com/microsoftteams/microsoft-teams"
}
}
@{
"TeamsApp@odata.bind" = "https://graph.microsoft.com/v1.0/appCatalogs/teamsApps('com.microsoft.teamspace.tab.youtube')"
DisplayName = "A Pinned YouTube Video"
Configuration = @{
ContentUrl = "https://tabs.teams.microsoft.com/Youtube/Home/YoutubeTab?videoId=X8krAMdGvCQ"
WebsiteUrl = "https://www.youtube.com/watch?v=X8krAMdGvCQ"
}
}
)
}
@{
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
}
@{
DisplayName = "Issues and Feedback 🐞"
Description = "This is a sample of a channel that is not favorited by default, these channels will appear in the more channels overflow menu."
}
)
MemberSettings = @{
AllowCreateUpdateChannels = $true
AllowDeleteChannels = $true
AllowAddRemoveApps = $true
AllowCreateUpdateRemoveTabs = $true
AllowCreateUpdateRemoveConnectors = $true
}
GuestSettings = @{
AllowCreateUpdateChannels = $false
AllowDeleteChannels = $false
}
FunSettings = @{
AllowGiphy = $true
GiphyContentRating = "Moderate"
AllowStickersAndMemes = $true
AllowCustomMemes = $true
}
MessagingSettings = @{
AllowUserEditMessages = $true
AllowUserDeleteMessages = $true
AllowOwnerDeleteMessages = $true
AllowTeamMentions = $true
AllowChannelMentions = $true
}
InstalledApps = @(
@{
"TeamsApp@odata.bind" = "https://graph.microsoft.com/v1.0/appCatalogs/teamsApps('com.microsoft.teamspace.tab.vsts')"
}
@{
"TeamsApp@odata.bind" = "https://graph.microsoft.com/v1.0/appCatalogs/teamsApps('1542629c-01b3-4a6d-8f76-1938b779e48d')"
}
)
}
New-MgTeam -BodyParameter $params
POST https://graph.microsoft.com/v1.0/teams
Content-Type: application/json
{
"template@odata.bind": "https://graph.microsoft.com/v1.0/teamsTemplates('standard')",
"group@odata.bind": "https://graph.microsoft.com/v1.0/groups('71392b2f-1765-406e-86af-5907d9bdb2ab')"
}
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
var team = new Team
{
AdditionalData = new Dictionary<string, object>()
{
{"template@odata.bind", "https://graph.microsoft.com/v1.0/teamsTemplates('standard')"},
{"group@odata.bind", "https://graph.microsoft.com/v1.0/groups('71392b2f-1765-406e-86af-5907d9bdb2ab')"}
}
};
await graphClient.Teams
.Request()
.AddAsync(team);
GraphServiceClient graphClient = GraphServiceClient.builder().authenticationProvider( authProvider ).buildClient();
Team team = new Team();
team.additionalDataManager().put("template@odata.bind", new JsonPrimitive("https://graph.microsoft.com/v1.0/teamsTemplates('standard')"));
team.additionalDataManager().put("group@odata.bind", new JsonPrimitive("https://graph.microsoft.com/v1.0/groups('71392b2f-1765-406e-86af-5907d9bdb2ab')"));
graphClient.teams()
.buildRequest()
.post(team);
POST https://graph.microsoft.com/v1.0/teams
Content-Type: application/json
{
"template@odata.bind": "https://graph.microsoft.com/v1.0/teamsTemplates('educationClass')",
"displayName": "My Class Team",
"description": "My Class Team’s Description"
}
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
var team = new Team
{
DisplayName = "My Class Team",
Description = "My Class Team’s Description",
AdditionalData = new Dictionary<string, object>()
{
{"template@odata.bind", "https://graph.microsoft.com/v1.0/teamsTemplates('educationClass')"}
}
};
await graphClient.Teams
.Request()
.AddAsync(team);
GraphServiceClient graphClient = GraphServiceClient.builder().authenticationProvider( authProvider ).buildClient();
Team team = new Team();
team.additionalDataManager().put("template@odata.bind", new JsonPrimitive("https://graph.microsoft.com/v1.0/teamsTemplates('educationClass')"));
team.displayName = "My Class Team";
team.description = "My Class Team’s Description";
graphClient.teams()
.buildRequest()
.post(team);
//THE GO SDK IS IN PREVIEW. NON-PRODUCTION USE ONLY
graphClient := msgraphsdk.NewGraphServiceClient(requestAdapter)
requestBody := msgraphsdk.NewTeam()
displayName := "My Class Team"
requestBody.SetDisplayName(&displayName)
description := "My Class Team’s Description"
requestBody.SetDescription(&description)
requestBody.SetAdditionalData(map[string]interface{}{
"template@odata.bind": "https://graph.microsoft.com/v1.0/teamsTemplates('educationClass')",
}
options := &msgraphsdk.TeamsRequestBuilderPostOptions{
Body: requestBody,
}
result, err := graphClient.Teams().Post(options)
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
var team = new Team
{
DisplayName = "My Sample Team",
Description = "My Sample Team’s Description",
Members = new TeamMembersCollectionPage()
{
new AadUserConversationMember
{
Roles = new List<String>()
{
"owner"
},
AdditionalData = new Dictionary<string, object>()
{
{"user@odata.bind", "https://graph.microsoft.com/v1.0/users('jacob@contoso.com')"}
}
}
},
AdditionalData = new Dictionary<string, object>()
{
{"template@odata.bind", "https://graph.microsoft.com/v1.0/teamsTemplates('standard')"}
}
};
await graphClient.Teams
.Request()
.AddAsync(team);