Failed to execute Templates backend request CreateTeamFromTemplateRequest

Nirmallya Ghosh 20 Reputation points
2023-05-15T01:22:36.6166667+00:00

I am trying to create teams using below body -

BODY -

{

"template@odata.bind": "https://graph.microsoft.com/v1.0/teamsTemplates('standard')",

"displayName": "My Sample Team234",

"description": "My Sample Team’s Description"

}

URL -

https://graph.microsoft.com/v1.0/teams

ACCESS TOKEN

I am Getting Access Token -

[https://login.microsoftonline.com/***********/oauth2/v2.0/token

BODY](https://login.microsoftonline.com/***********/oauth2/v2.0/token%EF%BF%BC%EF%BF%BCBODY) -

curl --location 'https://login.microsoftonline.com/64c0bbc0-64/oauth2/v2.0/token' \ --data-urlencode 'client_id=' \ --data-urlencode 'scope=https://graph.microsoft.com/.default' \ --data-urlencode 'client_secret=V***************' \ --data-urlencode 'grant_type=client_credentials'

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

Accepted answer
  1. CarlZhao-MSFT 40,311 Reputation points
    2023-05-15T08:48:48.7266667+00:00

    Hi @Nirmallya Ghosh

    When issuing a request with application permissions, a user must be specified in the members collection.

    POST https://graph.microsoft.com/v1.0/teams
    Content-Type: application/json
    
    {
       "template@odata.bind":"https://graph.microsoft.com/v1.0/teamsTemplates('standard')",
       "displayName":"My Sample Team",
       "description":"My Sample Team’s Description",
       "members":[
          {
             "@odata.type":"#microsoft.graph.aadUserConversationMember",
             "roles":[
                "owner"
             ],
             "user@odata.bind":"https://graph.microsoft.com/v1.0/users('0040b377-61d8-43db-94f5-81374122dc7e')"
          }
       ]
    }
    

    User's image

    Hope this helps.

    If the reply is helpful, please click Accept Answer and kindly upvote it. If you have additional questions about this answer, please click Comment.


0 additional answers

Sort by: Most helpful