管理员活动报告

管理员活动报告会返回您账号的所有管理员在管理控制台中的活动信息。每份报告都使用基本报告端点请求以及特定于报告的参数,例如管理员的姓名或特定的管理控制台事件。每份报告的最长时段为过去 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 requester 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 requester 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": ""
       }
      ]
     }
    ]
   }
  ]
 }