管理员活动报告

使用集合让一切井井有条 根据您的偏好保存内容并对其进行分类。

“管理员活动”报告会返回您帐号中所有管理员的管理控制台活动的相关信息。每个报告都会使用基本报告端点请求以及特定的报告参数(例如管理员姓名或特定管理控制台事件)。每份报告的最长时间段为过去 180 天。

本文档假定您已成功完成前提设置步骤

管理员活动报告仅可用于遵守您的客户协议,且仅可用于合法目的。这些报告适用于 Google Workspace、教育版和 ISP 帐号。

检索所有管理活动

要检索针对某个帐号完成的所有管理活动的报告,请使用以下 GET HTTP 请求,并在其中添加授权文档中所述的授权令牌。如需详细了解请求的查询字符串和响应属性,请参阅 API 参考文档。为方便阅读,以下示例采用行返回的格式:

GET https://admin.googleapis.com/admin/reports/v1/activity/users/all
/applications/admin?endTime=a date&startTime=a date
&maxResults=number of events listed on each page of the report

以下示例将获取您帐号过去 180 天内所有管理活动的报告,即报告的最长期限。maxResults 查询字符串确定此报告的每个报告页面包含两个事件。有关 API 响应的示例,请参阅 JSON 响应示例

GET https://admin.googleapis.com/admin/reports/v1/activity/users/all
/applications/admin?maxResults=2

以下示例获取了过去 180 天客户所有管理活动的报告。customerId 用于指定要为哪个客户检索报告。

GET https://admin.googleapis.com/admin/reports/v1/activity/users/all
/applications/admin?customerId=C03az79cb

由管理员检索所有活动

要检索特定管理员完成的所有管理控制台活动的报告,请使用以下 GET HTTP 请求,并在其中添加授权文档中所述的授权令牌。userKey 是报告中管理员的主电子邮件地址。如需详细了解请求的查询字符串和响应属性,请参阅 API 参考文档。为方便阅读,以下示例采用行返回的格式:

GET https://admin.googleapis.com/admin/reports/v1/activity/users/userKey
/applications/admin?endTime=a date&startTime=a date
&maxResults=number of events listed on each page of the report
&filters=event name parameter relational operator parameter value

以下示例会针对 john@example.com 对管理控制台应用所做的所有更改生成报告,其响应会被过滤,以返回 OLD_VALUE 等于 ALLOW_CAMERA 的所有活动。如需查看 API 响应示例,请参阅 JSON 响应示例。如需了解这类活动,请参阅管理员活动名称

GET https://admin.googleapis.com/admin/reports/v1/activity/users/john@example.com
/applications/admin?maxResults=2&filters=OLD_VALUE==ALLOW_CAMERA

按事件名称检索所有活动

要检索特定事件名称的所有活动的报告,请使用以下 GET HTTP 请求,并包含授权文档中所述的授权令牌。有关 eventName 信息,请参阅管理员事件名称参考信息。如需详细了解请求的查询字符串和响应属性,请参阅 API 参考文档。为方便阅读,以下示例采用行返回的格式:

GET https://admin.googleapis.com/admin/reports/v1/activity/users/all
/applications/admin?endTime=a date&startTime=a date
&maxResults=maximum number of events returned on a response page
&eventName=name of the administrative event

以下示例检索所有管理控制台实例的更改用户姓氏的报告。有关 API 响应的示例,请参阅 JSON 响应示例

GET https://admin.googleapis.com/admin/reports/v1/activity/users/all
/applications/admin?maxResults=1&eventName=CHANGE_LAST_NAME

按事件和管理员检索所有活动

要检索特定管理员对特定事件名称的所有管理控制台更改报告,请使用以下 GET HTTP 请求,并在其中添加授权文档中所述的授权令牌。userKey 是报告中管理员的主电子邮件地址。有关 eventName 信息,请参阅管理员事件名称参考信息。如需详细了解请求的查询字符串和响应属性,请参阅 API 参考文档。为方便阅读,以下示例采用行返回的格式:

GET https://admin.googleapis.com/admin/reports/v1/activity/users/userKey
/applications/admin?endTime=a date&startTime=a date
&maxResults=maximum number of events returned on a response page
&eventName=name of the administrative event

以下示例检索了管理控制台为 john@example.com 完成的对特定用户姓氏的所有更改。有关 API 响应的示例,请参阅 JSON 响应示例

GET https://admin.googleapis.com/admin/reports/v1/activity/users/john@example.com
/applications/admin?maxResults=1&eventName=CHANGE_LAST_NAME

管理员活动报告 JSON 响应示例

成功的响应将返回一个 HTTP 200 状态代码。响应将返回状态代码以及报告。有关 eventName 信息,请参阅管理员事件名称参考信息。如需详细了解请求的网址查询字符串和响应属性,请参阅 API 参考文档

{
 "kind": "reports#auditActivities",
 "nextPageToken": "the next page's token",
 "items": [
  {
   "kind": "audit#activity",
   "id": {
    "time": "2011-06-17T15:39:18.460Z",
    "uniqueQualifier": "report's unique ID",
    "applicationName": "admin",
    "customerId": "C03az79cb"
   },
   "actor": {
    "callerType": "USER",
    "email": "liz@example.com",
    "profileId": "user's unique Google Workspace profile ID",
    "key": "consumer key of requestor in OAuth 2LO requests"
   },
   "ownerDomain": "example.com",
   "ipAddress": "user's IP address",
   "events": [
    {
     "type": "GROUP_SETTINGS",
     "name": "CHANGE_GROUP_SETTING",
     "parameters": [
      {
        "name": "SETTING_NAME",
        "value": "WHO_CAN_JOIN",
        "intValue": "integer value of parameter",
        "boolValue": "boolean value of parameter"
      }
     ]
    }
   ]
  },
  {
   "kind": "audit#activity",
   "id": {
    "time": "2011-06-17T15:39:18.460Z",
    "uniqueQualifier": "reports unique ID",
    "applicationName": "admin",
    "customerId": "C03az79cb"
   },
   "actor": {
    "callerType": "USER",
    "email": "liz@example.com",
    "profileId": "user's unique Google Workspace profile ID",
    "key": "consumer key of requestor in an OAuth 2LO request"
   },
   "ownerDomain": "example.com",
   "ipAddress": "user's IP address",
   "events": [
    {
     "type": "GROUP_SETTINGS",
     "name": "CREATE_GROUP",
     "parameters": [
      {
        "name": "GROUP_EMAIL",
        "value": "helpdesk@example.com",
        "intValue": "",
        "boolValue": ""
       }
      ]
     }
    ]
   }
  ]
 }