La API de
Google Business Performance tiene un método de API
NUEVO que permite recuperar varias métricas "DailyMetrics" en una sola solicitud a la API.
Revise el
programa de baja y las instrucciones para migrar del método de la API de reportInsights versión 4 a la API de rendimiento del Perfil de Negocio de Google.
Method: accounts.list
Organiza tus páginas con colecciones
Guarda y categoriza el contenido según tus preferencias.
Enumera todas las cuentas del usuario autenticado. Esto incluye todas las cuentas que posee el usuario, así como cualquier cuenta en la que el usuario tenga derechos de administración.
Solicitud HTTP
GET https://mybusinessaccountmanagement.googleapis.com/v1/accounts
La URL usa la sintaxis de la transcodificación gRPC.
Parámetros de consulta
Parámetros |
parentAccount |
string
Opcional. El nombre del recurso de la cuenta para la que se debe recuperar la lista de cuentas a las que se puede acceder directamente. Esto solo es útil para las organizaciones y los grupos de usuarios. Si está vacío, se mostrará accounts.list para el usuario autenticado. accounts/{account_id} .
|
pageSize |
integer
Opcional. Cantidad de cuentas para recuperar por página El valor predeterminado y máximo es 20.
|
pageToken |
string
Opcional. Si se especifica, se recupera la página siguiente de cuentas. Se muestra pageToken cuando una llamada a accounts.list muestra más resultados de los que pueden caber en el tamaño de página solicitado.
|
filter |
string
Opcional. Un filtro que restringe la devolución de las cuentas. La respuesta solo incluye entradas que coinciden con el filtro. Si filter está vacío, no se aplican restricciones y se recuperan todas las cuentas (paginadas) de la cuenta solicitada. Por ejemplo, una solicitud con el filtro type=USER_GROUP solo mostrará grupos de usuarios. El campo type es el único filtro compatible.
|
Cuerpo de la solicitud
El cuerpo de la solicitud debe estar vacío.
Cuerpo de la respuesta
Mensaje de respuesta para Accounts.ListAccount.
Si se ejecuta correctamente, el cuerpo de la respuesta contendrá datos con la siguiente estructura:
Representación JSON |
{
"accounts": [
{
object (Account )
}
],
"nextPageToken": string
} |
Campos |
accounts[] |
object (Account )
Es un conjunto de cuentas a las que el usuario tiene acceso. La cuenta personal del usuario que realiza la consulta siempre será el primer elemento del resultado, a menos que se filtre.
|
nextPageToken |
string
Si la cantidad de cuentas supera el tamaño de página solicitado, este campo se completa con un token para recuperar la página siguiente de cuentas en una llamada posterior a accounts.list . Si no hay más cuentas, este campo no aparecerá en la respuesta.
|
Alcances de autorización
Requiere el siguiente alcance de OAuth:
https://www.googleapis.com/auth/business.manage
Para obtener más información, consulta la descripción general de OAuth 2.0.
Salvo que se indique lo contrario, el contenido de esta página está sujeto a la licencia Atribución 4.0 de Creative Commons, y los ejemplos de código están sujetos a la licencia Apache 2.0. Para obtener más información, consulta las políticas del sitio de Google Developers. Java es una marca registrada de Oracle o sus afiliados.
Última actualización: 2025-07-25 (UTC)
[null,null,["Última actualización: 2025-07-25 (UTC)"],[[["\u003cp\u003eLists all accounts owned by or accessible to the authenticated user, including their personal account.\u003c/p\u003e\n"],["\u003cp\u003eAllows filtering accounts by type and specifying the parent account for retrieval.\u003c/p\u003e\n"],["\u003cp\u003eSupports pagination to retrieve large lists of accounts using \u003ccode\u003epageToken\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe response includes an array of \u003ccode\u003eAccount\u003c/code\u003e objects and a \u003ccode\u003enextPageToken\u003c/code\u003e for further results.\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 API retrieves a list of accounts for an authenticated user via a `GET` request to a specified URL. The user can filter the accounts by type, specify the page size, and use a `pageToken` for pagination. An optional `parentAccount` parameter retrieves accounts directly accessible from that account. The request body must be empty, and the successful response includes an array of account objects and, if applicable, a `nextPageToken` for further pagination. This uses OAuth 2.0 with the `business.manage` scope.\n"],null,["# Method: accounts.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.ListAccountsResponse.SCHEMA_REPRESENTATION)\n- [Authorization scopes](#body.aspect)\n\nLists all of the accounts for the authenticated user. This includes all accounts that the user owns, as well as any accounts for which the user has management rights.\n\n### HTTP request\n\n`GET https://mybusinessaccountmanagement.googleapis.com/v1/accounts`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Query parameters\n\n| Parameters ||\n|-----------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `parentAccount` | `string` Optional. The resource name of the account for which the list of directly accessible accounts is to be retrieved. This only makes sense for Organizations and User Groups. If empty, will return `accounts.list` for the authenticated user. `accounts/{account_id}`. |\n| `pageSize` | `integer` Optional. How many accounts to fetch per page. The default and maximum is 20. |\n| `pageToken` | `string` Optional. If specified, the next page of accounts is retrieved. The `pageToken` is returned when a call to `accounts.list` returns more results than can fit into the requested page size. |\n| `filter` | `string` Optional. A filter constraining the accounts to return. The response includes only entries that match the filter. If `filter` is empty, then no constraints are applied and all accounts (paginated) are retrieved for the requested account. For example, a request with the filter `type=USER_GROUP` will only return user groups. The `type` field is the only supported filter. |\n\n### Request body\n\nThe request body must be empty.\n\n### Response body\n\nResponse message for Accounts.ListAccounts.\n\nIf successful, the response body contains data with the following structure:\n\n| JSON representation |\n|-------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"accounts\": [ { object (/my-business/reference/accountmanagement/rest/v1/accounts#Account) } ], \"nextPageToken\": string } ``` |\n\n| Fields ||\n|-----------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `accounts[]` | `object (`[Account](/my-business/reference/accountmanagement/rest/v1/accounts#Account)`)` A collection of accounts to which the user has access. The personal account of the user doing the query will always be the first item of the result, unless it is filtered out. |\n| `nextPageToken` | `string` If the number of accounts exceeds the requested page size, this field is populated with a token to fetch the next page of accounts on a subsequent call to `accounts.list`. If there are no more accounts, this field is not present in the response. |\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)."]]