question

MohammedAkter-9409 avatar image
MohammedAkter-9409 asked ·

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\"}}}

office-teams-app-devmicrosoft-graph-sdk
2 comments
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Could you please share the requestid and timestamp when it failed and also try checking it in Postman using App token and see if it works.

0 Votes 0 · ·

Please add a header MS-APP-ACTS-AS and its value as your Userid and give it a try. It worked for me.

33579-image.png


0 Votes 0 · ·
image.png (95.8 KiB)
MohammedAkter-9409 avatar image
MohammedAkter-9409 answered ·

date: 2020-10-20T08:19:13
request-id: f03df38d-c500-42d1-b429-edd4f3fa37a5

Share
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

ShivaKeshavVarma-2446 avatar image
ShivaKeshavVarma-2446 answered ·

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.


33627-image.png



Please refer this SO thread.

(If the reply was helpful please don't forget to upvote or accept as answer, thank you)


image.png (95.8 KiB)
Share
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

MohammedAkter-9409 avatar image
MohammedAkter-9409 answered ·

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 .

Share
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

MohammedAkter-9409 avatar image
MohammedAkter-9409 answered ·

Hi ShivaKeshavVarma , I have sorted out this problem .You need to enable
Open shifts in your team. 34343-solvedproblem.png


solvedproblem.png (10.0 KiB)
Share
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.