It sounds like you're encountering a limitation or condition with the Microsoft Graph API's getTeamsTeamActivityDetail
endpoint. This issue where the API consistently returns 1011 records regardless of the period specified, even though there are 1238 teams in your organization.
Steps to Adjust Your Query
- Check Activity: Ensure that all teams have had some activity in the specified time frame. You can do this by manually checking the activity for those teams.
- Increase the Period: Try using a broader period (like D180) to see if that captures more teams.
- Use Correct Parameters: Ensure your query is correctly formatted with the required parameters. For example:
GET
- Check Permissions: Verify that your application has the necessary permissions to access all team activity. You may need to check Azure AD for permissions such as
Team.ReadBasic.All
orTeam.Read.All
. - Review API Limits: Consult the Microsoft Graph documentation for any limitations regarding the number of teams or records returned.
- Handle Pagination: If the API supports pagination, ensure that you handle this in your requests to retrieve all data.
Reference Document-https://learn.microsoft.com/en-us/graph/api/reportroot-getteamsteamactivitydetail?view=graph-rest-1.0&tabs=http
Example Adjusted Query
Here’s an example of how you might structure your request:
GET https://graph.microsoft.com/v1.0/reports/getTeamsTeamActivityDetail(period='D180')
Authorization: Bearer {token}