Why does the API getTeamsTeamActivityDetail has missing data?

Ahlem Barika 0 Reputation points
2024-03-28T01:37:50.16+00:00

I am using the Microsoft Graph API's getTeamsTeamActivityDetail endpoint to track teams activities.

However, I am encountering an issue where the API consistently returns 1011 records active and inactive teams regardless of the period specified (D7, D30, D90, or D180), even though I am certain there are 1238 teams in our organization.
I have checked the API documentation and verified that all teams are active and should have activity that should be captured by the API. Is there a limitation or condition in the API that could be causing it to exclude the remaining 227 teams knowing that some of them are active, from the results?
If so, could you please provide guidance on how to adjust my query to retrieve data for all teams?n how to adjust my query to retrieve data for all teams?

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,658 questions
Microsoft Teams Development
Microsoft Teams Development
Microsoft Teams: A Microsoft customizable chat-based workspace.Development: The process of researching, productizing, and refining new or existing technologies.
3,443 questions
Microsoft Partner Center API
Microsoft Partner Center API
Microsoft Partner Center: A Microsoft website for partners that provides access to product support, a partner community, and other partner services.API: A software intermediary that allows two applications to interact with each other.
352 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Sayali-MSFT 3,226 Reputation points Microsoft Vendor
    2024-10-18T08:50:53.29+00:00

    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

    1. 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.
    2. Increase the Period: Try using a broader period (like D180) to see if that captures more teams.
    3. Use Correct Parameters: Ensure your query is correctly formatted with the required parameters. For example:
         
         GET
      
    4. 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 or Team.Read.All.
    5. Review API Limits: Consult the Microsoft Graph documentation for any limitations regarding the number of teams or records returned.
    6. 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}
    
    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.