客戶使用情形報表 匯總整個網域內所有使用者的 Google Workspace 服務使用情形資訊。 使用者使用情形報告會傳回帳戶的 Google Workspace 服務使用情形資訊。 此用量資訊是依應用程式類型分類,而該類型是由該應用程式專屬的參數所組成。 每份報表的預設時間範圍和最長的時間範圍皆為過去 450 天。
這些使用情況報表只能用於符合《客戶協議》的合法目的。此外,這些 適用於 Google Workspace 和 Education 版。
擷取客戶使用情況報表
如要擷取帳戶活動報表,請使用以下 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
},
...
]
}
]
}
]
}