How to create Microsoft Team in migration mode via Graph AP-Beta version?

Sonali 1 Reputation point
2021-03-18T08:02:16.347+00:00

I am able to create team via Graph-Explorer, Postman using graph api beta version but same thing I am unable to achieve programmatically

Sample Code:

         Team SourceTeamItem= new Team  
          {  
               MemberSettings = new TeamMemberSettings  
               {  
                AllowCreateUpdateChannels = true,  
                ODataType = null  
              },  
              MessagingSettings = new TeamMessagingSettings  
             {  
                AllowUserEditMessages = true,  
                AllowUserDeleteMessages = true,  
                ODataType = null  
            },  
            FunSettings = new TeamFunSettings  
            {  
                AllowGiphy = true,  
                GiphyContentRating = GiphyRatingType.Strict,  
                ODataType = null  
            },  
            ODataType = null  
        };  

       SourceTeamItem.AdditionalData = new Dictionary<string, object>()  
       {                                          
                {"@microsoft.graph.teamCreationMode", "migration"},  
       };  


       DestinationCreatedTeam = MicrosoftHelper.InvokeApiCall(() =>  
            { return this.TeamService.Groups[TGroupID].Team.Request().CreateAsync(SourceTeamItem).Result; }, this);  

**Reference :**https://learn.microsoft.com/en-us/microsoftteams/platform/graph-api/import-messages/import-external-messages-to-teams

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,865 questions
{count} votes