Method: categories.list
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-25。
[null,null,["最后更新时间 (UTC):2025-07-25。"],[[["\u003cp\u003eRetrieves a list of business categories, matching the front of the category name based on region and language.\u003c/p\u003e\n"],["\u003cp\u003eAllows filtering by display name, pagination with adjustable page size, and specifying the level of detail returned.\u003c/p\u003e\n"],["\u003cp\u003eRequest body should be empty and successful responses include an array of categories and a token for retrieving further pages.\u003c/p\u003e\n"],["\u003cp\u003eRequires the \u003ccode\u003ehttps://www.googleapis.com/auth/business.manage\u003c/code\u003e OAuth scope for authorization.\u003c/p\u003e\n"]]],["This outlines how to retrieve a list of business categories using a `GET` request to `https://mybusinessbusinessinformation.googleapis.com/v1/categories`. Required query parameters include `regionCode`, `languageCode`, and `view`. Optional parameters are `filter`, `pageSize`, and `pageToken`. The request body must be empty. A successful response includes an array of `categories` and, potentially, a `nextPageToken` for subsequent pagination. Authorization requires the `https://www.googleapis.com/auth/business.manage` scope.\n"],null,["# Method: categories.list\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Query parameters](#body.QUERY_PARAMETERS)\n- [Request body](#body.request_body)\n- [Response body](#body.response_body)\n - [JSON representation](#body.ListCategoriesResponse.SCHEMA_REPRESENTATION)\n- [Authorization scopes](#body.aspect)\n\nReturns a list of business categories. Search will match the category name but not the category ID.\n\nSearch only matches the front of a category name (that is, 'food' may return 'Food Court' but not 'Fast Food Restaurant').\n\n### HTTP request\n\n`GET https://mybusinessbusinessinformation.googleapis.com/v1/categories`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Query parameters\n\n| Parameters ||\n|----------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `regionCode` | `string` Required. The ISO 3166-1 alpha-2 country code. |\n| `languageCode` | `string` Required. The BCP 47 code of language. |\n| `filter` | `string` Optional. Filter string from user. The only field that supported is `displayName`. Eg: `filter=displayName=foo`. |\n| `pageSize` | `integer` Optional. How many categories to fetch per page. Default is 100, minimum is 1, and maximum page size is 100. |\n| `pageToken` | `string` Optional. If specified, the next page of categories will be fetched. |\n| `view` | `enum (`[CategoryView](/my-business/reference/businessinformation/rest/v1/CategoryView)`)` Required. Specifies which parts to the Category resource should be returned in the response. |\n\n### Request body\n\nThe request body must be empty.\n\n### Response body\n\nResponse message for BusinessCategories.ListCategories.\n\nIf successful, the response body contains data with the following structure:\n\n| JSON representation |\n|-------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"categories\": [ { object (/my-business/reference/businessinformation/rest/v1/accounts.locations#Location.Category) } ], \"nextPageToken\": string } ``` |\n\n| Fields ||\n|-----------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `categories[]` | `object (`[Category](/my-business/reference/businessinformation/rest/v1/accounts.locations#Location.Category)`)` The matching categories based on the requested parameters. |\n| `nextPageToken` | `string` If the number of categories exceeded the requested page size, this field will be populated with a token to fetch the next page of categories on a subsequent call to `categories.list`. |\n\n### Authorization scopes\n\nRequires the following OAuth scope:\n\n- `https://www.googleapis.com/auth/business.manage`\n\nFor more information, see the [OAuth 2.0 Overview](https://developers.google.com/identity/protocols/OAuth2)."]]