ユーザー使用状況レポートでは、ドメイン内の特定のユーザーの Google Workspace サービス使用状況に関する情報が返されます。このレポートは、特定の使用状況情報向けにカスタマイズしたりフィルタしたりできます。 各レポートのデフォルト期間と最大期間は過去 450 日間です。
これらのユーザー使用状況レポートは、お客様の契約に従って法的な目的にのみ使用することができます。このレポートは、Google Workspace と Education にも適用されます。
すべてのユーザーの使用状況を取得する
アカウントのすべてのユーザー アクティビティに関するレポートを取得するには、次の GET
HTTP リクエストを使用し、その際には認可に関するドキュメントに記載されている認証トークンを含めます。読みやすくするために、次の例では改行を返します。
GET https://admin.googleapis.com/admin/reports/v1/usage/users/all/dates/yyyy-mm-dd date ?parameters=application: user usage parameter,... &filters=application: user usage parameter relational operator usage parameter's value,... &maxResults=number of events listed on each page of the report
dates
値は使用量が発生した日付で、タイムスタンプは ISO 8601 形式(yyyy-mm-dd)です。クエリ文字列パラメータとレスポンス プロパティの詳細については、API リファレンスをご覧ください。ユーザー使用状況レポートのパラメータについては、ユーザー使用状況パラメータのリファレンスをご覧ください。
次の例では、アカウントのすべてのユーザー アクティビティに関するレポートを取得します。
GET https://admin.googleapis.com/admin/reports/v1/usage/users/all /dates/2013-03-03?maxResults=2
次の例では、特定の顧客アカウントのすべてのユーザー アクティビティをレポートしています。
GET https://admin.googleapis.com/admin/reports/v1/usage/users/all /dates/2013-03-03?customerId=C03az79cb
以下の例は、アカウントに含まれるユーザーの前回のログイン タイムスタンプに関するレポートを取得します。API レスポンスの例については、JSON レスポンスの例をご覧ください。
GET https://admin.googleapis.com/admin/reports/v1/usage/users/all/dates/2013-03-03 ?parameters=accounts:last_login_time&maxResults=2
次の例は、アカウントを持つユーザーの前回のログイン タイムスタンプに関するレポートを取得します。このレポートは、特定の時間の後にログインしたユーザーによってフィルタリングされます。API レスポンスの例については、JSON レスポンスの例をご覧ください。
GET https://admin.googleapis.com/admin/reports/v1/usage/users/all/dates/2013-03-03 ?parameters=accounts:last_login_time&filters=accounts:last_login_time >2010-10-28T10:26:35.000Z"
次の例では、前回のログイン タイムスタンプと、アカウントのユーザーの停止ステータスに関するレポートを取得します。API レスポンスの例については、JSON レスポンスの例をご覧ください。
GET https://admin.googleapis.com/admin/reports/v1/usage/users/all/dates/2013-03-03 ?parameters=accounts:last_login_time,accounts:is_disabled"
特定のユーザーの使用状況アクティビティを取得する
特定のユーザーのアカウントのアクティビティに関するレポートを取得するには、次の GET
HTTP リクエストを使用し、その際には認可に関するドキュメントに記載されている認証トークンを含めます。次の例では、読みやすくするために改行を使用しています。
GET https://admin.googleapis.com/admin/reports/v1/usage/users/userKey/dates/yyyy-mm-dd date ?parameters=application: user usage parameter,... &filters=application: user usage parameter relational operator usage parameter's value,... &maxResults=number of events listed on each page of the report
userKey
には、レポート内のユーザーのメインのメールアドレスか、ユーザー固有の Google Workspace profileId
のいずれかを指定します。dates
値は使用量が発生した日付で、タイムスタンプは ISO 8601 形式(yyyy-mm-dd)です。クエリ文字列パラメータとレスポンス プロパティの詳細については、API リファレンスをご覧ください。ユーザー使用状況レポートのパラメータについては、ユーザー使用状況パラメータのリファレンスをご覧ください。
次の例では、john@example.com の使用状況レポートを取得します。
https://admin.googleapis.com/admin/reports/v1/usage/users/john@example.com/dates/2013-03-03
使用状況レポートの JSON レスポンスの例
成功すると、レスポンスとして HTTP 200 のステータス コードが返されます。レスポンスでは、ステータス コードとともにレポートが返されます。
ユーザー レポートの 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": "USER", "customerId": "C03az79cb", "userEmail": "liz@example.com", "profileId": "user's unique Google Workspace ID" }, "parameters": [ { "name": "accounts:is_disabled", "boolValue": false }, { "name": "accounts:disabled_reason", "stringValue": "reason description" }, { "name": "accounts:first_name", "stringValue": "Liz" }, { "name": "accounts:is_2sv_enforced", "boolValue": false }, { "name": "accounts:is_2sv_enrolled", "boolValue": false }, { "name": "accounts:last_name", "stringValue": "Smith" }, { "name": "accounts:creation_time", "datetimeValue": "2010-10-28T10:26:35.000Z" }, { "name": "accounts:last_login_time", "datetimeValue": "1970-01-01T00:00:00.000Z" }, { "name": "accounts:last_sso_time", "datetimeValue": "1970-01-01T00:00:00.000Z" } ] } ] }