Not Pulling in all Shifts when I query

Oliver, Andrea 20 Reputation points
2024-09-12T14:59:35.2133333+00:00

Is there a known issue with the Team's Shift data coming out of Microsoft Graph? When I run the following query;

https://graph.microsoft.com/v1.0/teams/{teamid}/schedule/shifts

I get results, however I noticed that all shifts from 2 scheduling groups are not in the results. I did confirm that the 2 scheduling groups are resulting when I query

https://graph.microsoft.com/v1.0/teams/{teamid}/schedule/schedulingGroups

Is there something else that I should be doing to ensure we are getting all shifts that are present in our Microsofts Team's Schedule?

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,065 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Rohit Raghuwanshi - MSFT 470 Reputation points Microsoft Vendor
    2024-09-13T12:11:34.99+00:00

    Hi Oliver, Andrea,

    I recreated this scenario in my environment and successfully retrieved all the shifts for both scheduling groups. Please verify if the shifts that are missing in the response from the /schedule/shifts endpoint are open shifts; if so, those shifts are retrieved by a different endpoint, /schedule/openshifts.

    Please ensure to provide Schedule.Read.All permission to access this resource.

    Please refer attached screenshot for reference:

    1. Shifts screenshot showing 1 Open shift and 6 user shifts: User's image
    2. Graph API to fetch all user shifts for all scheduling groups:

    User's image

    1.

    Graph API call to fetch open shifts

    User's image

    For details, please refer below:

    https://learn.microsoft.com/en-us/graph/api/resources/openshift?view=graph-rest-1.0

    https://learn.microsoft.com/en-us/graph/api/resources/shift?view=graph-rest-1.0

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

    0 comments No comments

  2. Oliver, Andrea 20 Reputation points
    2024-09-13T13:07:53.31+00:00

    Thank you @Rohit Raghuwanshi - MSFT for taking the time to look into this and providing such a detailed response. We figured out that there is a limit of records the query allows for before there is a @odata.nextLink option. For our query, it seemed to be 2717 records.User's imageUser's image

    Once we clicked that link, it brought us to a new query with additional records. That continued until we got all of our records.

    User's image

    I hope this response helps others that may run into the same issues.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.