Reports API:客户使用情况报告
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
客户使用情况报告
汇总整个网域中所有用户的 Google Workspace 服务使用情况信息。
用户使用情况报告会返回您账号中的 Google Workspace 服务使用情况信息。
这些使用情况信息按应用程序类型进行整理,应用程序类型由应用程序特有的参数组成。
每份报告的默认时间段和最长时间段都是过去 450 天。
这些使用情况报告只能按照《客户协议》用于合法目的。此外,这些
报告适用于 Google Workspace 和 Google Workspace 教育版。
检索客户使用情况报告
要检索账号活动报告,请使用以下 GET
HTTP 请求并在其中包含授权令牌
授权文档中所述。为了方便阅读
以下示例采用回车行格式:
GET https://admin.googleapis.com/admin/reports/v1/usage/dates/yyyy-mm-dd date
?parameters=app name: usage parameter,...
&customerId=the customer's ID
&maxResults=number of events listed on each page of the report
dates
值是使用情况的发生日期,时间戳采用 ISO 8601 格式,即 yyyy-mm-dd。在选择时区时,我们建议您使用自己账号的时区。有关请求查询字符串和响应属性的详情,请参阅 API 参考和客户使用情况报告参数参考。
以下示例将获取一个报告,其中包含过去 30 天内所有成功登录您的账号的总次数和一个列表。
授权应用数量,以及每个应用的用户授权数量,从 2013 年 3 月 3 日开始。maxResults
查询字符串,显示此报告在每个报告页面上返回两个事件:
GET https://admin.googleapis.com/admin/reports/v1/usage/dates/2013-03-03
?parameters=accounts:num_30day_logins%2Caccounts:authorized_apps&maxResults=2
客户使用情况报告的 JSON 响应
{
"kind": "reports#usageReports",
"warnings": [
{
"code": warning machine-readable code,
"message": warning human-readable message,
"data": [
{
"key": key for key-value pair that gives detailed warning information,
"value": value for key-value pair giving detailed warning information
}
]
}
],
"nextPageToken": "N:NNN:NNN:N:C03az79cb",
"usageReports": [
{
"kind": "usageReport",
"date": "2013-03-03",
"entity": {
"type": "CUSTOMER",
"customerId": "C03az79cb"
},
"parameters": [
{
"name": "accounts:num_1day_logins",
"intValue": "1"
},
{
"name": "accounts:num_30day_logins",
"intValue": "1"
},
{
"name": "accounts:num_7day_logins",
"intValue": "1"
},
{
"name": "accounts:num_disabled_accounts",
"intValue": "5"
},
{
"name": "accounts:authorized_apps",
"msgValue": [
{
"client_id": "1234.apps.googleusercontent.com",
"client_name": "www.example.com",
"num_users": 2
},
{
"client_id": "4567.apps.googleusercontent.com",
"client_name": "Example",
"num_users": 1
},
...
]
}
]
}
]
}
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-08-29。
[null,null,["最后更新时间 (UTC):2025-08-29。"],[],[],null,["# Reports API: Customers Usage Report\n\nThe Customers usage report\naggregates Google Workspace service usage information, for all users, across an entire domain.\nThe user usage report returns Google Workspace service usage information across your account.\nThis usage information is organized by application type which is composed of parameters specific to that application.\nThe default and maximum time period for each report is the last 450 days.\n\nThese usage report may be used only for lawful purposes in accordance with your Customer Agreement. Also, these\nreports apply to Google Workspace and Education.\n\nRetrieve a customer usage report\n--------------------------------\n\nTo retrieve report of your account activities use the following `GET` HTTP request and include the authorization token\ndescribed in the [authorization documentation](/workspace/admin/reports/v1/guides/authorizing). For readability,\nthe following example is formatted with line returns: \n\n```\nGET https://admin.googleapis.com/admin/reports/v1/usage/dates/yyyy-mm-dd date\n?parameters=app name: usage parameter,...\n&customerId=the customer's ID\n&maxResults=number of events listed on each page of the report\n```\n\nThe `dates` value is the date the usage occurred and the timestamp is in the [ISO 8601 format](http://en.wikipedia.org/wiki/ISO_8601), yyyy-mm-dd. We recommend you use your account's time zone for this. For more information about the request's query strings and response properties, see the [API Reference](/workspace/admin/reports/v1/reference/customerUsageReports/get) and the [customer usage report parameters reference](/workspace/admin/reports/v1/reference/usage-ref-appendix-a/customers).\n\nThe following example gets a report with the total of all successful logins to your account in the past 30 days and a list\nof authorized applications, with the number of user authorizations per application, starting 2013-03-03. The `maxResults`\nquery string shows this report returns two events per report page: \n\n```\nGET https://admin.googleapis.com/admin/reports/v1/usage/dates/2013-03-03\n?parameters=accounts:num_30day_logins%2Caccounts:authorized_apps&maxResults=2\n```\n\n#### JSON response for customer usage report\n\n```carbon\n{\n \"kind\": \"reports#usageReports\",\n \"warnings\": [\n {\n \"code\": warning machine-readable code,\n \"message\": warning human-readable message,\n \"data\": [\n {\n \"key\": key for key-value pair that gives detailed warning information,\n \"value\": value for key-value pair giving detailed warning information\n }\n ]\n }\n ],\n \"nextPageToken\": \"N:NNN:NNN:N:C03az79cb\",\n \"usageReports\": [\n {\n \"kind\": \"usageReport\",\n \"date\": \"2013-03-03\",\n \"entity\": {\n \"type\": \"CUSTOMER\",\n \"customerId\": \"C03az79cb\"\n },\n \"parameters\": [\n {\n \"name\": \"accounts:num_1day_logins\",\n \"intValue\": \"1\"\n },\n {\n \"name\": \"accounts:num_30day_logins\",\n \"intValue\": \"1\"\n },\n {\n \"name\": \"accounts:num_7day_logins\",\n \"intValue\": \"1\"\n },\n {\n \"name\": \"accounts:num_disabled_accounts\",\n \"intValue\": \"5\"\n },\n {\n \"name\": \"accounts:authorized_apps\",\n \"msgValue\": [\n {\n \"client_id\": \"1234.apps.googleusercontent.com\",\n \"client_name\": \"www.example.com\",\n \"num_users\": 2\n },\n {\n \"client_id\": \"4567.apps.googleusercontent.com\",\n \"client_name\": \"Example\",\n \"num_users\": 1\n },\n ...\n ]\n }\n ]\n }\n ]\n}\n```"]]