Method: accounts.reports.search
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.
Truy xuất báo cáo được xác định bằng một cụm từ tìm kiếm. Phản hồi có thể chứa ít hàng hơn so với số lượng hàng do pageSize
chỉ định. Hãy dựa vào nextPageToken
để xác định xem có thêm hàng nào cần yêu cầu hay không.
Yêu cầu HTTP
POST https://merchantapi.googleapis.com/reports/v1beta/{parent=accounts/*}/reports:search
URL sử dụng cú pháp Chuyển mã gRPC.
Tham số đường dẫn
Thông số |
parent |
string
Bắt buộc. Mã của tài khoản thực hiện lệnh gọi. Phải là tài khoản độc lập hoặc tài khoản phụ trong MCA. Định dạng: accounts/{account}
|
Nội dung yêu cầu
Nội dung yêu cầu chứa dữ liệu có cấu trúc sau:
Biểu diễn dưới dạng JSON |
{
"query": string,
"pageSize": integer,
"pageToken": string
} |
Trường |
query |
string
Bắt buộc. Truy vấn xác định báo cáo cần truy xuất. Để biết thông tin chi tiết về cách tạo truy vấn, hãy xem hướng dẫn về Ngôn ngữ truy vấn. Để xem danh sách đầy đủ các bảng và trường có sẵn, hãy xem phần Trường có sẵn.
|
pageSize |
integer
Không bắt buộc. Số ReportRows cần truy xuất trong một trang. Giá trị mặc định là 1000. Các giá trị trên 5000 sẽ được ép thành 5000.
|
pageToken |
string
Không bắt buộc. Mã thông báo của trang cần truy xuất. Nếu không được chỉ định, hệ thống sẽ trả về trang kết quả đầu tiên. Để yêu cầu trang kết quả tiếp theo, bạn nên sử dụng giá trị thu được từ nextPageToken trong phản hồi trước đó.
|
Nội dung phản hồi
Thông báo phản hồi cho phương thức ReportService.Search
.
Nếu thành công, phần nội dung phản hồi sẽ chứa dữ liệu có cấu trúc sau:
Biểu diễn dưới dạng JSON |
{
"results": [
{
object (ReportRow )
}
],
"nextPageToken": string
} |
Trường |
results[] |
object (ReportRow )
Các hàng khớp với cụm từ tìm kiếm.
|
nextPageToken |
string
Mã thông báo có thể được gửi dưới dạng pageToken để truy xuất trang tiếp theo. Nếu bạn bỏ qua, sẽ không có trang tiếp theo.
|
Phạm vi uỷ quyền
Yêu cầu phạm vi OAuth sau:
https://www.googleapis.com/auth/content
Để biết thêm thông tin, hãy xem OAuth 2.0 Overview.
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2025-01-23 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2025-01-23 UTC."],[[["\u003cp\u003eRetrieves a report based on a search query, returning results potentially across multiple pages using pagination.\u003c/p\u003e\n"],["\u003cp\u003eRequires a search query in the request body and allows specifying the desired page size and page token.\u003c/p\u003e\n"],["\u003cp\u003eThe response includes matching report rows and a token for retrieving the next page if available.\u003c/p\u003e\n"],["\u003cp\u003eThe API utilizes gRPC Transcoding syntax and needs authorization with the \u003ccode\u003ehttps://www.googleapis.com/auth/content\u003c/code\u003e scope.\u003c/p\u003e\n"],["\u003cp\u003eReport data is structured using \u003ccode\u003eReportRow\u003c/code\u003e objects within the response body.\u003c/p\u003e\n"]]],[],null,["# Method: accounts.reports.search\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Request body](#body.request_body)\n - [JSON representation](#body.request_body.SCHEMA_REPRESENTATION)\n- [Response body](#body.response_body)\n - [JSON representation](#body.SearchResponse.SCHEMA_REPRESENTATION)\n- [Authorization scopes](#body.aspect)\n- [Try it!](#try-it)\n\nRetrieves a report defined by a search query. The response might contain fewer rows than specified by `pageSize`. Rely on `nextPageToken` to determine if there are more rows to be requested.\n\n### HTTP request\n\n`POST https://merchantapi.googleapis.com/reports/v1beta/{parent=accounts/*}/reports:search`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n| Parameters ||\n|----------|-------------------------------------------------------------------------------------------------------------------------------------|\n| `parent` | `string` Required. Id of the account making the call. Must be a standalone account or an MCA subaccount. Format: accounts/{account} |\n\n### Request body\n\nThe request body contains data with the following structure:\n\n| JSON representation |\n|-----------------------------------------------------------------------|\n| ``` { \"query\": string, \"pageSize\": integer, \"pageToken\": string } ``` |\n\n| Fields ||\n|-------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `query` | `string` Required. Query that defines a report to be retrieved. For details on how to construct your query, see the [Query Language guide](/merchant/api/guides/reports/query-language). For the full list of available tables and fields, see the [Available fields](/merchant/api/reference/rest/reports_{apiVersion}/accounts.reports). |\n| `pageSize` | `integer` Optional. Number of `ReportRows` to retrieve in a single page. Defaults to 1000. Values above 5000 are coerced to 5000. |\n| `pageToken` | `string` Optional. Token of the page to retrieve. If not specified, the first page of results is returned. In order to request the next page of results, the value obtained from `nextPageToken` in the previous response should be used. |\n\n### Response body\n\nResponse message for the `ReportService.Search` method.\n\nIf successful, the response body contains data with the following structure:\n\n| JSON representation |\n|-----------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"results\": [ { object (/merchant/api/reference/rest/reports_v1beta/accounts.reports#ReportRow) } ], \"nextPageToken\": string } ``` |\n\n| Fields ||\n|-----------------|--------------------------------------------------------------------------------------------------------------------------------------|\n| `results[]` | `object (`[ReportRow](/merchant/api/reference/rest/reports_v1beta/accounts.reports#ReportRow)`)` Rows that matched the search query. |\n| `nextPageToken` | `string` Token which can be sent as `pageToken` to retrieve the next page. If omitted, there are no subsequent pages. |\n\n### Authorization scopes\n\nRequires the following OAuth scope:\n\n- `https://www.googleapis.com/auth/content`\n\nFor more information, see the [OAuth 2.0 Overview](/identity/protocols/OAuth2)."]]