API Báo cáo: Báo cáo Hoạt động của mã thông báo uỷ quyền
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Báo cáo hoạt động của mã thông báo uỷ quyền trả về thông tin về các trang web và ứng dụng bên thứ ba mà người dùng đã cấp quyền truy cập. Mỗi báo cáo sử dụng yêu cầu cơ bản về điểm cuối báo cáo với các tham số dành riêng cho báo cáo, chẳng hạn như miền của bên thứ ba hoặc phạm vi uỷ quyền được cấp. Khoảng thời gian tối đa cho mỗi báo cáo là 180 ngày gần nhất.
Bạn chỉ được sử dụng báo cáo hoạt động của mã thông báo OAuth cho các mục đích hợp pháp theo Thoả thuận với khách hàng.
Truy xuất tất cả các sự kiện mã thông báo uỷ quyền cho một miền
Để truy xuất tất cả các sự kiện uỷ quyền cho ứng dụng bên thứ ba, hãy sử dụng yêu cầu HTTP GET sau đây và thêm mã uỷ quyền được mô tả trong tài liệu uỷ quyền.
Để biết thêm thông tin về các chuỗi truy vấn yêu cầu và thuộc tính phản hồi, hãy xem Tài liệu tham khảo về API.
Để dễ đọc, ví dụ sau được định dạng bằng dấu xuống dòng:
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
Ví dụ sau đây sẽ lấy báo cáo về tất cả các sự kiện uỷ quyền của tài khoản trong 180 ngày qua. Tham số truy vấn maxResults sẽ khiến báo cáo này trả về 25 kết quả trên mỗi trang.
GET https://admin.googleapis.com/admin/reports/v1/activity/users/all/applications/token?maxResults=25
Truy xuất các sự kiện mã thông báo uỷ quyền theo tên sự kiện
Trong một số trường hợp, bạn có thể muốn truy xuất các sự kiện cụ thể, chẳng hạn như việc quyền truy cập của một ứng dụng đã bị thu hồi hay chưa. Để thực hiện việc này, hãy sử dụng yêu cầu HTTP GET theo biểu mẫu sau:
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
Ví dụ sau đây cho thấy cách truy xuất tất cả các sự kiện revoke cho một miền:
GET https://admin.googleapis.com/admin/reports/v1/activity/users/all/applications/token?eventName=revoke&maxResults=25
[[["Dễ hiểu","easyToUnderstand","thumb-up"],["Giúp tôi giải quyết được vấn đề","solvedMyProblem","thumb-up"],["Khác","otherUp","thumb-up"]],[["Thiếu thông tin tôi cần","missingTheInformationINeed","thumb-down"],["Quá phức tạp/quá nhiều bước","tooComplicatedTooManySteps","thumb-down"],["Đã lỗi thời","outOfDate","thumb-down"],["Vấn đề về bản dịch","translationIssue","thumb-down"],["Vấn đề về mẫu/mã","samplesCodeIssue","thumb-down"],["Khác","otherDown","thumb-down"]],["Cập nhật lần gần đây nhất: 2025-08-29 UTC."],[],[],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```"]]