date: 2020-10-20T08:19:13
request-id: f03df38d-c500-42d1-b429-edd4f3fa37a5
Error message :"Sorry, open shifts is not enabled for your team" when trying to access open shift with Client Credential flow
Hi ,I am trying to access "GET https://graph.microsoft.com/v1.0/teams/our teamid/schedule/openShifts " which gives us list of open shifts for a particular team. It works with the public client application when the logged on user is the owner of the team.
However this same API is not working for Client Credential flow .It is throwing the following exception-
{"Code: Forbidden\r\nMessage: {\"error\":{\"code\":\"Forbidden\",\"message\":\"Sorry, open shifts is not enabled for your team.\",\"details\":[],\"innererror\":{\"code\":\"FeatureNotEnabled\"}}}
-
Mohammed Akter 96 Reputation points
2020-10-20T08:23:05.47+00:00
3 additional answers
Sort by: Most helpful
-
Shiva Keshav Varma 401 Reputation points
2020-10-20T13:13:47.113+00:00 As Explained in the above comments, Please add a header MS-APP-ACTS-AS and its value as your Userid and give it a try. It worked for me.
Please refer this SO thread.
(If the reply was helpful please don't forget to upvote or accept as answer, thank you)
-
Mohammed Akter 96 Reputation points
2020-10-20T13:20:00.423+00:00 Hi ,I added that header before raising the error.It is about permission which is different than list of shifts end point. Can you please check why the permission is different for list of open shifts end point .
-
Mohammed Akter 96 Reputation points
2020-10-22T13:32:46.883+00:00 Hi ShivaKeshavVarma , I have sorted out this problem .You need to enable
Open shifts in your team. 34343-solvedproblem.png