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
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-08-29。
[null,null,["最后更新时间 (UTC):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```"]]