Graph API for last activity date in all the teams

Robin Couvreur 26 Reputation points
2022-04-07T07:15:48.067+00:00

Hello everyone, I am looking for a way to get all the teams with details (including last activity date). I Finally found it on this forum and the call is: https://graph.microsoft.com/beta/reports/getTeamsTeamActivityDetail(period='D90')?$format=application/json.
However, I wanted to use it in a Powerapps as a custom connector. But on the declaration of this call, I got an error saying I do not have the permissions to use this call. But this is working in Graph Explorer, as I got the required permissions.

Do anyone know how to fix that?

Robin

Microsoft Teams
Microsoft Teams
A Microsoft customizable chat-based workspace.
9,410 questions
Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,126 questions
{count} votes

Accepted answer
  1. CarlZhao-MSFT 39,101 Reputation points
    2022-04-07T10:19:00.267+00:00

    Hi @Robin Couvreur

    Calling this api requires the Reports.Read.All permission, if you want to get a user token then need to grant the Reports.Read.All delegated permission to your application.

    190933-2022-04-07-181244.png

    Parse the token, you can see it in the scp claim:

    190925-image.png


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


2 additional answers

Sort by: Most helpful
  1. Robin Couvreur 26 Reputation points
    2022-04-07T11:05:38.837+00:00

    Hello Carl, I already gt those permissions and it works in Graph Explorer. The issue appears when I use this request in my custom connector of Powerapps...


  2. Robin Couvreur 26 Reputation points
    2022-04-11T14:29:00.073+00:00

    Hello Carl, sorry but I did not work on it since last time. I got the same error even if I added the required permissions in the op on the AAD.
    The website does not save my screenshot but I can tell you that on the security part of the custom connector, I selected OAuth 2.0 as Authentication type, I introduced my client ID and secret value, and in scope, I wrote Report.Read.All.

    I got the same error (403) and saying I do not have the valid permissions...

    Thank you for all your replies.