0

I am trying to test https://admin.googleapis.com/admin/reports/v1/activity/users/{userKey or all}/applications/{applicationName} in the browser using the API explorer utility but I am getting below error.

{
  "error": {
    "code": 401,
    "message": "Access denied. You are not authorized to read activity records.",
    "errors": [
      {
        "message": "Access denied. You are not authorized to read activity records.",
        "domain": "global",
        "reason": "authError",
        "location": "Authorization",
        "locationType": "header"
      }
    ]
  }
}

I have enabled all the necessary API scopes for the OAuth client. below is the screenshot of the scopes that I have enabled for my client.

enter image description here

Mohit Tater
  • 453
  • 1
  • 6
  • 10
  • Are you authenticating as the domain admin with the necessary privelleges when performing this request? – ziganotschka Feb 11 '21 at 09:48
  • @ziganotschka You were right. I was trying with a user who didn't have permissions to access these APIs. I changed the subject user and it started working fine for me. – Mohit Tater Feb 11 '21 at 14:57

1 Answers1

0

The user which I was using along with the service account didn't have proper permission to access some of these APIs. I switched to a subject user with all necessary permissions and it started working fine for me.

Mohit Tater
  • 453
  • 1
  • 6
  • 10