Method: accounts.reports.search
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
检索由搜索查询定义的报告。响应中包含的行数可能少于 pageSize
指定的行数。依赖 nextPageToken
来确定是否有更多行要请求。
HTTP 请求
POST https://merchantapi.googleapis.com/reports/v1beta/{parent=accounts/*}/reports:search
网址采用 gRPC 转码语法。
路径参数
参数 |
parent |
string
必需。发出调用的账号的 ID。必须是独立账号或 MCA 子账号。格式:accounts/{account}
|
请求正文
请求正文中包含结构如下的数据:
JSON 表示法 |
{
"query": string,
"pageSize": integer,
"pageToken": string
} |
字段 |
query |
string
必需。用于定义要检索的报告的查询。 如需详细了解如何构建查询,请参阅“查询语言”指南。如需查看可用表格和字段的完整列表,请参阅“可用字段”。
|
pageSize |
integer
可选。要在单个页面中检索的 ReportRows 的数量。默认值为 1000。大于 5000 的值会强制转换为 5000。
|
pageToken |
string
可选。要检索的页面的令牌。如果未指定,则返回第一页的结果。如需请求下一页结果,应使用上一个响应中从 nextPageToken 获取的值。
|
响应正文
ReportService.Search
方法的响应消息。
如果成功,响应正文将包含结构如下的数据:
JSON 表示法 |
{
"results": [
{
object (ReportRow )
}
],
"nextPageToken": string
} |
字段 |
results[] |
object (ReportRow )
与搜索查询匹配的行。
|
nextPageToken |
string
可作为 pageToken 发送并用于检索下一页的令牌。如果省略,则不存在后续页面。
|
授权范围
需要以下 OAuth 范围:
https://www.googleapis.com/auth/content
如需了解详情,请参阅 OAuth 2.0 Overview。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-01-23。
[null,null,["最后更新时间 (UTC):2025-01-23。"],[[["\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)."]]