Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using the Microsoft Team Beta API, provisioning Teams

I have been trying to use the Graph API, beta version, and am able to create an office 365 group , but so far no luck with adding a Microsoft Team to the group.

When i use the beta API i will get a code InvalidRequest, "Calling this API using MSGraph Application Permissions is not supported."

The request i am sending is a PUT with "https://graph.microsoft.com/beta/groups/{id}/team" with id the group id. Also i am sure the bearer token is ok, since other requests such as creating an office 365 group work fine.

Setting delegated permissions in Azure app registration or granting permissions didnt seem to work. Is this a beta issue for now or is there something else i should be looking for?

See the below error as example :

{
  "error": {
    "code": "InvalidRequest",
    "message": "Calling this API using MSGraph Application Permissions is 
not supported.",
    "innerError": {
      "request-id": "c4c28d6c-e7f2-4817-bdc7-c5985de61c92",
      "date": "2018-06-19T19:18:22"
    }
  }
}

Regards,

Jos Eilers

like image 620
user9963819 Avatar asked Sep 04 '26 20:09

user9963819


1 Answers

App-only permissions are not currently supported. It only works with delegated permissions and that too for work or school accounts. Wont work with Personal MS account

At my end, I am making a PUT request to the /beta/groups/<group id>/team endpoint with the below mentioned payload and it works:

{  
  "memberSettings": {
    "allowCreateUpdateChannels": true
  },
  "messagingSettings": {
    "allowUserEditMessages": true,
    "allowUserDeleteMessages": true
  },
  "funSettings": {
    "allowGiphy": true,
    "giphyContentRating": "strict"
  }
}

reference - Create team - Beta documentation

like image 56
Gautam Sheth Avatar answered Sep 13 '26 04:09

Gautam Sheth



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!