Las API de la versión /beta de Microsoft Graph están sujetas a cambios. No se admite el uso de estas API en aplicaciones de producción. Para determinar si una API está disponible en la versión 1.0, use el selector de Versión.
Al crear un equipo, el sitio de SharePoint del canal general podría no aprovisionarse. Si el sitio no se aprovisiona después de 5 minutos, use la API Get filesFolder para desencadenar el aprovisionamiento.
Elija el permiso o los permisos marcados como con privilegios mínimos para esta API. Use un permiso o permisos con privilegios superiores solo si la aplicación lo requiere. Para obtener más información sobre los permisos delegados y de aplicación, consulte Tipos de permisos. Para obtener más información sobre estos permisos, consulte la referencia de permisos.
El permiso Teamwork.Migrate.All solo se admite para la migración. En el futuro, Microsoft puede solicitarle a usted o a sus clientes que paguen tarifas adicionales en función de la cantidad de datos que se importen.
Los permisos Group.ReadWrite.All y Directory.ReadWrite.All solo se admiten por compatibilidad con versiones anteriores. Se recomienda actualizar las soluciones para usar un permiso alternativo enumerado en la tabla anterior y así evitar el uso de estos permisos en el futuro.
En el cuerpo de la solicitud, agregue una representación JSON del objeto team. Opcionalmente, especifique un valor para la propiedad firstChannelName para asignar el nombre al primer canal que se crea. El valor predeterminado del primer canal es General.
Respuesta
Si se ejecuta de manera correcta, esta API devuelve una respuesta 202 Accepted que contiene un vínculo al elemento teamsAsyncOperation.
Ejemplos
Ejemplo 1: permisos delegados
En el ejemplo siguiente se muestra una solicitud mínima. Dado que el cliente omitió otras propiedades, toma implícitamente valores predeterminados de la plantilla predefinida representada por template.
POST https://graph.microsoft.com/beta/teams
Content-Type: application/json
{
"template@odata.bind": "https://graph.microsoft.com/beta/teamsTemplates('standard')",
"displayName": "My Sample Team",
"description": "My Sample Team's Description",
"firstChannelName": "My First Channel of the sample team"
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models;
var requestBody = new Team
{
DisplayName = "My Sample Team",
Description = "My Sample Team's Description",
FirstChannelName = "My First Channel of the sample team",
AdditionalData = new Dictionary<string, object>
{
{
"template@odata.bind" , "https://graph.microsoft.com/beta/teamsTemplates('standard')"
},
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Teams.PostAsync(requestBody);
Importante
Los SDK de Microsoft Graph usan la versión v1.0 de la API de manera predeterminada y no admiten todos los tipos, propiedades y API disponibles en la versión beta. Para obtener más información sobre cómo acceder a la API beta con el SDK, consulte Uso de los SDK de Microsoft Graph con la API beta.
mgc-beta teams create --body '{\
"template@odata.bind": "https://graph.microsoft.com/beta/teamsTemplates('standard')",\
"displayName": "My Sample Team",\
"description": "My Sample Team's Description",\
"firstChannelName": "My First Channel of the sample team"\
}\
'
Importante
Los SDK de Microsoft Graph usan la versión v1.0 de la API de manera predeterminada y no admiten todos los tipos, propiedades y API disponibles en la versión beta. Para obtener más información sobre cómo acceder a la API beta con el SDK, consulte Uso de los SDK de Microsoft Graph con la API beta.
// Code snippets are only available for the latest major version. Current major version is $v0.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-beta-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewTeam()
displayName := "My Sample Team"
requestBody.SetDisplayName(&displayName)
description := "My Sample Team's Description"
requestBody.SetDescription(&description)
firstChannelName := "My First Channel of the sample team"
requestBody.SetFirstChannelName(&firstChannelName)
additionalData := map[string]interface{}{
"template@odata.bind" : "https://graph.microsoft.com/beta/teamsTemplates('standard')",
}
requestBody.SetAdditionalData(additionalData)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
teams, err := graphClient.Teams().Post(context.Background(), requestBody, nil)
Importante
Los SDK de Microsoft Graph usan la versión v1.0 de la API de manera predeterminada y no admiten todos los tipos, propiedades y API disponibles en la versión beta. Para obtener más información sobre cómo acceder a la API beta con el SDK, consulte Uso de los SDK de Microsoft Graph con la API beta.
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
Team team = new Team();
team.setDisplayName("My Sample Team");
team.setDescription("My Sample Team's Description");
team.setFirstChannelName("My First Channel of the sample team");
HashMap<String, Object> additionalData = new HashMap<String, Object>();
additionalData.put("template@odata.bind", "https://graph.microsoft.com/beta/teamsTemplates('standard')");
team.setAdditionalData(additionalData);
Team result = graphClient.teams().post(team);
Importante
Los SDK de Microsoft Graph usan la versión v1.0 de la API de manera predeterminada y no admiten todos los tipos, propiedades y API disponibles en la versión beta. Para obtener más información sobre cómo acceder a la API beta con el SDK, consulte Uso de los SDK de Microsoft Graph con la API beta.
const options = {
authProvider,
};
const client = Client.init(options);
const team = {
'template@odata.bind': 'https://graph.microsoft.com/beta/teamsTemplates(\'standard\')',
displayName: 'My Sample Team',
description: 'My Sample Team\'s Description',
firstChannelName: 'My First Channel of the sample team'
};
await client.api('/teams')
.version('beta')
.post(team);
Importante
Los SDK de Microsoft Graph usan la versión v1.0 de la API de manera predeterminada y no admiten todos los tipos, propiedades y API disponibles en la versión beta. Para obtener más información sobre cómo acceder a la API beta con el SDK, consulte Uso de los SDK de Microsoft Graph con la API beta.
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Models\Team;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new Team();
$requestBody->setDisplayName('My Sample Team');
$requestBody->setDescription('My Sample Team\'s Description');
$requestBody->setFirstChannelName('My First Channel of the sample team');
$additionalData = [
'template@odata.bind' => 'https://graph.microsoft.com/beta/teamsTemplates(\'standard\')',
];
$requestBody->setAdditionalData($additionalData);
$result = $graphServiceClient->teams()->post($requestBody)->wait();
Importante
Los SDK de Microsoft Graph usan la versión v1.0 de la API de manera predeterminada y no admiten todos los tipos, propiedades y API disponibles en la versión beta. Para obtener más información sobre cómo acceder a la API beta con el SDK, consulte Uso de los SDK de Microsoft Graph con la API beta.
Import-Module Microsoft.Graph.Beta.Teams
$params = @{
"template@odata.bind" = "https://graph.microsoft.com/beta/teamsTemplates('standard')"
displayName = "My Sample Team"
description = "My Sample Team's Description"
firstChannelName = "My First Channel of the sample team"
}
New-MgBetaTeam -BodyParameter $params
Importante
Los SDK de Microsoft Graph usan la versión v1.0 de la API de manera predeterminada y no admiten todos los tipos, propiedades y API disponibles en la versión beta. Para obtener más información sobre cómo acceder a la API beta con el SDK, consulte Uso de los SDK de Microsoft Graph con la API beta.
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.models.team import Team
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = Team(
display_name = "My Sample Team",
description = "My Sample Team's Description",
first_channel_name = "My First Channel of the sample team",
additional_data = {
"template@odata_bind" : "https://graph.microsoft.com/beta/teamsTemplates('standard')",
}
)
result = await graph_client.teams.post(request_body)
Importante
Los SDK de Microsoft Graph usan la versión v1.0 de la API de manera predeterminada y no admiten todos los tipos, propiedades y API disponibles en la versión beta. Para obtener más información sobre cómo acceder a la API beta con el SDK, consulte Uso de los SDK de Microsoft Graph con la API beta.
En el ejemplo siguiente se muestra una solicitud mínima mediante permisos de aplicación. Dado que el cliente omitió otras propiedades, toma implícitamente valores predeterminados de la plantilla predefinida representada por template. Al emitir una solicitud con permisos de aplicación, es necesario especificar un usuario en la colección members.
Nota: Solo puede especificar un solo miembro como propietario en este escenario.
POST https://graph.microsoft.com/beta/teams
Content-Type: application/json
{
"template@odata.bind":"https://graph.microsoft.com/beta/teamsTemplates('standard')",
"displayName":"My Sample Team",
"description":"My Sample Team’s Description",
"firstChannelName": "My First Channel of the sample team",
"members":[
{
"@odata.type":"#microsoft.graph.aadUserConversationMember",
"roles":[
"owner"
],
"user@odata.bind":"https://graph.microsoft.com/beta/users('0040b377-61d8-43db-94f5-81374122dc7e')"
}
]
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models;
var requestBody = new Team
{
DisplayName = "My Sample Team",
Description = "My Sample Team’s Description",
FirstChannelName = "My First Channel of the sample team",
Members = new List<ConversationMember>
{
new AadUserConversationMember
{
OdataType = "#microsoft.graph.aadUserConversationMember",
Roles = new List<string>
{
"owner",
},
AdditionalData = new Dictionary<string, object>
{
{
"user@odata.bind" , "https://graph.microsoft.com/beta/users('0040b377-61d8-43db-94f5-81374122dc7e')"
},
},
},
},
AdditionalData = new Dictionary<string, object>
{
{
"template@odata.bind" , "https://graph.microsoft.com/beta/teamsTemplates('standard')"
},
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Teams.PostAsync(requestBody);
Importante
Los SDK de Microsoft Graph usan la versión v1.0 de la API de manera predeterminada y no admiten todos los tipos, propiedades y API disponibles en la versión beta. Para obtener más información sobre cómo acceder a la API beta con el SDK, consulte Uso de los SDK de Microsoft Graph con la API beta.
mgc-beta teams create --body '{\
"template@odata.bind":"https://graph.microsoft.com/beta/teamsTemplates('standard')",\
"displayName":"My Sample Team",\
"description":"My Sample Team’s Description",\
"firstChannelName": "My First Channel of the sample team",\
"members":[\
{\
"@odata.type":"#microsoft.graph.aadUserConversationMember",\
"roles":[\
"owner"\
],\
"user@odata.bind":"https://graph.microsoft.com/beta/users('0040b377-61d8-43db-94f5-81374122dc7e')"\
}\
]\
}\
'
Importante
Los SDK de Microsoft Graph usan la versión v1.0 de la API de manera predeterminada y no admiten todos los tipos, propiedades y API disponibles en la versión beta. Para obtener más información sobre cómo acceder a la API beta con el SDK, consulte Uso de los SDK de Microsoft Graph con la API beta.
// Code snippets are only available for the latest major version. Current major version is $v0.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-beta-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewTeam()
displayName := "My Sample Team"
requestBody.SetDisplayName(&displayName)
description := "My Sample Team’s Description"
requestBody.SetDescription(&description)
firstChannelName := "My First Channel of the sample team"
requestBody.SetFirstChannelName(&firstChannelName)
conversationMember := graphmodels.NewAadUserConversationMember()
roles := []string {
"owner",
}
conversationMember.SetRoles(roles)
additionalData := map[string]interface{}{
"user@odata.bind" : "https://graph.microsoft.com/beta/users('0040b377-61d8-43db-94f5-81374122dc7e')",
}
conversationMember.SetAdditionalData(additionalData)
members := []graphmodels.ConversationMemberable {
conversationMember,
}
requestBody.SetMembers(members)
additionalData := map[string]interface{}{
"template@odata.bind" : "https://graph.microsoft.com/beta/teamsTemplates('standard')",
}
requestBody.SetAdditionalData(additionalData)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
teams, err := graphClient.Teams().Post(context.Background(), requestBody, nil)
Importante
Los SDK de Microsoft Graph usan la versión v1.0 de la API de manera predeterminada y no admiten todos los tipos, propiedades y API disponibles en la versión beta. Para obtener más información sobre cómo acceder a la API beta con el SDK, consulte Uso de los SDK de Microsoft Graph con la API beta.
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
Team team = new Team();
team.setDisplayName("My Sample Team");
team.setDescription("My Sample Team’s Description");
team.setFirstChannelName("My First Channel of the sample team");
LinkedList<ConversationMember> members = new LinkedList<ConversationMember>();
AadUserConversationMember conversationMember = new AadUserConversationMember();
conversationMember.setOdataType("#microsoft.graph.aadUserConversationMember");
LinkedList<String> roles = new LinkedList<String>();
roles.add("owner");
conversationMember.setRoles(roles);
HashMap<String, Object> additionalData = new HashMap<String, Object>();
additionalData.put("user@odata.bind", "https://graph.microsoft.com/beta/users('0040b377-61d8-43db-94f5-81374122dc7e')");
conversationMember.setAdditionalData(additionalData);
members.add(conversationMember);
team.setMembers(members);
HashMap<String, Object> additionalData1 = new HashMap<String, Object>();
additionalData1.put("template@odata.bind", "https://graph.microsoft.com/beta/teamsTemplates('standard')");
team.setAdditionalData(additionalData1);
Team result = graphClient.teams().post(team);
Importante
Los SDK de Microsoft Graph usan la versión v1.0 de la API de manera predeterminada y no admiten todos los tipos, propiedades y API disponibles en la versión beta. Para obtener más información sobre cómo acceder a la API beta con el SDK, consulte Uso de los SDK de Microsoft Graph con la API beta.
Los SDK de Microsoft Graph usan la versión v1.0 de la API de manera predeterminada y no admiten todos los tipos, propiedades y API disponibles en la versión beta. Para obtener más información sobre cómo acceder a la API beta con el SDK, consulte Uso de los SDK de Microsoft Graph con la API beta.
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Models\Team;
use Microsoft\Graph\Beta\Generated\Models\ConversationMember;
use Microsoft\Graph\Beta\Generated\Models\AadUserConversationMember;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new Team();
$requestBody->setDisplayName('My Sample Team');
$requestBody->setDescription('My Sample Team’s Description');
$requestBody->setFirstChannelName('My First Channel of the sample team');
$membersConversationMember1 = new AadUserConversationMember();
$membersConversationMember1->setOdataType('#microsoft.graph.aadUserConversationMember');
$membersConversationMember1->setRoles(['owner', ]);
$additionalData = [
'user@odata.bind' => 'https://graph.microsoft.com/beta/users(\'0040b377-61d8-43db-94f5-81374122dc7e\')',
];
$membersConversationMember1->setAdditionalData($additionalData);
$membersArray []= $membersConversationMember1;
$requestBody->setMembers($membersArray);
$additionalData = [
'template@odata.bind' => 'https://graph.microsoft.com/beta/teamsTemplates(\'standard\')',
];
$requestBody->setAdditionalData($additionalData);
$result = $graphServiceClient->teams()->post($requestBody)->wait();
Importante
Los SDK de Microsoft Graph usan la versión v1.0 de la API de manera predeterminada y no admiten todos los tipos, propiedades y API disponibles en la versión beta. Para obtener más información sobre cómo acceder a la API beta con el SDK, consulte Uso de los SDK de Microsoft Graph con la API beta.
Import-Module Microsoft.Graph.Beta.Teams
$params = @{
"template@odata.bind" = "https://graph.microsoft.com/beta/teamsTemplates('standard')"
displayName = "My Sample Team"
description = "My Sample Team’s Description"
firstChannelName = "My First Channel of the sample team"
members = @(
@{
"@odata.type" = "#microsoft.graph.aadUserConversationMember"
roles = @(
"owner"
)
"user@odata.bind" = "https://graph.microsoft.com/beta/users('0040b377-61d8-43db-94f5-81374122dc7e')"
}
)
}
New-MgBetaTeam -BodyParameter $params
Importante
Los SDK de Microsoft Graph usan la versión v1.0 de la API de manera predeterminada y no admiten todos los tipos, propiedades y API disponibles en la versión beta. Para obtener más información sobre cómo acceder a la API beta con el SDK, consulte Uso de los SDK de Microsoft Graph con la API beta.
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.models.team import Team
from msgraph_beta.generated.models.conversation_member import ConversationMember
from msgraph_beta.generated.models.aad_user_conversation_member import AadUserConversationMember
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = Team(
display_name = "My Sample Team",
description = "My Sample Team’s Description",
first_channel_name = "My First Channel of the sample team",
members = [
AadUserConversationMember(
odata_type = "#microsoft.graph.aadUserConversationMember",
roles = [
"owner",
],
additional_data = {
"user@odata_bind" : "https://graph.microsoft.com/beta/users('0040b377-61d8-43db-94f5-81374122dc7e')",
}
),
],
additional_data = {
"template@odata_bind" : "https://graph.microsoft.com/beta/teamsTemplates('standard')",
}
)
result = await graph_client.teams.post(request_body)
Importante
Los SDK de Microsoft Graph usan la versión v1.0 de la API de manera predeterminada y no admiten todos los tipos, propiedades y API disponibles en la versión beta. Para obtener más información sobre cómo acceder a la API beta con el SDK, consulte Uso de los SDK de Microsoft Graph con la API beta.
Ejemplo 3: crear un equipo con varios canales, aplicaciones instaladas y pestañas ancladas mediante permisos delegados
En el ejemplo siguiente se muestra una solicitud con una carga completa. El cliente puede reemplazar los valores de la plantilla base y agregar los elementos con valores de matriz en la medida en que lo permitan las reglas de validación de specialization.
POST https://graph.microsoft.com/beta/teams
Content-Type: application/json
{
"template@odata.bind": "https://graph.microsoft.com/beta/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",
"firstChannelName": "My First Channel of the team",
"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://learn.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')"
}
]
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models;
var requestBody = 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",
FirstChannelName = "My First Channel of the team",
Channels = new List<Channel>
{
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 List<TeamsTab>
{
new TeamsTab
{
DisplayName = "A Pinned Website",
Configuration = new TeamsTabConfiguration
{
ContentUrl = "https://learn.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,
},
DiscoverySettings = new TeamDiscoverySettings
{
ShowInTeamsSearchAndSuggestions = true,
},
InstalledApps = new List<TeamsAppInstallation>
{
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/beta/teamsTemplates('standard')"
},
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Teams.PostAsync(requestBody);
Importante
Los SDK de Microsoft Graph usan la versión v1.0 de la API de manera predeterminada y no admiten todos los tipos, propiedades y API disponibles en la versión beta. Para obtener más información sobre cómo acceder a la API beta con el SDK, consulte Uso de los SDK de Microsoft Graph con la API beta.
mgc-beta teams create --'standard')" {'standard')"-id} --\
"visibility": "Private" {\
"visibility": "Private"-id} --\
"displayName": "Sample Engineering Team" {\
"displayName": "Sample Engineering Team"-id} --\
"description": "This is a sample engineering team {\
"description": "This is a sample engineering team-id} -- used to showcase the range of properties supported by this API" { used to showcase the range of properties supported by this API"-id} --\
"firstChannelName": "My First Channel of the team" {\
"firstChannelName": "My First Channel of the team"-id} --\
"channels": [\
{\
"displayName": "Announcements 📢" {\
"channels": [\
{\
"displayName": "Announcements 📢"-id} --\
"isFavoriteByDefault": true {\
"isFavoriteByDefault": true-id} --\
"description": "This is a sample announcements channel that is favorited by default. Use this channel to make important team {\
"description": "This is a sample announcements channel that is favorited by default. Use this channel to make important team-id} -- product { product-id} -- and service announcements."\
} { and service announcements."\
}-id} --\
{\
"displayName": "Training 🏋️" {\
{\
"displayName": "Training 🏋️"-id} --\
"isFavoriteByDefault": true {\
"isFavoriteByDefault": true-id} --\
"description": "This is a sample training channel {\
"description": "This is a sample training channel-id} -- that is favorited by default { that is favorited by default-id} -- and contains an example of pinned website and YouTube tabs." { and contains an example of pinned website and YouTube tabs."-id} --\
"tabs": [\
{\
"teamsApp@odata.bind": "https://graph.microsoft.com/v1.0/appCatalogs/teamsApps {\
"tabs": [\
{\
"teamsApp@odata.bind": "https://graph.microsoft.com/v1.0/appCatalogs/teamsApps-id} --body '{\
"template@odata.bind": "https://graph.microsoft.com/beta/teamsTemplates-with-'standard')"-with-\
"visibility": "Private"-with-\
"displayName": "Sample Engineering Team"-with-\
"description": "This is a sample engineering team-with- used to showcase the range of properties supported by this API"-with-\
"firstChannelName": "My First Channel of the team"-with-\
"channels": [\
{\
"displayName": "Announcements 📢"-with-\
"isFavoriteByDefault": true-with-\
"description": "This is a sample announcements channel that is favorited by default. Use this channel to make important team-with- product-with- and service announcements."\
}-with-\
{\
"displayName": "Training 🏋️"-with-\
"isFavoriteByDefault": true-with-\
"description": "This is a sample training channel-with- that is favorited by default-with- and contains an example of pinned website and YouTube tabs."-with-\
"tabs": [\
{\
"teamsApp@odata.bind": "https://graph.microsoft.com/v1.0/appCatalogs/teamsApps
Importante
Los SDK de Microsoft Graph usan la versión v1.0 de la API de manera predeterminada y no admiten todos los tipos, propiedades y API disponibles en la versión beta. Para obtener más información sobre cómo acceder a la API beta con el SDK, consulte Uso de los SDK de Microsoft Graph con la API beta.
// Code snippets are only available for the latest major version. Current major version is $v0.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-beta-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewTeam()
visibility := graphmodels.PRIVATE_TEAMVISIBILITYTYPE
requestBody.SetVisibility(&visibility)
displayName := "Sample Engineering Team"
requestBody.SetDisplayName(&displayName)
description := "This is a sample engineering team, used to showcase the range of properties supported by this API"
requestBody.SetDescription(&description)
firstChannelName := "My First Channel of the team"
requestBody.SetFirstChannelName(&firstChannelName)
channel := graphmodels.NewChannel()
displayName := "Announcements 📢"
channel.SetDisplayName(&displayName)
isFavoriteByDefault := true
channel.SetIsFavoriteByDefault(&isFavoriteByDefault)
description := "This is a sample announcements channel that is favorited by default. Use this channel to make important team, product, and service announcements."
channel.SetDescription(&description)
channel1 := graphmodels.NewChannel()
displayName := "Training 🏋️"
channel1.SetDisplayName(&displayName)
isFavoriteByDefault := true
channel1.SetIsFavoriteByDefault(&isFavoriteByDefault)
description := "This is a sample training channel, that is favorited by default, and contains an example of pinned website and YouTube tabs."
channel1.SetDescription(&description)
teamsTab := graphmodels.NewTeamsTab()
displayName := "A Pinned Website"
teamsTab.SetDisplayName(&displayName)
configuration := graphmodels.NewTeamsTabConfiguration()
contentUrl := "https://learn.microsoft.com/microsoftteams/microsoft-teams"
configuration.SetContentUrl(&contentUrl)
teamsTab.SetConfiguration(configuration)
additionalData := map[string]interface{}{
"teamsApp@odata.bind" : "https://graph.microsoft.com/v1.0/appCatalogs/teamsApps('com.microsoft.teamspace.tab.web')",
}
teamsTab.SetAdditionalData(additionalData)
teamsTab1 := graphmodels.NewTeamsTab()
displayName := "A Pinned YouTube Video"
teamsTab1.SetDisplayName(&displayName)
configuration := graphmodels.NewTeamsTabConfiguration()
contentUrl := "https://tabs.teams.microsoft.com/Youtube/Home/YoutubeTab?videoId=X8krAMdGvCQ"
configuration.SetContentUrl(&contentUrl)
websiteUrl := "https://www.youtube.com/watch?v=X8krAMdGvCQ"
configuration.SetWebsiteUrl(&websiteUrl)
teamsTab1.SetConfiguration(configuration)
additionalData := map[string]interface{}{
"teamsApp@odata.bind" : "https://graph.microsoft.com/v1.0/appCatalogs/teamsApps('com.microsoft.teamspace.tab.youtube')",
}
teamsTab1.SetAdditionalData(additionalData)
tabs := []graphmodels.TeamsTabable {
teamsTab,
teamsTab1,
}
channel1.SetTabs(tabs)
channel2 := graphmodels.NewChannel()
displayName := "Planning 📅 "
channel2.SetDisplayName(&displayName)
description := "This is a sample of a channel that is not favorited by default, these channels will appear in the more channels overflow menu."
channel2.SetDescription(&description)
isFavoriteByDefault := false
channel2.SetIsFavoriteByDefault(&isFavoriteByDefault)
channel3 := graphmodels.NewChannel()
displayName := "Issues and Feedback 🐞"
channel3.SetDisplayName(&displayName)
description := "This is a sample of a channel that is not favorited by default, these channels will appear in the more channels overflow menu."
channel3.SetDescription(&description)
channels := []graphmodels.Channelable {
channel,
channel1,
channel2,
channel3,
}
requestBody.SetChannels(channels)
memberSettings := graphmodels.NewTeamMemberSettings()
allowCreateUpdateChannels := true
memberSettings.SetAllowCreateUpdateChannels(&allowCreateUpdateChannels)
allowDeleteChannels := true
memberSettings.SetAllowDeleteChannels(&allowDeleteChannels)
allowAddRemoveApps := true
memberSettings.SetAllowAddRemoveApps(&allowAddRemoveApps)
allowCreateUpdateRemoveTabs := true
memberSettings.SetAllowCreateUpdateRemoveTabs(&allowCreateUpdateRemoveTabs)
allowCreateUpdateRemoveConnectors := true
memberSettings.SetAllowCreateUpdateRemoveConnectors(&allowCreateUpdateRemoveConnectors)
requestBody.SetMemberSettings(memberSettings)
guestSettings := graphmodels.NewTeamGuestSettings()
allowCreateUpdateChannels := false
guestSettings.SetAllowCreateUpdateChannels(&allowCreateUpdateChannels)
allowDeleteChannels := false
guestSettings.SetAllowDeleteChannels(&allowDeleteChannels)
requestBody.SetGuestSettings(guestSettings)
funSettings := graphmodels.NewTeamFunSettings()
allowGiphy := true
funSettings.SetAllowGiphy(&allowGiphy)
giphyContentRating := graphmodels.MODERATE_GIPHYRATINGTYPE
funSettings.SetGiphyContentRating(&giphyContentRating)
allowStickersAndMemes := true
funSettings.SetAllowStickersAndMemes(&allowStickersAndMemes)
allowCustomMemes := true
funSettings.SetAllowCustomMemes(&allowCustomMemes)
requestBody.SetFunSettings(funSettings)
messagingSettings := graphmodels.NewTeamMessagingSettings()
allowUserEditMessages := true
messagingSettings.SetAllowUserEditMessages(&allowUserEditMessages)
allowUserDeleteMessages := true
messagingSettings.SetAllowUserDeleteMessages(&allowUserDeleteMessages)
allowOwnerDeleteMessages := true
messagingSettings.SetAllowOwnerDeleteMessages(&allowOwnerDeleteMessages)
allowTeamMentions := true
messagingSettings.SetAllowTeamMentions(&allowTeamMentions)
allowChannelMentions := true
messagingSettings.SetAllowChannelMentions(&allowChannelMentions)
requestBody.SetMessagingSettings(messagingSettings)
discoverySettings := graphmodels.NewTeamDiscoverySettings()
showInTeamsSearchAndSuggestions := true
discoverySettings.SetShowInTeamsSearchAndSuggestions(&showInTeamsSearchAndSuggestions)
requestBody.SetDiscoverySettings(discoverySettings)
teamsAppInstallation := graphmodels.NewTeamsAppInstallation()
additionalData := map[string]interface{}{
"teamsApp@odata.bind" : "https://graph.microsoft.com/v1.0/appCatalogs/teamsApps('com.microsoft.teamspace.tab.vsts')",
}
teamsAppInstallation.SetAdditionalData(additionalData)
teamsAppInstallation1 := graphmodels.NewTeamsAppInstallation()
additionalData := map[string]interface{}{
"teamsApp@odata.bind" : "https://graph.microsoft.com/v1.0/appCatalogs/teamsApps('1542629c-01b3-4a6d-8f76-1938b779e48d')",
}
teamsAppInstallation1.SetAdditionalData(additionalData)
installedApps := []graphmodels.TeamsAppInstallationable {
teamsAppInstallation,
teamsAppInstallation1,
}
requestBody.SetInstalledApps(installedApps)
additionalData := map[string]interface{}{
"template@odata.bind" : "https://graph.microsoft.com/beta/teamsTemplates('standard')",
}
requestBody.SetAdditionalData(additionalData)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
teams, err := graphClient.Teams().Post(context.Background(), requestBody, nil)
Importante
Los SDK de Microsoft Graph usan la versión v1.0 de la API de manera predeterminada y no admiten todos los tipos, propiedades y API disponibles en la versión beta. Para obtener más información sobre cómo acceder a la API beta con el SDK, consulte Uso de los SDK de Microsoft Graph con la API beta.
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
Team team = new Team();
team.setVisibility(TeamVisibilityType.Private);
team.setDisplayName("Sample Engineering Team");
team.setDescription("This is a sample engineering team, used to showcase the range of properties supported by this API");
team.setFirstChannelName("My First Channel of the team");
LinkedList<Channel> channels = new LinkedList<Channel>();
Channel channel = new Channel();
channel.setDisplayName("Announcements 📢");
channel.setIsFavoriteByDefault(true);
channel.setDescription("This is a sample announcements channel that is favorited by default. Use this channel to make important team, product, and service announcements.");
channels.add(channel);
Channel channel1 = new Channel();
channel1.setDisplayName("Training 🏋️");
channel1.setIsFavoriteByDefault(true);
channel1.setDescription("This is a sample training channel, that is favorited by default, and contains an example of pinned website and YouTube tabs.");
LinkedList<TeamsTab> tabs = new LinkedList<TeamsTab>();
TeamsTab teamsTab = new TeamsTab();
teamsTab.setDisplayName("A Pinned Website");
TeamsTabConfiguration configuration = new TeamsTabConfiguration();
configuration.setContentUrl("https://learn.microsoft.com/microsoftteams/microsoft-teams");
teamsTab.setConfiguration(configuration);
HashMap<String, Object> additionalData = new HashMap<String, Object>();
additionalData.put("teamsApp@odata.bind", "https://graph.microsoft.com/v1.0/appCatalogs/teamsApps('com.microsoft.teamspace.tab.web')");
teamsTab.setAdditionalData(additionalData);
tabs.add(teamsTab);
TeamsTab teamsTab1 = new TeamsTab();
teamsTab1.setDisplayName("A Pinned YouTube Video");
TeamsTabConfiguration configuration1 = new TeamsTabConfiguration();
configuration1.setContentUrl("https://tabs.teams.microsoft.com/Youtube/Home/YoutubeTab?videoId=X8krAMdGvCQ");
configuration1.setWebsiteUrl("https://www.youtube.com/watch?v=X8krAMdGvCQ");
teamsTab1.setConfiguration(configuration1);
HashMap<String, Object> additionalData1 = new HashMap<String, Object>();
additionalData1.put("teamsApp@odata.bind", "https://graph.microsoft.com/v1.0/appCatalogs/teamsApps('com.microsoft.teamspace.tab.youtube')");
teamsTab1.setAdditionalData(additionalData1);
tabs.add(teamsTab1);
channel1.setTabs(tabs);
channels.add(channel1);
Channel channel2 = new Channel();
channel2.setDisplayName("Planning 📅 ");
channel2.setDescription("This is a sample of a channel that is not favorited by default, these channels will appear in the more channels overflow menu.");
channel2.setIsFavoriteByDefault(false);
channels.add(channel2);
Channel channel3 = new Channel();
channel3.setDisplayName("Issues and Feedback 🐞");
channel3.setDescription("This is a sample of a channel that is not favorited by default, these channels will appear in the more channels overflow menu.");
channels.add(channel3);
team.setChannels(channels);
TeamMemberSettings memberSettings = new TeamMemberSettings();
memberSettings.setAllowCreateUpdateChannels(true);
memberSettings.setAllowDeleteChannels(true);
memberSettings.setAllowAddRemoveApps(true);
memberSettings.setAllowCreateUpdateRemoveTabs(true);
memberSettings.setAllowCreateUpdateRemoveConnectors(true);
team.setMemberSettings(memberSettings);
TeamGuestSettings guestSettings = new TeamGuestSettings();
guestSettings.setAllowCreateUpdateChannels(false);
guestSettings.setAllowDeleteChannels(false);
team.setGuestSettings(guestSettings);
TeamFunSettings funSettings = new TeamFunSettings();
funSettings.setAllowGiphy(true);
funSettings.setGiphyContentRating(GiphyRatingType.Moderate);
funSettings.setAllowStickersAndMemes(true);
funSettings.setAllowCustomMemes(true);
team.setFunSettings(funSettings);
TeamMessagingSettings messagingSettings = new TeamMessagingSettings();
messagingSettings.setAllowUserEditMessages(true);
messagingSettings.setAllowUserDeleteMessages(true);
messagingSettings.setAllowOwnerDeleteMessages(true);
messagingSettings.setAllowTeamMentions(true);
messagingSettings.setAllowChannelMentions(true);
team.setMessagingSettings(messagingSettings);
TeamDiscoverySettings discoverySettings = new TeamDiscoverySettings();
discoverySettings.setShowInTeamsSearchAndSuggestions(true);
team.setDiscoverySettings(discoverySettings);
LinkedList<TeamsAppInstallation> installedApps = new LinkedList<TeamsAppInstallation>();
TeamsAppInstallation teamsAppInstallation = new TeamsAppInstallation();
HashMap<String, Object> additionalData2 = new HashMap<String, Object>();
additionalData2.put("teamsApp@odata.bind", "https://graph.microsoft.com/v1.0/appCatalogs/teamsApps('com.microsoft.teamspace.tab.vsts')");
teamsAppInstallation.setAdditionalData(additionalData2);
installedApps.add(teamsAppInstallation);
TeamsAppInstallation teamsAppInstallation1 = new TeamsAppInstallation();
HashMap<String, Object> additionalData3 = new HashMap<String, Object>();
additionalData3.put("teamsApp@odata.bind", "https://graph.microsoft.com/v1.0/appCatalogs/teamsApps('1542629c-01b3-4a6d-8f76-1938b779e48d')");
teamsAppInstallation1.setAdditionalData(additionalData3);
installedApps.add(teamsAppInstallation1);
team.setInstalledApps(installedApps);
HashMap<String, Object> additionalData4 = new HashMap<String, Object>();
additionalData4.put("template@odata.bind", "https://graph.microsoft.com/beta/teamsTemplates('standard')");
team.setAdditionalData(additionalData4);
Team result = graphClient.teams().post(team);
Importante
Los SDK de Microsoft Graph usan la versión v1.0 de la API de manera predeterminada y no admiten todos los tipos, propiedades y API disponibles en la versión beta. Para obtener más información sobre cómo acceder a la API beta con el SDK, consulte Uso de los SDK de Microsoft Graph con la API beta.
const options = {
authProvider,
};
const client = Client.init(options);
const team = {
'template@odata.bind': 'https://graph.microsoft.com/beta/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',
firstChannelName: 'My First Channel of the team',
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://learn.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')
.version('beta')
.post(team);
Importante
Los SDK de Microsoft Graph usan la versión v1.0 de la API de manera predeterminada y no admiten todos los tipos, propiedades y API disponibles en la versión beta. Para obtener más información sobre cómo acceder a la API beta con el SDK, consulte Uso de los SDK de Microsoft Graph con la API beta.
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Models\Team;
use Microsoft\Graph\Beta\Generated\Models\TeamVisibilityType;
use Microsoft\Graph\Beta\Generated\Models\Channel;
use Microsoft\Graph\Beta\Generated\Models\TeamsTab;
use Microsoft\Graph\Beta\Generated\Models\TeamsTabConfiguration;
use Microsoft\Graph\Beta\Generated\Models\TeamMemberSettings;
use Microsoft\Graph\Beta\Generated\Models\TeamGuestSettings;
use Microsoft\Graph\Beta\Generated\Models\TeamFunSettings;
use Microsoft\Graph\Beta\Generated\Models\GiphyRatingType;
use Microsoft\Graph\Beta\Generated\Models\TeamMessagingSettings;
use Microsoft\Graph\Beta\Generated\Models\TeamDiscoverySettings;
use Microsoft\Graph\Beta\Generated\Models\TeamsAppInstallation;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new Team();
$requestBody->setVisibility(new TeamVisibilityType('private'));
$requestBody->setDisplayName('Sample Engineering Team');
$requestBody->setDescription('This is a sample engineering team, used to showcase the range of properties supported by this API');
$requestBody->setFirstChannelName('My First Channel of the team');
$channelsChannel1 = new Channel();
$channelsChannel1->setDisplayName('Announcements 📢');
$channelsChannel1->setIsFavoriteByDefault(true);
$channelsChannel1->setDescription('This is a sample announcements channel that is favorited by default. Use this channel to make important team, product, and service announcements.');
$channelsArray []= $channelsChannel1;
$channelsChannel2 = new Channel();
$channelsChannel2->setDisplayName('Training 🏋️');
$channelsChannel2->setIsFavoriteByDefault(true);
$channelsChannel2->setDescription('This is a sample training channel, that is favorited by default, and contains an example of pinned website and YouTube tabs.');
$tabsTeamsTab1 = new TeamsTab();
$tabsTeamsTab1->setDisplayName('A Pinned Website');
$tabsTeamsTab1Configuration = new TeamsTabConfiguration();
$tabsTeamsTab1Configuration->setContentUrl('https://learn.microsoft.com/microsoftteams/microsoft-teams');
$tabsTeamsTab1->setConfiguration($tabsTeamsTab1Configuration);
$additionalData = [
'teamsApp@odata.bind' => 'https://graph.microsoft.com/v1.0/appCatalogs/teamsApps(\'com.microsoft.teamspace.tab.web\')',
];
$tabsTeamsTab1->setAdditionalData($additionalData);
$tabsArray []= $tabsTeamsTab1;
$tabsTeamsTab2 = new TeamsTab();
$tabsTeamsTab2->setDisplayName('A Pinned YouTube Video');
$tabsTeamsTab2Configuration = new TeamsTabConfiguration();
$tabsTeamsTab2Configuration->setContentUrl('https://tabs.teams.microsoft.com/Youtube/Home/YoutubeTab?videoId=X8krAMdGvCQ');
$tabsTeamsTab2Configuration->setWebsiteUrl('https://www.youtube.com/watch?v=X8krAMdGvCQ');
$tabsTeamsTab2->setConfiguration($tabsTeamsTab2Configuration);
$additionalData = [
'teamsApp@odata.bind' => 'https://graph.microsoft.com/v1.0/appCatalogs/teamsApps(\'com.microsoft.teamspace.tab.youtube\')',
];
$tabsTeamsTab2->setAdditionalData($additionalData);
$tabsArray []= $tabsTeamsTab2;
$channelsChannel2->setTabs($tabsArray);
$channelsArray []= $channelsChannel2;
$channelsChannel3 = new Channel();
$channelsChannel3->setDisplayName('Planning 📅 ');
$channelsChannel3->setDescription('This is a sample of a channel that is not favorited by default, these channels will appear in the more channels overflow menu.');
$channelsChannel3->setIsFavoriteByDefault(false);
$channelsArray []= $channelsChannel3;
$channelsChannel4 = new Channel();
$channelsChannel4->setDisplayName('Issues and Feedback 🐞');
$channelsChannel4->setDescription('This is a sample of a channel that is not favorited by default, these channels will appear in the more channels overflow menu.');
$channelsArray []= $channelsChannel4;
$requestBody->setChannels($channelsArray);
$memberSettings = new TeamMemberSettings();
$memberSettings->setAllowCreateUpdateChannels(true);
$memberSettings->setAllowDeleteChannels(true);
$memberSettings->setAllowAddRemoveApps(true);
$memberSettings->setAllowCreateUpdateRemoveTabs(true);
$memberSettings->setAllowCreateUpdateRemoveConnectors(true);
$requestBody->setMemberSettings($memberSettings);
$guestSettings = new TeamGuestSettings();
$guestSettings->setAllowCreateUpdateChannels(false);
$guestSettings->setAllowDeleteChannels(false);
$requestBody->setGuestSettings($guestSettings);
$funSettings = new TeamFunSettings();
$funSettings->setAllowGiphy(true);
$funSettings->setGiphyContentRating(new GiphyRatingType('moderate'));
$funSettings->setAllowStickersAndMemes(true);
$funSettings->setAllowCustomMemes(true);
$requestBody->setFunSettings($funSettings);
$messagingSettings = new TeamMessagingSettings();
$messagingSettings->setAllowUserEditMessages(true);
$messagingSettings->setAllowUserDeleteMessages(true);
$messagingSettings->setAllowOwnerDeleteMessages(true);
$messagingSettings->setAllowTeamMentions(true);
$messagingSettings->setAllowChannelMentions(true);
$requestBody->setMessagingSettings($messagingSettings);
$discoverySettings = new TeamDiscoverySettings();
$discoverySettings->setShowInTeamsSearchAndSuggestions(true);
$requestBody->setDiscoverySettings($discoverySettings);
$installedAppsTeamsAppInstallation1 = new TeamsAppInstallation();
$additionalData = [
'teamsApp@odata.bind' => 'https://graph.microsoft.com/v1.0/appCatalogs/teamsApps(\'com.microsoft.teamspace.tab.vsts\')',
];
$installedAppsTeamsAppInstallation1->setAdditionalData($additionalData);
$installedAppsArray []= $installedAppsTeamsAppInstallation1;
$installedAppsTeamsAppInstallation2 = new TeamsAppInstallation();
$additionalData = [
'teamsApp@odata.bind' => 'https://graph.microsoft.com/v1.0/appCatalogs/teamsApps(\'1542629c-01b3-4a6d-8f76-1938b779e48d\')',
];
$installedAppsTeamsAppInstallation2->setAdditionalData($additionalData);
$installedAppsArray []= $installedAppsTeamsAppInstallation2;
$requestBody->setInstalledApps($installedAppsArray);
$additionalData = [
'template@odata.bind' => 'https://graph.microsoft.com/beta/teamsTemplates(\'standard\')',
];
$requestBody->setAdditionalData($additionalData);
$result = $graphServiceClient->teams()->post($requestBody)->wait();
Importante
Los SDK de Microsoft Graph usan la versión v1.0 de la API de manera predeterminada y no admiten todos los tipos, propiedades y API disponibles en la versión beta. Para obtener más información sobre cómo acceder a la API beta con el SDK, consulte Uso de los SDK de Microsoft Graph con la API beta.
Import-Module Microsoft.Graph.Beta.Teams
$params = @{
"template@odata.bind" = "https://graph.microsoft.com/beta/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"
firstChannelName = "My First Channel of the team"
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://learn.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')"
}
)
}
New-MgBetaTeam -BodyParameter $params
Importante
Los SDK de Microsoft Graph usan la versión v1.0 de la API de manera predeterminada y no admiten todos los tipos, propiedades y API disponibles en la versión beta. Para obtener más información sobre cómo acceder a la API beta con el SDK, consulte Uso de los SDK de Microsoft Graph con la API beta.
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.models.team import Team
from msgraph_beta.generated.models.team_visibility_type import TeamVisibilityType
from msgraph_beta.generated.models.channel import Channel
from msgraph_beta.generated.models.teams_tab import TeamsTab
from msgraph_beta.generated.models.teams_tab_configuration import TeamsTabConfiguration
from msgraph_beta.generated.models.team_member_settings import TeamMemberSettings
from msgraph_beta.generated.models.team_guest_settings import TeamGuestSettings
from msgraph_beta.generated.models.team_fun_settings import TeamFunSettings
from msgraph_beta.generated.models.giphy_rating_type import GiphyRatingType
from msgraph_beta.generated.models.team_messaging_settings import TeamMessagingSettings
from msgraph_beta.generated.models.team_discovery_settings import TeamDiscoverySettings
from msgraph_beta.generated.models.teams_app_installation import TeamsAppInstallation
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = Team(
visibility = TeamVisibilityType.Private,
display_name = "Sample Engineering Team",
description = "This is a sample engineering team, used to showcase the range of properties supported by this API",
first_channel_name = "My First Channel of the team",
channels = [
Channel(
display_name = "Announcements 📢",
is_favorite_by_default = True,
description = "This is a sample announcements channel that is favorited by default. Use this channel to make important team, product, and service announcements.",
),
Channel(
display_name = "Training 🏋️",
is_favorite_by_default = True,
description = "This is a sample training channel, that is favorited by default, and contains an example of pinned website and YouTube tabs.",
tabs = [
TeamsTab(
display_name = "A Pinned Website",
configuration = TeamsTabConfiguration(
content_url = "https://learn.microsoft.com/microsoftteams/microsoft-teams",
),
additional_data = {
"teams_app@odata_bind" : "https://graph.microsoft.com/v1.0/appCatalogs/teamsApps('com.microsoft.teamspace.tab.web')",
}
),
TeamsTab(
display_name = "A Pinned YouTube Video",
configuration = TeamsTabConfiguration(
content_url = "https://tabs.teams.microsoft.com/Youtube/Home/YoutubeTab?videoId=X8krAMdGvCQ",
website_url = "https://www.youtube.com/watch?v=X8krAMdGvCQ",
),
additional_data = {
"teams_app@odata_bind" : "https://graph.microsoft.com/v1.0/appCatalogs/teamsApps('com.microsoft.teamspace.tab.youtube')",
}
),
],
),
Channel(
display_name = "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.",
is_favorite_by_default = False,
),
Channel(
display_name = "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.",
),
],
member_settings = TeamMemberSettings(
allow_create_update_channels = True,
allow_delete_channels = True,
allow_add_remove_apps = True,
allow_create_update_remove_tabs = True,
allow_create_update_remove_connectors = True,
),
guest_settings = TeamGuestSettings(
allow_create_update_channels = False,
allow_delete_channels = False,
),
fun_settings = TeamFunSettings(
allow_giphy = True,
giphy_content_rating = GiphyRatingType.Moderate,
allow_stickers_and_memes = True,
allow_custom_memes = True,
),
messaging_settings = TeamMessagingSettings(
allow_user_edit_messages = True,
allow_user_delete_messages = True,
allow_owner_delete_messages = True,
allow_team_mentions = True,
allow_channel_mentions = True,
),
discovery_settings = TeamDiscoverySettings(
show_in_teams_search_and_suggestions = True,
),
installed_apps = [
TeamsAppInstallation(
additional_data = {
"teams_app@odata_bind" : "https://graph.microsoft.com/v1.0/appCatalogs/teamsApps('com.microsoft.teamspace.tab.vsts')",
}
),
TeamsAppInstallation(
additional_data = {
"teams_app@odata_bind" : "https://graph.microsoft.com/v1.0/appCatalogs/teamsApps('1542629c-01b3-4a6d-8f76-1938b779e48d')",
}
),
],
additional_data = {
"template@odata_bind" : "https://graph.microsoft.com/beta/teamsTemplates('standard')",
}
)
result = await graph_client.teams.post(request_body)
Importante
Los SDK de Microsoft Graph usan la versión v1.0 de la API de manera predeterminada y no admiten todos los tipos, propiedades y API disponibles en la versión beta. Para obtener más información sobre cómo acceder a la API beta con el SDK, consulte Uso de los SDK de Microsoft Graph con la API beta.
El siguiente ejemplo muestra cómo puede crear un equipo nuevo a partir de un grupo, teniendo un Id. de grupo.
Algunas cosas a tener en cuenta sobre esta llamada:
Para crear un equipo, el grupo en el que lo está creando tiene que tener como mínimo un propietario.
El equipo resultante siempre heredará del nombre de pantalla, la visibilidad, la especialización y los miembros del grupo. Por lo tanto, al realizar esta llamada con la group@odata.bind propiedad , la inclusión de displayName, visibilidad, especialización o members@odata.bind propiedades del equipo devuelve un error.
Si hace menos de 15 minutos desde que se creó el grupo, es posible que la llamada de Crear equipo falle con un código de error 404 debido a los retrasos en la replicación. Se recomienda que vuelva a intentar la llamada para Crear equipo tres veces, con un retraso de 10 segundos entre llamadas.
No se admite la especificación de un nombre de primer canal con la propiedad firstChannelName al crear un equipo a partir de un grupo.
POST https://graph.microsoft.com/beta/teams
Content-Type: application/json
{
"template@odata.bind": "https://graph.microsoft.com/beta/teamsTemplates('standard')",
"group@odata.bind": "https://graph.microsoft.com/beta/groups('71392b2f-1765-406e-86af-5907d9bdb2ab')"
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models;
var requestBody = new Team
{
AdditionalData = new Dictionary<string, object>
{
{
"template@odata.bind" , "https://graph.microsoft.com/beta/teamsTemplates('standard')"
},
{
"group@odata.bind" , "https://graph.microsoft.com/beta/groups('71392b2f-1765-406e-86af-5907d9bdb2ab')"
},
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Teams.PostAsync(requestBody);
Importante
Los SDK de Microsoft Graph usan la versión v1.0 de la API de manera predeterminada y no admiten todos los tipos, propiedades y API disponibles en la versión beta. Para obtener más información sobre cómo acceder a la API beta con el SDK, consulte Uso de los SDK de Microsoft Graph con la API beta.
Los SDK de Microsoft Graph usan la versión v1.0 de la API de manera predeterminada y no admiten todos los tipos, propiedades y API disponibles en la versión beta. Para obtener más información sobre cómo acceder a la API beta con el SDK, consulte Uso de los SDK de Microsoft Graph con la API beta.
// Code snippets are only available for the latest major version. Current major version is $v0.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-beta-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewTeam()
additionalData := map[string]interface{}{
"template@odata.bind" : "https://graph.microsoft.com/beta/teamsTemplates('standard')",
"group@odata.bind" : "https://graph.microsoft.com/beta/groups('71392b2f-1765-406e-86af-5907d9bdb2ab')",
}
requestBody.SetAdditionalData(additionalData)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
teams, err := graphClient.Teams().Post(context.Background(), requestBody, nil)
Importante
Los SDK de Microsoft Graph usan la versión v1.0 de la API de manera predeterminada y no admiten todos los tipos, propiedades y API disponibles en la versión beta. Para obtener más información sobre cómo acceder a la API beta con el SDK, consulte Uso de los SDK de Microsoft Graph con la API beta.
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
Team team = new Team();
HashMap<String, Object> additionalData = new HashMap<String, Object>();
additionalData.put("template@odata.bind", "https://graph.microsoft.com/beta/teamsTemplates('standard')");
additionalData.put("group@odata.bind", "https://graph.microsoft.com/beta/groups('71392b2f-1765-406e-86af-5907d9bdb2ab')");
team.setAdditionalData(additionalData);
Team result = graphClient.teams().post(team);
Importante
Los SDK de Microsoft Graph usan la versión v1.0 de la API de manera predeterminada y no admiten todos los tipos, propiedades y API disponibles en la versión beta. Para obtener más información sobre cómo acceder a la API beta con el SDK, consulte Uso de los SDK de Microsoft Graph con la API beta.
Los SDK de Microsoft Graph usan la versión v1.0 de la API de manera predeterminada y no admiten todos los tipos, propiedades y API disponibles en la versión beta. Para obtener más información sobre cómo acceder a la API beta con el SDK, consulte Uso de los SDK de Microsoft Graph con la API beta.
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Models\Team;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new Team();
$additionalData = [
'template@odata.bind' => 'https://graph.microsoft.com/beta/teamsTemplates(\'standard\')',
'group@odata.bind' => 'https://graph.microsoft.com/beta/groups(\'71392b2f-1765-406e-86af-5907d9bdb2ab\')',
];
$requestBody->setAdditionalData($additionalData);
$result = $graphServiceClient->teams()->post($requestBody)->wait();
Importante
Los SDK de Microsoft Graph usan la versión v1.0 de la API de manera predeterminada y no admiten todos los tipos, propiedades y API disponibles en la versión beta. Para obtener más información sobre cómo acceder a la API beta con el SDK, consulte Uso de los SDK de Microsoft Graph con la API beta.
Los SDK de Microsoft Graph usan la versión v1.0 de la API de manera predeterminada y no admiten todos los tipos, propiedades y API disponibles en la versión beta. Para obtener más información sobre cómo acceder a la API beta con el SDK, consulte Uso de los SDK de Microsoft Graph con la API beta.
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.models.team import Team
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = Team(
additional_data = {
"template@odata_bind" : "https://graph.microsoft.com/beta/teamsTemplates('standard')",
"group@odata_bind" : "https://graph.microsoft.com/beta/groups('71392b2f-1765-406e-86af-5907d9bdb2ab')",
}
)
result = await graph_client.teams.post(request_body)
Importante
Los SDK de Microsoft Graph usan la versión v1.0 de la API de manera predeterminada y no admiten todos los tipos, propiedades y API disponibles en la versión beta. Para obtener más información sobre cómo acceder a la API beta con el SDK, consulte Uso de los SDK de Microsoft Graph con la API beta.
Ejemplo 5: crear un equipo desde un grupo con varios canales, aplicaciones instaladas y pestañas ancladas
En el ejemplo siguiente se muestra una solicitud que convierte un grupo existente con propiedades extendidas que crean el equipo con varios canales, aplicaciones instaladas y pestañas ancladas.
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models;
var requestBody = new Team
{
Channels = new List<Channel>
{
new Channel
{
DisplayName = "Class Announcements 📢",
IsFavoriteByDefault = true,
},
new Channel
{
DisplayName = "Homework 🏋️",
IsFavoriteByDefault = true,
},
},
MemberSettings = new TeamMemberSettings
{
AllowCreateUpdateChannels = false,
AllowDeleteChannels = false,
AllowAddRemoveApps = false,
AllowCreateUpdateRemoveTabs = false,
AllowCreateUpdateRemoveConnectors = false,
},
InstalledApps = new List<TeamsAppInstallation>
{
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/beta/teamsTemplates('standard')"
},
{
"group@odata.bind" , "https://graph.microsoft.com/beta/groups('dbd8de4f-5d47-48da-87f1-594bed003375')"
},
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Teams.PostAsync(requestBody);
Importante
Los SDK de Microsoft Graph usan la versión v1.0 de la API de manera predeterminada y no admiten todos los tipos, propiedades y API disponibles en la versión beta. Para obtener más información sobre cómo acceder a la API beta con el SDK, consulte Uso de los SDK de Microsoft Graph con la API beta.
Los SDK de Microsoft Graph usan la versión v1.0 de la API de manera predeterminada y no admiten todos los tipos, propiedades y API disponibles en la versión beta. Para obtener más información sobre cómo acceder a la API beta con el SDK, consulte Uso de los SDK de Microsoft Graph con la API beta.
Los SDK de Microsoft Graph usan la versión v1.0 de la API de manera predeterminada y no admiten todos los tipos, propiedades y API disponibles en la versión beta. Para obtener más información sobre cómo acceder a la API beta con el SDK, consulte Uso de los SDK de Microsoft Graph con la API beta.
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
Team team = new Team();
LinkedList<Channel> channels = new LinkedList<Channel>();
Channel channel = new Channel();
channel.setDisplayName("Class Announcements 📢");
channel.setIsFavoriteByDefault(true);
channels.add(channel);
Channel channel1 = new Channel();
channel1.setDisplayName("Homework 🏋️");
channel1.setIsFavoriteByDefault(true);
channels.add(channel1);
team.setChannels(channels);
TeamMemberSettings memberSettings = new TeamMemberSettings();
memberSettings.setAllowCreateUpdateChannels(false);
memberSettings.setAllowDeleteChannels(false);
memberSettings.setAllowAddRemoveApps(false);
memberSettings.setAllowCreateUpdateRemoveTabs(false);
memberSettings.setAllowCreateUpdateRemoveConnectors(false);
team.setMemberSettings(memberSettings);
LinkedList<TeamsAppInstallation> installedApps = new LinkedList<TeamsAppInstallation>();
TeamsAppInstallation teamsAppInstallation = new TeamsAppInstallation();
HashMap<String, Object> additionalData = new HashMap<String, Object>();
additionalData.put("teamsApp@odata.bind", "https://graph.microsoft.com/v1.0/appCatalogs/teamsApps('com.microsoft.teamspace.tab.vsts')");
teamsAppInstallation.setAdditionalData(additionalData);
installedApps.add(teamsAppInstallation);
TeamsAppInstallation teamsAppInstallation1 = new TeamsAppInstallation();
HashMap<String, Object> additionalData1 = new HashMap<String, Object>();
additionalData1.put("teamsApp@odata.bind", "https://graph.microsoft.com/v1.0/appCatalogs/teamsApps('1542629c-01b3-4a6d-8f76-1938b779e48d')");
teamsAppInstallation1.setAdditionalData(additionalData1);
installedApps.add(teamsAppInstallation1);
team.setInstalledApps(installedApps);
HashMap<String, Object> additionalData2 = new HashMap<String, Object>();
additionalData2.put("template@odata.bind", "https://graph.microsoft.com/beta/teamsTemplates('standard')");
additionalData2.put("group@odata.bind", "https://graph.microsoft.com/beta/groups('dbd8de4f-5d47-48da-87f1-594bed003375')");
team.setAdditionalData(additionalData2);
Team result = graphClient.teams().post(team);
Importante
Los SDK de Microsoft Graph usan la versión v1.0 de la API de manera predeterminada y no admiten todos los tipos, propiedades y API disponibles en la versión beta. Para obtener más información sobre cómo acceder a la API beta con el SDK, consulte Uso de los SDK de Microsoft Graph con la API beta.
Los SDK de Microsoft Graph usan la versión v1.0 de la API de manera predeterminada y no admiten todos los tipos, propiedades y API disponibles en la versión beta. Para obtener más información sobre cómo acceder a la API beta con el SDK, consulte Uso de los SDK de Microsoft Graph con la API beta.
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Models\Team;
use Microsoft\Graph\Beta\Generated\Models\Channel;
use Microsoft\Graph\Beta\Generated\Models\TeamMemberSettings;
use Microsoft\Graph\Beta\Generated\Models\TeamsAppInstallation;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new Team();
$channelsChannel1 = new Channel();
$channelsChannel1->setDisplayName('Class Announcements 📢');
$channelsChannel1->setIsFavoriteByDefault(true);
$channelsArray []= $channelsChannel1;
$channelsChannel2 = new Channel();
$channelsChannel2->setDisplayName('Homework 🏋️');
$channelsChannel2->setIsFavoriteByDefault(true);
$channelsArray []= $channelsChannel2;
$requestBody->setChannels($channelsArray);
$memberSettings = new TeamMemberSettings();
$memberSettings->setAllowCreateUpdateChannels(false);
$memberSettings->setAllowDeleteChannels(false);
$memberSettings->setAllowAddRemoveApps(false);
$memberSettings->setAllowCreateUpdateRemoveTabs(false);
$memberSettings->setAllowCreateUpdateRemoveConnectors(false);
$requestBody->setMemberSettings($memberSettings);
$installedAppsTeamsAppInstallation1 = new TeamsAppInstallation();
$additionalData = [
'teamsApp@odata.bind' => 'https://graph.microsoft.com/v1.0/appCatalogs/teamsApps(\'com.microsoft.teamspace.tab.vsts\')',
];
$installedAppsTeamsAppInstallation1->setAdditionalData($additionalData);
$installedAppsArray []= $installedAppsTeamsAppInstallation1;
$installedAppsTeamsAppInstallation2 = new TeamsAppInstallation();
$additionalData = [
'teamsApp@odata.bind' => 'https://graph.microsoft.com/v1.0/appCatalogs/teamsApps(\'1542629c-01b3-4a6d-8f76-1938b779e48d\')',
];
$installedAppsTeamsAppInstallation2->setAdditionalData($additionalData);
$installedAppsArray []= $installedAppsTeamsAppInstallation2;
$requestBody->setInstalledApps($installedAppsArray);
$additionalData = [
'template@odata.bind' => 'https://graph.microsoft.com/beta/teamsTemplates(\'standard\')',
'group@odata.bind' => 'https://graph.microsoft.com/beta/groups(\'dbd8de4f-5d47-48da-87f1-594bed003375\')',
];
$requestBody->setAdditionalData($additionalData);
$result = $graphServiceClient->teams()->post($requestBody)->wait();
Importante
Los SDK de Microsoft Graph usan la versión v1.0 de la API de manera predeterminada y no admiten todos los tipos, propiedades y API disponibles en la versión beta. Para obtener más información sobre cómo acceder a la API beta con el SDK, consulte Uso de los SDK de Microsoft Graph con la API beta.
Los SDK de Microsoft Graph usan la versión v1.0 de la API de manera predeterminada y no admiten todos los tipos, propiedades y API disponibles en la versión beta. Para obtener más información sobre cómo acceder a la API beta con el SDK, consulte Uso de los SDK de Microsoft Graph con la API beta.
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.models.team import Team
from msgraph_beta.generated.models.channel import Channel
from msgraph_beta.generated.models.team_member_settings import TeamMemberSettings
from msgraph_beta.generated.models.teams_app_installation import TeamsAppInstallation
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = Team(
channels = [
Channel(
display_name = "Class Announcements 📢",
is_favorite_by_default = True,
),
Channel(
display_name = "Homework 🏋️",
is_favorite_by_default = True,
),
],
member_settings = TeamMemberSettings(
allow_create_update_channels = False,
allow_delete_channels = False,
allow_add_remove_apps = False,
allow_create_update_remove_tabs = False,
allow_create_update_remove_connectors = False,
),
installed_apps = [
TeamsAppInstallation(
additional_data = {
"teams_app@odata_bind" : "https://graph.microsoft.com/v1.0/appCatalogs/teamsApps('com.microsoft.teamspace.tab.vsts')",
}
),
TeamsAppInstallation(
additional_data = {
"teams_app@odata_bind" : "https://graph.microsoft.com/v1.0/appCatalogs/teamsApps('1542629c-01b3-4a6d-8f76-1938b779e48d')",
}
),
],
additional_data = {
"template@odata_bind" : "https://graph.microsoft.com/beta/teamsTemplates('standard')",
"group@odata_bind" : "https://graph.microsoft.com/beta/groups('dbd8de4f-5d47-48da-87f1-594bed003375')",
}
)
result = await graph_client.teams.post(request_body)
Importante
Los SDK de Microsoft Graph usan la versión v1.0 de la API de manera predeterminada y no admiten todos los tipos, propiedades y API disponibles en la versión beta. Para obtener más información sobre cómo acceder a la API beta con el SDK, consulte Uso de los SDK de Microsoft Graph con la API beta.
Ejemplo 6: Creación de un equipo con un tipo de plantilla base no estándar
Los tipos de plantilla base son plantillas especiales que Microsoft creó para sectores específicos. Estas plantillas base suelen contener aplicaciones propietarias que no están disponibles en las propiedades de la tienda y del equipo que aún no se admiten individualmente en las plantillas de Microsoft Teams.
Para crear un equipo a partir de una plantilla base no estándar, quiere cambiar la template@odata.bind propiedad en el cuerpo de la solicitud de standard a la plantilla base específica que desea crear.
POST https://graph.microsoft.com/beta/teams
Content-Type: application/json
{
"template@odata.bind": "https://graph.microsoft.com/beta/teamsTemplates('educationClass')",
"displayName": "My Class Team",
"description": "My Class Team’s Description"
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models;
var requestBody = new Team
{
DisplayName = "My Class Team",
Description = "My Class Team’s Description",
AdditionalData = new Dictionary<string, object>
{
{
"template@odata.bind" , "https://graph.microsoft.com/beta/teamsTemplates('educationClass')"
},
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Teams.PostAsync(requestBody);
Importante
Los SDK de Microsoft Graph usan la versión v1.0 de la API de manera predeterminada y no admiten todos los tipos, propiedades y API disponibles en la versión beta. Para obtener más información sobre cómo acceder a la API beta con el SDK, consulte Uso de los SDK de Microsoft Graph con la API beta.
mgc-beta teams create --body '{\
"template@odata.bind": "https://graph.microsoft.com/beta/teamsTemplates('educationClass')",\
"displayName": "My Class Team",\
"description": "My Class Team’s Description"\
}\
'
Importante
Los SDK de Microsoft Graph usan la versión v1.0 de la API de manera predeterminada y no admiten todos los tipos, propiedades y API disponibles en la versión beta. Para obtener más información sobre cómo acceder a la API beta con el SDK, consulte Uso de los SDK de Microsoft Graph con la API beta.
// Code snippets are only available for the latest major version. Current major version is $v0.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-beta-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewTeam()
displayName := "My Class Team"
requestBody.SetDisplayName(&displayName)
description := "My Class Team’s Description"
requestBody.SetDescription(&description)
additionalData := map[string]interface{}{
"template@odata.bind" : "https://graph.microsoft.com/beta/teamsTemplates('educationClass')",
}
requestBody.SetAdditionalData(additionalData)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
teams, err := graphClient.Teams().Post(context.Background(), requestBody, nil)
Importante
Los SDK de Microsoft Graph usan la versión v1.0 de la API de manera predeterminada y no admiten todos los tipos, propiedades y API disponibles en la versión beta. Para obtener más información sobre cómo acceder a la API beta con el SDK, consulte Uso de los SDK de Microsoft Graph con la API beta.
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
Team team = new Team();
team.setDisplayName("My Class Team");
team.setDescription("My Class Team’s Description");
HashMap<String, Object> additionalData = new HashMap<String, Object>();
additionalData.put("template@odata.bind", "https://graph.microsoft.com/beta/teamsTemplates('educationClass')");
team.setAdditionalData(additionalData);
Team result = graphClient.teams().post(team);
Importante
Los SDK de Microsoft Graph usan la versión v1.0 de la API de manera predeterminada y no admiten todos los tipos, propiedades y API disponibles en la versión beta. Para obtener más información sobre cómo acceder a la API beta con el SDK, consulte Uso de los SDK de Microsoft Graph con la API beta.
const options = {
authProvider,
};
const client = Client.init(options);
const team = {
'template@odata.bind': 'https://graph.microsoft.com/beta/teamsTemplates(\'educationClass\')',
displayName: 'My Class Team',
description: 'My Class Team’s Description'
};
await client.api('/teams')
.version('beta')
.post(team);
Importante
Los SDK de Microsoft Graph usan la versión v1.0 de la API de manera predeterminada y no admiten todos los tipos, propiedades y API disponibles en la versión beta. Para obtener más información sobre cómo acceder a la API beta con el SDK, consulte Uso de los SDK de Microsoft Graph con la API beta.
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Models\Team;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new Team();
$requestBody->setDisplayName('My Class Team');
$requestBody->setDescription('My Class Team’s Description');
$additionalData = [
'template@odata.bind' => 'https://graph.microsoft.com/beta/teamsTemplates(\'educationClass\')',
];
$requestBody->setAdditionalData($additionalData);
$result = $graphServiceClient->teams()->post($requestBody)->wait();
Importante
Los SDK de Microsoft Graph usan la versión v1.0 de la API de manera predeterminada y no admiten todos los tipos, propiedades y API disponibles en la versión beta. Para obtener más información sobre cómo acceder a la API beta con el SDK, consulte Uso de los SDK de Microsoft Graph con la API beta.
Import-Module Microsoft.Graph.Beta.Teams
$params = @{
"template@odata.bind" = "https://graph.microsoft.com/beta/teamsTemplates('educationClass')"
displayName = "My Class Team"
description = "My Class Team’s Description"
}
New-MgBetaTeam -BodyParameter $params
Importante
Los SDK de Microsoft Graph usan la versión v1.0 de la API de manera predeterminada y no admiten todos los tipos, propiedades y API disponibles en la versión beta. Para obtener más información sobre cómo acceder a la API beta con el SDK, consulte Uso de los SDK de Microsoft Graph con la API beta.
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.models.team import Team
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = Team(
display_name = "My Class Team",
description = "My Class Team’s Description",
additional_data = {
"template@odata_bind" : "https://graph.microsoft.com/beta/teamsTemplates('educationClass')",
}
)
result = await graph_client.teams.post(request_body)
Importante
Los SDK de Microsoft Graph usan la versión v1.0 de la API de manera predeterminada y no admiten todos los tipos, propiedades y API disponibles en la versión beta. Para obtener más información sobre cómo acceder a la API beta con el SDK, consulte Uso de los SDK de Microsoft Graph con la API beta.
Ejemplo 7: Creación de un equipo con un tipo de plantilla base no estándar localizado
Los tipos de plantilla base se pueden localizar según la elección de idioma que prefiera, lo que le permite crear plantillas en el idioma que prefiera.
Elija la plantilla de equipo de la lista de definiciones devuelta por la operación Definiciones de lista .
POST https://graph.microsoft.com/beta/teams
Content-Type: application/json
{
"templateDefinition@odata.bind": "https://graph.microsoft.com/beta/teamwork/teamTemplates/com.microsoft.teams.template.ManageAProject/definitions/Y29tLm1pY3Jvc29mdC50ZWFtcy50ZW1wbGF0ZS5NYW5hZ2VBUHJvamVjdCMjUHVibGljIyNhci1TQQ==",
"displayName": "My Sample Team",
"description": "My Sample Team’s Description"
}
Snippet not available
Importante
Los SDK de Microsoft Graph usan la versión v1.0 de la API de manera predeterminada y no admiten todos los tipos, propiedades y API disponibles en la versión beta. Para obtener más información sobre cómo acceder a la API beta con el SDK, consulte Uso de los SDK de Microsoft Graph con la API beta.
mgc-beta teams create --body '{\
"templateDefinition@odata.bind": "https://graph.microsoft.com/beta/teamwork/teamTemplates/com.microsoft.teams.template.ManageAProject/definitions/Y29tLm1pY3Jvc29mdC50ZWFtcy50ZW1wbGF0ZS5NYW5hZ2VBUHJvamVjdCMjUHVibGljIyNhci1TQQ==",\
"displayName": "My Sample Team",\
"description": "My Sample Team’s Description"\
}\
'
Importante
Los SDK de Microsoft Graph usan la versión v1.0 de la API de manera predeterminada y no admiten todos los tipos, propiedades y API disponibles en la versión beta. Para obtener más información sobre cómo acceder a la API beta con el SDK, consulte Uso de los SDK de Microsoft Graph con la API beta.
Los SDK de Microsoft Graph usan la versión v1.0 de la API de manera predeterminada y no admiten todos los tipos, propiedades y API disponibles en la versión beta. Para obtener más información sobre cómo acceder a la API beta con el SDK, consulte Uso de los SDK de Microsoft Graph con la API beta.
Los SDK de Microsoft Graph usan la versión v1.0 de la API de manera predeterminada y no admiten todos los tipos, propiedades y API disponibles en la versión beta. Para obtener más información sobre cómo acceder a la API beta con el SDK, consulte Uso de los SDK de Microsoft Graph con la API beta.
Los SDK de Microsoft Graph usan la versión v1.0 de la API de manera predeterminada y no admiten todos los tipos, propiedades y API disponibles en la versión beta. Para obtener más información sobre cómo acceder a la API beta con el SDK, consulte Uso de los SDK de Microsoft Graph con la API beta.
Los SDK de Microsoft Graph usan la versión v1.0 de la API de manera predeterminada y no admiten todos los tipos, propiedades y API disponibles en la versión beta. Para obtener más información sobre cómo acceder a la API beta con el SDK, consulte Uso de los SDK de Microsoft Graph con la API beta.
Los SDK de Microsoft Graph usan la versión v1.0 de la API de manera predeterminada y no admiten todos los tipos, propiedades y API disponibles en la versión beta. Para obtener más información sobre cómo acceder a la API beta con el SDK, consulte Uso de los SDK de Microsoft Graph con la API beta.
Los SDK de Microsoft Graph usan la versión v1.0 de la API de manera predeterminada y no admiten todos los tipos, propiedades y API disponibles en la versión beta. Para obtener más información sobre cómo acceder a la API beta con el SDK, consulte Uso de los SDK de Microsoft Graph con la API beta.
Ejemplo 8: Creación de un equipo con un tipo de plantilla base no estándar con propiedades extendidas
Los tipos de plantilla base se pueden ampliar con otras propiedades, lo que le permite compilar en una plantilla base existente con más configuraciones de equipo, canales, aplicaciones o pestañas.
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models;
var requestBody = new Team
{
DisplayName = "My Class Team",
Description = "My Class Team’s Description",
Channels = new List<Channel>
{
new Channel
{
DisplayName = "Class Announcements 📢",
IsFavoriteByDefault = true,
},
new Channel
{
DisplayName = "Homework 🏋️",
IsFavoriteByDefault = true,
},
},
MemberSettings = new TeamMemberSettings
{
AllowCreateUpdateChannels = false,
AllowDeleteChannels = false,
AllowAddRemoveApps = false,
AllowCreateUpdateRemoveTabs = false,
AllowCreateUpdateRemoveConnectors = false,
},
InstalledApps = new List<TeamsAppInstallation>
{
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/beta/teamsTemplates('educationClass')"
},
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Teams.PostAsync(requestBody);
Importante
Los SDK de Microsoft Graph usan la versión v1.0 de la API de manera predeterminada y no admiten todos los tipos, propiedades y API disponibles en la versión beta. Para obtener más información sobre cómo acceder a la API beta con el SDK, consulte Uso de los SDK de Microsoft Graph con la API beta.
Los SDK de Microsoft Graph usan la versión v1.0 de la API de manera predeterminada y no admiten todos los tipos, propiedades y API disponibles en la versión beta. Para obtener más información sobre cómo acceder a la API beta con el SDK, consulte Uso de los SDK de Microsoft Graph con la API beta.
// Code snippets are only available for the latest major version. Current major version is $v0.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-beta-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewTeam()
displayName := "My Class Team"
requestBody.SetDisplayName(&displayName)
description := "My Class Team’s Description"
requestBody.SetDescription(&description)
channel := graphmodels.NewChannel()
displayName := "Class Announcements 📢"
channel.SetDisplayName(&displayName)
isFavoriteByDefault := true
channel.SetIsFavoriteByDefault(&isFavoriteByDefault)
channel1 := graphmodels.NewChannel()
displayName := "Homework 🏋️"
channel1.SetDisplayName(&displayName)
isFavoriteByDefault := true
channel1.SetIsFavoriteByDefault(&isFavoriteByDefault)
channels := []graphmodels.Channelable {
channel,
channel1,
}
requestBody.SetChannels(channels)
memberSettings := graphmodels.NewTeamMemberSettings()
allowCreateUpdateChannels := false
memberSettings.SetAllowCreateUpdateChannels(&allowCreateUpdateChannels)
allowDeleteChannels := false
memberSettings.SetAllowDeleteChannels(&allowDeleteChannels)
allowAddRemoveApps := false
memberSettings.SetAllowAddRemoveApps(&allowAddRemoveApps)
allowCreateUpdateRemoveTabs := false
memberSettings.SetAllowCreateUpdateRemoveTabs(&allowCreateUpdateRemoveTabs)
allowCreateUpdateRemoveConnectors := false
memberSettings.SetAllowCreateUpdateRemoveConnectors(&allowCreateUpdateRemoveConnectors)
requestBody.SetMemberSettings(memberSettings)
teamsAppInstallation := graphmodels.NewTeamsAppInstallation()
additionalData := map[string]interface{}{
"teamsApp@odata.bind" : "https://graph.microsoft.com/v1.0/appCatalogs/teamsApps('com.microsoft.teamspace.tab.vsts')",
}
teamsAppInstallation.SetAdditionalData(additionalData)
teamsAppInstallation1 := graphmodels.NewTeamsAppInstallation()
additionalData := map[string]interface{}{
"teamsApp@odata.bind" : "https://graph.microsoft.com/v1.0/appCatalogs/teamsApps('1542629c-01b3-4a6d-8f76-1938b779e48d')",
}
teamsAppInstallation1.SetAdditionalData(additionalData)
installedApps := []graphmodels.TeamsAppInstallationable {
teamsAppInstallation,
teamsAppInstallation1,
}
requestBody.SetInstalledApps(installedApps)
additionalData := map[string]interface{}{
"template@odata.bind" : "https://graph.microsoft.com/beta/teamsTemplates('educationClass')",
}
requestBody.SetAdditionalData(additionalData)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
teams, err := graphClient.Teams().Post(context.Background(), requestBody, nil)
Importante
Los SDK de Microsoft Graph usan la versión v1.0 de la API de manera predeterminada y no admiten todos los tipos, propiedades y API disponibles en la versión beta. Para obtener más información sobre cómo acceder a la API beta con el SDK, consulte Uso de los SDK de Microsoft Graph con la API beta.
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
Team team = new Team();
team.setDisplayName("My Class Team");
team.setDescription("My Class Team’s Description");
LinkedList<Channel> channels = new LinkedList<Channel>();
Channel channel = new Channel();
channel.setDisplayName("Class Announcements 📢");
channel.setIsFavoriteByDefault(true);
channels.add(channel);
Channel channel1 = new Channel();
channel1.setDisplayName("Homework 🏋️");
channel1.setIsFavoriteByDefault(true);
channels.add(channel1);
team.setChannels(channels);
TeamMemberSettings memberSettings = new TeamMemberSettings();
memberSettings.setAllowCreateUpdateChannels(false);
memberSettings.setAllowDeleteChannels(false);
memberSettings.setAllowAddRemoveApps(false);
memberSettings.setAllowCreateUpdateRemoveTabs(false);
memberSettings.setAllowCreateUpdateRemoveConnectors(false);
team.setMemberSettings(memberSettings);
LinkedList<TeamsAppInstallation> installedApps = new LinkedList<TeamsAppInstallation>();
TeamsAppInstallation teamsAppInstallation = new TeamsAppInstallation();
HashMap<String, Object> additionalData = new HashMap<String, Object>();
additionalData.put("teamsApp@odata.bind", "https://graph.microsoft.com/v1.0/appCatalogs/teamsApps('com.microsoft.teamspace.tab.vsts')");
teamsAppInstallation.setAdditionalData(additionalData);
installedApps.add(teamsAppInstallation);
TeamsAppInstallation teamsAppInstallation1 = new TeamsAppInstallation();
HashMap<String, Object> additionalData1 = new HashMap<String, Object>();
additionalData1.put("teamsApp@odata.bind", "https://graph.microsoft.com/v1.0/appCatalogs/teamsApps('1542629c-01b3-4a6d-8f76-1938b779e48d')");
teamsAppInstallation1.setAdditionalData(additionalData1);
installedApps.add(teamsAppInstallation1);
team.setInstalledApps(installedApps);
HashMap<String, Object> additionalData2 = new HashMap<String, Object>();
additionalData2.put("template@odata.bind", "https://graph.microsoft.com/beta/teamsTemplates('educationClass')");
team.setAdditionalData(additionalData2);
Team result = graphClient.teams().post(team);
Importante
Los SDK de Microsoft Graph usan la versión v1.0 de la API de manera predeterminada y no admiten todos los tipos, propiedades y API disponibles en la versión beta. Para obtener más información sobre cómo acceder a la API beta con el SDK, consulte Uso de los SDK de Microsoft Graph con la API beta.
Los SDK de Microsoft Graph usan la versión v1.0 de la API de manera predeterminada y no admiten todos los tipos, propiedades y API disponibles en la versión beta. Para obtener más información sobre cómo acceder a la API beta con el SDK, consulte Uso de los SDK de Microsoft Graph con la API beta.
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Models\Team;
use Microsoft\Graph\Beta\Generated\Models\Channel;
use Microsoft\Graph\Beta\Generated\Models\TeamMemberSettings;
use Microsoft\Graph\Beta\Generated\Models\TeamsAppInstallation;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new Team();
$requestBody->setDisplayName('My Class Team');
$requestBody->setDescription('My Class Team’s Description');
$channelsChannel1 = new Channel();
$channelsChannel1->setDisplayName('Class Announcements 📢');
$channelsChannel1->setIsFavoriteByDefault(true);
$channelsArray []= $channelsChannel1;
$channelsChannel2 = new Channel();
$channelsChannel2->setDisplayName('Homework 🏋️');
$channelsChannel2->setIsFavoriteByDefault(true);
$channelsArray []= $channelsChannel2;
$requestBody->setChannels($channelsArray);
$memberSettings = new TeamMemberSettings();
$memberSettings->setAllowCreateUpdateChannels(false);
$memberSettings->setAllowDeleteChannels(false);
$memberSettings->setAllowAddRemoveApps(false);
$memberSettings->setAllowCreateUpdateRemoveTabs(false);
$memberSettings->setAllowCreateUpdateRemoveConnectors(false);
$requestBody->setMemberSettings($memberSettings);
$installedAppsTeamsAppInstallation1 = new TeamsAppInstallation();
$additionalData = [
'teamsApp@odata.bind' => 'https://graph.microsoft.com/v1.0/appCatalogs/teamsApps(\'com.microsoft.teamspace.tab.vsts\')',
];
$installedAppsTeamsAppInstallation1->setAdditionalData($additionalData);
$installedAppsArray []= $installedAppsTeamsAppInstallation1;
$installedAppsTeamsAppInstallation2 = new TeamsAppInstallation();
$additionalData = [
'teamsApp@odata.bind' => 'https://graph.microsoft.com/v1.0/appCatalogs/teamsApps(\'1542629c-01b3-4a6d-8f76-1938b779e48d\')',
];
$installedAppsTeamsAppInstallation2->setAdditionalData($additionalData);
$installedAppsArray []= $installedAppsTeamsAppInstallation2;
$requestBody->setInstalledApps($installedAppsArray);
$additionalData = [
'template@odata.bind' => 'https://graph.microsoft.com/beta/teamsTemplates(\'educationClass\')',
];
$requestBody->setAdditionalData($additionalData);
$result = $graphServiceClient->teams()->post($requestBody)->wait();
Importante
Los SDK de Microsoft Graph usan la versión v1.0 de la API de manera predeterminada y no admiten todos los tipos, propiedades y API disponibles en la versión beta. Para obtener más información sobre cómo acceder a la API beta con el SDK, consulte Uso de los SDK de Microsoft Graph con la API beta.
Los SDK de Microsoft Graph usan la versión v1.0 de la API de manera predeterminada y no admiten todos los tipos, propiedades y API disponibles en la versión beta. Para obtener más información sobre cómo acceder a la API beta con el SDK, consulte Uso de los SDK de Microsoft Graph con la API beta.
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.models.team import Team
from msgraph_beta.generated.models.channel import Channel
from msgraph_beta.generated.models.team_member_settings import TeamMemberSettings
from msgraph_beta.generated.models.teams_app_installation import TeamsAppInstallation
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = Team(
display_name = "My Class Team",
description = "My Class Team’s Description",
channels = [
Channel(
display_name = "Class Announcements 📢",
is_favorite_by_default = True,
),
Channel(
display_name = "Homework 🏋️",
is_favorite_by_default = True,
),
],
member_settings = TeamMemberSettings(
allow_create_update_channels = False,
allow_delete_channels = False,
allow_add_remove_apps = False,
allow_create_update_remove_tabs = False,
allow_create_update_remove_connectors = False,
),
installed_apps = [
TeamsAppInstallation(
additional_data = {
"teams_app@odata_bind" : "https://graph.microsoft.com/v1.0/appCatalogs/teamsApps('com.microsoft.teamspace.tab.vsts')",
}
),
TeamsAppInstallation(
additional_data = {
"teams_app@odata_bind" : "https://graph.microsoft.com/v1.0/appCatalogs/teamsApps('1542629c-01b3-4a6d-8f76-1938b779e48d')",
}
),
],
additional_data = {
"template@odata_bind" : "https://graph.microsoft.com/beta/teamsTemplates('educationClass')",
}
)
result = await graph_client.teams.post(request_body)
Importante
Los SDK de Microsoft Graph usan la versión v1.0 de la API de manera predeterminada y no admiten todos los tipos, propiedades y API disponibles en la versión beta. Para obtener más información sobre cómo acceder a la API beta con el SDK, consulte Uso de los SDK de Microsoft Graph con la API beta.
Ejemplo 9: Creación de un equipo en modo de migración
Solicitud
En el siguiente ejemplo se muestra cómo crear un equipo para mensajes importados.
Nota: En el futuro, Microsoft puede solicitarle a usted o a sus clientes que paguen tarifas adicionales en función de la cantidad de datos que se importen.|
Nota: Teams creado en modo de migración solo admite la standard plantilla.
Nota: Esta llamada no admite la propiedad firstChannelName .
POST https://graph.microsoft.com/beta/teams
Content-Type: application/json
{
"@microsoft.graph.teamCreationMode": "migration",
"template@odata.bind": "https://graph.microsoft.com/beta/teamsTemplates('standard')",
"displayName": "My Sample Team",
"description": "My Sample Team’s Description",
"createdDateTime": "2020-03-14T11:22:17.067Z"
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models;
var requestBody = new Team
{
DisplayName = "My Sample Team",
Description = "My Sample Team’s Description",
CreatedDateTime = DateTimeOffset.Parse("2020-03-14T11:22:17.067Z"),
AdditionalData = new Dictionary<string, object>
{
{
"@microsoft.graph.teamCreationMode" , "migration"
},
{
"template@odata.bind" , "https://graph.microsoft.com/beta/teamsTemplates('standard')"
},
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Teams.PostAsync(requestBody);
Importante
Los SDK de Microsoft Graph usan la versión v1.0 de la API de manera predeterminada y no admiten todos los tipos, propiedades y API disponibles en la versión beta. Para obtener más información sobre cómo acceder a la API beta con el SDK, consulte Uso de los SDK de Microsoft Graph con la API beta.
mgc-beta teams create --body '{\
"@microsoft.graph.teamCreationMode": "migration",\
"template@odata.bind": "https://graph.microsoft.com/beta/teamsTemplates('standard')",\
"displayName": "My Sample Team",\
"description": "My Sample Team’s Description",\
"createdDateTime": "2020-03-14T11:22:17.067Z"\
}\
'
Importante
Los SDK de Microsoft Graph usan la versión v1.0 de la API de manera predeterminada y no admiten todos los tipos, propiedades y API disponibles en la versión beta. Para obtener más información sobre cómo acceder a la API beta con el SDK, consulte Uso de los SDK de Microsoft Graph con la API beta.
// Code snippets are only available for the latest major version. Current major version is $v0.*
// Dependencies
import (
"context"
"time"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-beta-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewTeam()
displayName := "My Sample Team"
requestBody.SetDisplayName(&displayName)
description := "My Sample Team’s Description"
requestBody.SetDescription(&description)
createdDateTime , err := time.Parse(time.RFC3339, "2020-03-14T11:22:17.067Z")
requestBody.SetCreatedDateTime(&createdDateTime)
additionalData := map[string]interface{}{
"@microsoft.graph.teamCreationMode" : "migration",
"template@odata.bind" : "https://graph.microsoft.com/beta/teamsTemplates('standard')",
}
requestBody.SetAdditionalData(additionalData)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
teams, err := graphClient.Teams().Post(context.Background(), requestBody, nil)
Importante
Los SDK de Microsoft Graph usan la versión v1.0 de la API de manera predeterminada y no admiten todos los tipos, propiedades y API disponibles en la versión beta. Para obtener más información sobre cómo acceder a la API beta con el SDK, consulte Uso de los SDK de Microsoft Graph con la API beta.
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
Team team = new Team();
team.setDisplayName("My Sample Team");
team.setDescription("My Sample Team’s Description");
OffsetDateTime createdDateTime = OffsetDateTime.parse("2020-03-14T11:22:17.067Z");
team.setCreatedDateTime(createdDateTime);
HashMap<String, Object> additionalData = new HashMap<String, Object>();
additionalData.put("@microsoft.graph.teamCreationMode", "migration");
additionalData.put("template@odata.bind", "https://graph.microsoft.com/beta/teamsTemplates('standard')");
team.setAdditionalData(additionalData);
Team result = graphClient.teams().post(team);
Importante
Los SDK de Microsoft Graph usan la versión v1.0 de la API de manera predeterminada y no admiten todos los tipos, propiedades y API disponibles en la versión beta. Para obtener más información sobre cómo acceder a la API beta con el SDK, consulte Uso de los SDK de Microsoft Graph con la API beta.
Los SDK de Microsoft Graph usan la versión v1.0 de la API de manera predeterminada y no admiten todos los tipos, propiedades y API disponibles en la versión beta. Para obtener más información sobre cómo acceder a la API beta con el SDK, consulte Uso de los SDK de Microsoft Graph con la API beta.
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Models\Team;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new Team();
$requestBody->setDisplayName('My Sample Team');
$requestBody->setDescription('My Sample Team’s Description');
$requestBody->setCreatedDateTime(new \DateTime('2020-03-14T11:22:17.067Z'));
$additionalData = [
'@microsoft.graph.teamCreationMode' => 'migration',
'template@odata.bind' => 'https://graph.microsoft.com/beta/teamsTemplates(\'standard\')',
];
$requestBody->setAdditionalData($additionalData);
$result = $graphServiceClient->teams()->post($requestBody)->wait();
Importante
Los SDK de Microsoft Graph usan la versión v1.0 de la API de manera predeterminada y no admiten todos los tipos, propiedades y API disponibles en la versión beta. Para obtener más información sobre cómo acceder a la API beta con el SDK, consulte Uso de los SDK de Microsoft Graph con la API beta.
Los SDK de Microsoft Graph usan la versión v1.0 de la API de manera predeterminada y no admiten todos los tipos, propiedades y API disponibles en la versión beta. Para obtener más información sobre cómo acceder a la API beta con el SDK, consulte Uso de los SDK de Microsoft Graph con la API beta.
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.models.team import Team
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = Team(
display_name = "My Sample Team",
description = "My Sample Team’s Description",
created_date_time = "2020-03-14T11:22:17.067Z",
additional_data = {
"@microsoft_graph_team_creation_mode" : "migration",
"template@odata_bind" : "https://graph.microsoft.com/beta/teamsTemplates('standard')",
}
)
result = await graph_client.teams.post(request_body)
Importante
Los SDK de Microsoft Graph usan la versión v1.0 de la API de manera predeterminada y no admiten todos los tipos, propiedades y API disponibles en la versión beta. Para obtener más información sobre cómo acceder a la API beta con el SDK, consulte Uso de los SDK de Microsoft Graph con la API beta.
Si la solicitud no se ejecuta correctamente, este método devuelve un código de respuesta 400 Bad Request.
400 Bad Request
A continuación, se presentan motivos habituales por los que se genera esta respuesta:
createdDateTime está establecido en una fecha futura.
createdDateTime está especificada correctamente, pero no se encuentra el atributo de instancia teamCreationMode o se ha establecido en un valor que no es válido.
Ejemplo 10: Permisos de aplicación con el nombre principal de usuario
Este es un ejemplo de una solicitud mínima mediante permisos de aplicación. Dado que el cliente omitió otras propiedades, toma implícitamente valores predeterminados de la plantilla predefinida representada por template. Debe especificar un usuario en la members colección para las solicitudes con permisos de aplicación.
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models;
var requestBody = new Team
{
DisplayName = "My Sample Team",
Description = "My Sample Team’s Description",
Members = new List<ConversationMember>
{
new AadUserConversationMember
{
OdataType = "#microsoft.graph.aadUserConversationMember",
Roles = new List<string>
{
"owner",
},
AdditionalData = new Dictionary<string, object>
{
{
"user@odata.bind" , "https://graph.microsoft.com/beta/users('jacob@contoso.com')"
},
},
},
},
AdditionalData = new Dictionary<string, object>
{
{
"template@odata.bind" , "https://graph.microsoft.com/beta/teamsTemplates('standard')"
},
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Teams.PostAsync(requestBody);
Importante
Los SDK de Microsoft Graph usan la versión v1.0 de la API de manera predeterminada y no admiten todos los tipos, propiedades y API disponibles en la versión beta. Para obtener más información sobre cómo acceder a la API beta con el SDK, consulte Uso de los SDK de Microsoft Graph con la API beta.
Los SDK de Microsoft Graph usan la versión v1.0 de la API de manera predeterminada y no admiten todos los tipos, propiedades y API disponibles en la versión beta. Para obtener más información sobre cómo acceder a la API beta con el SDK, consulte Uso de los SDK de Microsoft Graph con la API beta.
// Code snippets are only available for the latest major version. Current major version is $v0.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-beta-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewTeam()
displayName := "My Sample Team"
requestBody.SetDisplayName(&displayName)
description := "My Sample Team’s Description"
requestBody.SetDescription(&description)
conversationMember := graphmodels.NewAadUserConversationMember()
roles := []string {
"owner",
}
conversationMember.SetRoles(roles)
additionalData := map[string]interface{}{
"user@odata.bind" : "https://graph.microsoft.com/beta/users('jacob@contoso.com')",
}
conversationMember.SetAdditionalData(additionalData)
members := []graphmodels.ConversationMemberable {
conversationMember,
}
requestBody.SetMembers(members)
additionalData := map[string]interface{}{
"template@odata.bind" : "https://graph.microsoft.com/beta/teamsTemplates('standard')",
}
requestBody.SetAdditionalData(additionalData)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
teams, err := graphClient.Teams().Post(context.Background(), requestBody, nil)
Importante
Los SDK de Microsoft Graph usan la versión v1.0 de la API de manera predeterminada y no admiten todos los tipos, propiedades y API disponibles en la versión beta. Para obtener más información sobre cómo acceder a la API beta con el SDK, consulte Uso de los SDK de Microsoft Graph con la API beta.
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
Team team = new Team();
team.setDisplayName("My Sample Team");
team.setDescription("My Sample Team’s Description");
LinkedList<ConversationMember> members = new LinkedList<ConversationMember>();
AadUserConversationMember conversationMember = new AadUserConversationMember();
conversationMember.setOdataType("#microsoft.graph.aadUserConversationMember");
LinkedList<String> roles = new LinkedList<String>();
roles.add("owner");
conversationMember.setRoles(roles);
HashMap<String, Object> additionalData = new HashMap<String, Object>();
additionalData.put("user@odata.bind", "https://graph.microsoft.com/beta/users('jacob@contoso.com')");
conversationMember.setAdditionalData(additionalData);
members.add(conversationMember);
team.setMembers(members);
HashMap<String, Object> additionalData1 = new HashMap<String, Object>();
additionalData1.put("template@odata.bind", "https://graph.microsoft.com/beta/teamsTemplates('standard')");
team.setAdditionalData(additionalData1);
Team result = graphClient.teams().post(team);
Importante
Los SDK de Microsoft Graph usan la versión v1.0 de la API de manera predeterminada y no admiten todos los tipos, propiedades y API disponibles en la versión beta. Para obtener más información sobre cómo acceder a la API beta con el SDK, consulte Uso de los SDK de Microsoft Graph con la API beta.
Los SDK de Microsoft Graph usan la versión v1.0 de la API de manera predeterminada y no admiten todos los tipos, propiedades y API disponibles en la versión beta. Para obtener más información sobre cómo acceder a la API beta con el SDK, consulte Uso de los SDK de Microsoft Graph con la API beta.
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Models\Team;
use Microsoft\Graph\Beta\Generated\Models\ConversationMember;
use Microsoft\Graph\Beta\Generated\Models\AadUserConversationMember;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new Team();
$requestBody->setDisplayName('My Sample Team');
$requestBody->setDescription('My Sample Team’s Description');
$membersConversationMember1 = new AadUserConversationMember();
$membersConversationMember1->setOdataType('#microsoft.graph.aadUserConversationMember');
$membersConversationMember1->setRoles(['owner', ]);
$additionalData = [
'user@odata.bind' => 'https://graph.microsoft.com/beta/users(\'jacob@contoso.com\')',
];
$membersConversationMember1->setAdditionalData($additionalData);
$membersArray []= $membersConversationMember1;
$requestBody->setMembers($membersArray);
$additionalData = [
'template@odata.bind' => 'https://graph.microsoft.com/beta/teamsTemplates(\'standard\')',
];
$requestBody->setAdditionalData($additionalData);
$result = $graphServiceClient->teams()->post($requestBody)->wait();
Importante
Los SDK de Microsoft Graph usan la versión v1.0 de la API de manera predeterminada y no admiten todos los tipos, propiedades y API disponibles en la versión beta. Para obtener más información sobre cómo acceder a la API beta con el SDK, consulte Uso de los SDK de Microsoft Graph con la API beta.
Los SDK de Microsoft Graph usan la versión v1.0 de la API de manera predeterminada y no admiten todos los tipos, propiedades y API disponibles en la versión beta. Para obtener más información sobre cómo acceder a la API beta con el SDK, consulte Uso de los SDK de Microsoft Graph con la API beta.
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.models.team import Team
from msgraph_beta.generated.models.conversation_member import ConversationMember
from msgraph_beta.generated.models.aad_user_conversation_member import AadUserConversationMember
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = Team(
display_name = "My Sample Team",
description = "My Sample Team’s Description",
members = [
AadUserConversationMember(
odata_type = "#microsoft.graph.aadUserConversationMember",
roles = [
"owner",
],
additional_data = {
"user@odata_bind" : "https://graph.microsoft.com/beta/users('jacob@contoso.com')",
}
),
],
additional_data = {
"template@odata_bind" : "https://graph.microsoft.com/beta/teamsTemplates('standard')",
}
)
result = await graph_client.teams.post(request_body)
Importante
Los SDK de Microsoft Graph usan la versión v1.0 de la API de manera predeterminada y no admiten todos los tipos, propiedades y API disponibles en la versión beta. Para obtener más información sobre cómo acceder a la API beta con el SDK, consulte Uso de los SDK de Microsoft Graph con la API beta.