Reports API:授權權杖活動報表
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
授權權杖活動報表會傳回使用者授予存取權的第三方網站和應用程式相關資訊。每份報表都會使用基本報表端點要求,以及報表專屬參數,例如第三方網域或授予的授權範圍。每份報表的時間範圍最多可設為過去 180 天。
您只能根據《客戶協議》,將 OAuth 權杖活動報表用於合法用途。
擷取網域的所有授權權杖事件
如要擷取第三方應用程式的所有授權事件,請使用下列 GET
HTTP 要求,並附上「授權文件」中所述的授權權杖。如要進一步瞭解要求查詢字串和回應屬性,請參閱 API 參考資料。為了方便閱讀,以下範例會換行顯示:
GET https://admin.googleapis.com/admin/reports/v1/activity/users/all
/applications/token?endTime=end date&startTime=start date
&maxResults=maximum number of events returned on a response page
以下範例會取得過去 180 天內,帳戶中所有授權事件的報表。maxResults
查詢參數會讓這份報表每頁傳回 25 個結果。
GET https://admin.googleapis.com/admin/reports/v1/activity/users/all/applications/token?maxResults=25
依事件名稱擷取授權權杖事件
在某些情況下,您可能想擷取特定事件,例如應用程式的存取權是否已遭撤銷。如要執行這項操作,請使用下列形式的 GET
HTTP 要求:
GET https://admin.googleapis.com/admin/reports/v1/activity/users/all
/applications/token?maxResults=maximum number of events returned on a response page
&eventName=name of the OAuth token event
以下範例說明如何擷取網域的所有 revoke
事件:
GET https://admin.googleapis.com/admin/reports/v1/activity/users/all/applications/token?eventName=revoke&maxResults=25
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-08-29 (世界標準時間)。
[null,null,["上次更新時間:2025-08-29 (世界標準時間)。"],[],[],null,["# Reports API: Authorization Tokens Activity Report\n\nThe authorization token activity report returns information about third party\nwebsites and applications your users have granted access for. Each report\nuses the basic report endpoint request with report-specific parameters such\nas the third party domain or authorization scopes granted. The maximum time\nperiod for each report is the last 180 days.\n\nThe OAuth token activity report may be used only for lawful purposes in accordance with your Customer Agreement.\n\nRetrieve all authorization token events for a domain\n----------------------------------------------------\n\nTo retrieve all authorization events for third party applications, use the\nfollowing `GET` HTTP request and include the authorization token described in the\n[authorization documentation](https://developers.google.com/workspace/admin/reports/v1/guides/authorizing.html).\nFor more information about the request query strings and response properties,\nsee the [API Reference](/workspace/admin/reports/v1/reference/activity-ref-appendix-a/token-event-names).\nFor readability purposes, the following example is formatted with line returns: \n\n```\nGET https://admin.googleapis.com/admin/reports/v1/activity/users/all\n/applications/token?endTime=end date&startTime=start date\n&maxResults=maximum number of events returned on a response page\n```\n\nThe following example gets a report on all of your account's authorization events\nfor the past 180 days. The `maxResults` query parameter has this report return\n25 results per page. \n\n```\nGET https://admin.googleapis.com/admin/reports/v1/activity/users/all/applications/token?maxResults=25\n```\n\nRetrieve authorization token events by event name\n-------------------------------------------------\n\nIn some instances, you may want to retrieve specific events, such as whether an\napplication's access has been revoked. To do this, use a `GET` HTTP request\nof the following form: \n\n```\nGET https://admin.googleapis.com/admin/reports/v1/activity/users/all\n/applications/token?maxResults=maximum number of events returned on a response page\n&eventName=name of the OAuth token event\n```\n\nThe following example shows how to retrieve all `revoke` events for a domain: \n\n```\nGET https://admin.googleapis.com/admin/reports/v1/activity/users/all/applications/token?eventName=revoke&maxResults=25\n```"]]