Informazioni sull'utente di ritorno
Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Google Drive offre due opzioni per raccogliere informazioni sugli utenti di Drive:
Utilizzando la risorsa about
, puoi recuperare
informazioni sull'utente, sulle impostazioni di Drive dell'utente e
sulle funzionalità del sistema.
Utilizzando la risorsa apps
, puoi recuperare un elenco delle app installate dall'utente, con informazioni sui tipi MIME, sulle estensioni dei file e su altri dettagli supportati da ciascuna app.
Questa guida spiega come recuperare le informazioni utente in Drive.
Visualizzare i dettagli di un utente
Per restituire informazioni su un utente Drive come istanza di
about
, utilizza il metodo
get
. I valori restituiti sono misurati
in byte.
Devi impostare il parametro di sistema fields
sul metodo get
per specificare i campi da restituire nella risposta. Nella maggior parte dei metodi Drive, questa azione è necessaria solo per restituire campi non predefiniti, ma è obbligatoria per la risorsa about
. Se ometti il parametro,
il metodo restituisce un errore. Per saperne di più, consulta Restituire campi specifici.
Il seguente esempio di codice mostra come fornire più fields
come parametro di query nella richiesta. La risposta restituisce i valori dei campi per la richiesta.
Richiedi
GET https://www.googleapis.com/drive/v3/about/?fields=kind,user,storageQuota
Risposta
{
"kind": "drive#about",
"user": {
"kind": "drive#user",
"displayName": "DISPLAY_NAME",
"photoLink": "PHOTO_LINK",
"me": true,
"permissionId": "PERMISSION_ID",
"emailAddress": "EMAIL_ADDRESS"
},
"storageQuota": {
"usage": "10845031958",
"usageInDrive": "2222008387",
"usageInDriveTrash": "91566"
}
}
La risposta include i seguenti valori:
DISPLAY_NAME
: il nome dell'utente in testo normale.
PHOTO_LINK
: l'URL della foto del profilo dell'utente.
PERMISSION_ID
: l'ID dell'utente all'interno delle risorse Permission
.
EMAIL_ADDRESS
: l'indirizzo email dell'utente
Elenco app utente
Le app Google Drive sono elencate in
Google Workspace Marketplace e
vengono utilizzate per rendere Drive più pratico, ad esempio l'app
Documenti Google o un componente aggiuntivo utilizzato in Documenti per
firmare documenti. Per saperne di più, consulta Utilizzare le app di Google Drive.
Per restituire un elenco di tutte le app installate dell'utente come istanza di apps
, utilizza il metodo list
senza parametri.
Se vuoi specificare i campi da restituire nella risposta, puoi impostare il
fields
parametro
di sistema. Se
non specifichi il parametro fields
, il server restituisce un insieme predefinito di
campi. Per saperne di più, consulta Restituire campi specifici.
Il seguente esempio di codice mostra come restituire un elenco di tutte le app installate dall'utente nella richiesta. La risposta restituisce i valori dei campi per la richiesta.
Richiedi
GET https://www.googleapis.com/drive/v3/apps
Risposta
{
"kind": "drive#appList",
"selfLink": "https://www.googleapis.com/drive/v3/apps",
"items": [
{
"kind": "drive#app",
"id": "ID",
"name": "Google Sheets",
"supportsCreate": true,
"supportsImport": true,
"supportsMultiOpen": false,
"supportsOfflineCreate": true,
"productUrl": "https://chrome.google.com/webstore/detail/felcaaldnbdncclmgdcncolpebgiejap",
"productId": "PRODUCT_ID"
}
],
"defaultAppIds": [
"ID"
]
}
La risposta include i seguenti valori:
ID
: l'ID app.
PRODUCT_ID
: l'ID scheda di prodotto per questa app.
Elenca le app utente con i parametri di query
Per trovare un'app specifica, utilizza uno o più dei parametri di query facoltativi:
appFilterExtensions
: filtra i risultati di ricerca utilizzando un elenco
separato da virgole di estensioni dei file. Le app nell'ambito della query dell'app che possono aprire le
estensioni di file elencate sono incluse nella risposta. Se vengono forniti anche appFilterMimeTypes
, viene restituita un'unione dei due elenchi di app risultanti.
Alcuni esempi di estensioni sono docx
per Microsoft Word e pptx
per
Microsoft PowerPoint. Per altri esempi di estensioni dei file, vedi Esportare i tipi MIME per i documenti Google Workspace.
Il seguente esempio di codice mostra come fornire più estensioni di file come parametro di query: GET
https://www.googleapis.com/drive/v3/apps?appFilterExtensions=docx,pptx
.
appFilterMimeTypes
: filtra i risultati di ricerca utilizzando un elenco separato da virgole
di tipi MIME. Nella risposta sono incluse le app nell'ambito della query dell'app che possono aprire i tipi MIME elencati. Se vengono forniti anche appFilterExtensions
, viene restituita un'unione dei due elenchi di app risultanti. Esempi di tipi MIME includono application/vnd.google-apps.form
per Moduli Google e application/vnd.google-apps.site
per Google Sites. Per altri esempi di tipi MIME, vedi Tipi MIME supportati da Google Workspace e Google Drive.
Il seguente esempio di codice mostra come fornire più tipi MIME come
parametro di query: GET
https://www.googleapis.com/drive/v3/apps?appFilterMimeTypes=application/vnd.google-apps.form,application/vnd.google-apps.site
.
languageCode
: filtra i risultati di ricerca utilizzando un codice di lingua o paese,
come definito da BCP 47, con alcune estensioni del formato LDML di Unicode. Esempi di codici lingua
includono en-us
per l'inglese (Stati Uniti) e fr-ca
per il francese (Canada).
Il seguente esempio di codice mostra come fornire più codici lingua come
parametro di query: GET
https://www.googleapis.com/drive/v3/apps?languageCode=en-us,fr-ca
.
Recuperare l'app utente per ID
Per scaricare le informazioni dettagliate sull'app come istanza di
apps
, utilizza il metodo get
con l'ID app.
Il seguente esempio di codice mostra come fornire un appId
come parametro di query nella richiesta. La risposta restituisce i valori dei campi per la richiesta.
Richiedi
GET https://www.googleapis.com/drive/v3/apps/APP_ID
Risposta
{
"kind": "drive#app",
"id": "ID",
"name": "Google Sheets",
"supportsCreate": true,
"supportsImport": true,
"supportsMultiOpen": false,
"supportsOfflineCreate": true,
"productUrl": "https://chrome.google.com/webstore/detail/felcaaldnbdncclmgdcncolpebgiejap",
"productId": "PRODUCT_ID"
}
La risposta include i seguenti valori:
ID
: l'ID app.
PRODUCT_ID
: l'ID scheda di prodotto per questa app.
Ecco alcuni passaggi successivi che puoi provare:
Salvo quando diversamente specificato, i contenuti di questa pagina sono concessi in base alla licenza Creative Commons Attribution 4.0, mentre gli esempi di codice sono concessi in base alla licenza Apache 2.0. Per ulteriori dettagli, consulta le norme del sito di Google Developers. Java è un marchio registrato di Oracle e/o delle sue consociate.
Ultimo aggiornamento 2025-09-01 UTC.
[null,null,["Ultimo aggiornamento 2025-09-01 UTC."],[],[],null,["Google Drive provides two options to gather information about\nDrive users:\n\n- Using the [`about`](/workspace/drive/api/reference/rest/v3/about) resource, you can retrieve\n information about the user, the user's Drive settings, and\n their system capabilities.\n\n- Using the [`apps`](/workspace/drive/api/reference/rest/v3/apps) resource, you can retrieve a\n list of the user's installed apps, with information about each app's\n supported MIME types, file extensions, and other details.\n\nThis guide explains how you can retrieve user info in Drive.\n\nGet details about a user\n\nTo return information on a Drive user as an instance of\n[`about`](/workspace/drive/api/reference/rest/v3/about), use the\n[`get`](/workspace/drive/api/reference/rest/v3/about/get) method. The returned values are measured\nin bytes.\n\nYou *must* set the `fields` [system\nparameter](https://cloud.google.com/apis/docs/system-parameters#definitions) on\nthe `get` method to specify the fields to return in the response. In most\nDrive methods this action is only required to return non-default\nfields but it's mandatory for the `about` resource. If you omit the parameter,\nthe method returns an error. For more information, see [Return specific fields](/workspace/drive/api/guides/fields-parameter).\n| **Note:** If you're using the previous Drive API v2 version, setting the `fields` parameter in the `get` method isn't required. Learn how to [migrate to\nDrive API v3](/workspace/drive/api/guides/migrate-to-v3). \nThe following code sample shows how to provide multiple `fields` as a query parameter in the request. The response returns the field values for the request.\n\n**Request** \n\n```text\nGET https://www.googleapis.com/drive/v3/about/?fields=kind,user,storageQuota\n```\n\n**Response** \n\n```scdoc\n{\n \"kind\": \"drive#about\",\n \"user\": {\n \"kind": \"drive#user\",\n \"displayName\": \"DISPLAY_NAME\",\n \"photoLink\": \"PHOTO_LINK\";,\n \"me\": true,\n \"permissionId\": \"PERMISSION_ID\",\n \"emailAddress\": \"EMAIL_ADDRESS\"\n },\n \"storageQuota\": {\n \"usage\": \"10845031958\",\n \"usageInDrive\": \"2222008387\",\n \"usageInDriveTrash\": \"91566\"\n }\n}\n```\n\nThe response includes the following values:\n\n- \u003cvar translate=\"no\"\u003eDISPLAY_NAME\u003c/var\u003e: the user's name in plain text.\n- \u003cvar translate=\"no\"\u003ePHOTO_LINK\u003c/var\u003e: the URL of the user's profile photo.\n- \u003cvar translate=\"no\"\u003ePERMISSION_ID\u003c/var\u003e: the user's ID within the `Permission` resources.\n- \u003cvar translate=\"no\"\u003eEMAIL_ADDRESS\u003c/var\u003e: the user's email address\n\nList user apps\n\nGoogle Drive apps are listed in the\n[Google Workspace Marketplace](https://workspace.google.com/marketplace) and\nare used to make Drive more convenient such as the Google Docs\napp or an add-on used within Docs to\nsign documents. For more information, see [Use Google Drive\napps](https://support.google.com/drive/answer/2500820).\n\nTo return a list of all the user's installed apps as an instance of [`apps`](/workspace/drive/api/reference/rest/v3/apps), use the [`list`](/workspace/drive/api/reference/rest/v3/apps/list) method\nwithout any parameters.\n\nIf you want to specify the fields to return in the response, you can set the\n`fields` [system\nparameter](https://cloud.google.com/apis/docs/system-parameters#definitions). If\nyou don't specify the `fields` parameter, the server returns a default set of\nfields. For more information, see [Return specific fields](/workspace/drive/api/guides/fields-parameter).\n| **Note:** If you're using the previous Drive API v2 version, the response body also includes the `etag` field. Learn how to [migrate to\nDrive API v3](/workspace/drive/api/guides/migrate-to-v3). \nThe following code sample shows how to return a list of all the user's installed apps in the request. The response returns the field values for the request.\n\n**Request** \n\n```text\nGET https://www.googleapis.com/drive/v3/apps\n```\n\n**Response** \n\n```scdoc\n{\n \"kind\": \"drive#appList\",\n \"selfLink\": \"https://www.googleapis.com/drive/v3/apps\",\n \"items\": [\n {\n \"kind\": \"drive#app\",\n \"id\": \"ID\",\n \"name\": \"Google Sheets\",\n \"supportsCreate\": true,\n \"supportsImport\": true,\n \"supportsMultiOpen\": false,\n \"supportsOfflineCreate\": true,\n \"productUrl\": \"https://chrome.google.com/webstore/detail/felcaaldnbdncclmgdcncolpebgiejap\",\n \"productId\": \"PRODUCT_ID\"\n }\n ],\n \"defaultAppIds\": [\n \"ID\"\n ]\n}\n```\n\nThe response includes the following values:\n\n- \u003cvar translate=\"no\"\u003eID\u003c/var\u003e: the app ID.\n- \u003cvar translate=\"no\"\u003ePRODUCT_ID\u003c/var\u003e: the product listing ID for this app.\n\nList user apps with query parameters\n\nTo find a specific app, use one or more of the optional query parameters:\n\n- `appFilterExtensions`: Filter the search results using a comma-separated\n list of file extensions. Apps within the app query scope that can open the\n listed file extensions are included in the response. If `appFilterMimeTypes`\n are also provided, a union of the two resulting app lists is returned.\n Examples of extensions include `docx` for Microsoft Word and `pptx` for\n Microsoft PowerPoint. For more examples of file extensions, see [Export MIME\n types for Google Workspace documents](/workspace/drive/api/guides/ref-export-formats).\n\n The following code sample shows how to provide multiple file extensions as a\n query parameter: `GET\n https://www.googleapis.com/drive/v3/apps?appFilterExtensions=docx,pptx`.\n- `appFilterMimeTypes`: Filter the search results using a comma-separated list\n of MIME types. Apps within the app query scope that can open the listed MIME\n types are included in the response. If `appFilterExtensions` are also\n provided, a union of the two resulting app lists is returned. Examples of\n MIME types include `application/vnd.google-apps.form` for Google Forms and\n `application/vnd.google-apps.site` for Google Sites. For more examples of\n MIME types, see [Google Workspace and Google Drive supported MIME\n types](/workspace/drive/api/guides/mime-types).\n\n The following code sample shows how to provide multiple MIME types as a\n query parameter: `GET\n https://www.googleapis.com/drive/v3/apps?appFilterMimeTypes=application/vnd.google-apps.form,application/vnd.google-apps.site`.\n- `languageCode`: Filter the search results using a language or locale code,\n as defined by BCP 47, with some extensions from [Unicode's LDML\n format](https://www.unicode.org/reports/tr35/). Examples of language codes\n include `en-us` for English (United States) and `fr-ca` for French (Canada).\n\n The following code sample shows how to provide multiple language codes as a\n query parameter: `GET\n https://www.googleapis.com/drive/v3/apps?languageCode=en-us,fr-ca`.\n\nGet user app by ID\n\nTo download the detailed app info as an instance of\n[`apps`](/workspace/drive/api/reference/rest/v3/apps), use the [`get`](/workspace/drive/api/reference/rest/v3/apps/get)\nmethod with the app ID. \nThe following code sample shows how to provide an `appId` as a query parameter in the request. The response returns the field values for the request.\n\n**Request** \n\n```scdoc\nGET https://www.googleapis.com/drive/v3/apps/APP_ID\n```\n\n**Response** \n\n```scdoc\n{\n \"kind\": \"drive#app\",\n \"id\": \"ID\",\n \"name\": \"Google Sheets\",\n \"supportsCreate\": true,\n \"supportsImport\": true,\n \"supportsMultiOpen\": false,\n \"supportsOfflineCreate\": true,\n \"productUrl": \"https://chrome.google.com/webstore/detail/felcaaldnbdncclmgdcncolpebgiejap\",\n \"productId\": \"PRODUCT_ID\"\n}\n```\n\nThe response includes the following values:\n\n- \u003cvar translate=\"no\"\u003eID\u003c/var\u003e: the app ID.\n- \u003cvar translate=\"no\"\u003ePRODUCT_ID\u003c/var\u003e: the product listing ID for this app.\n\nRelated topics\n\nHere are a few next steps you might try:\n\n- To create a file in Drive, see [Create and manage files](/workspace/drive/api/guides/create-file).\n\n- To upload file data when you create or update a file, see [Upload file\n data](/workspace/drive/api/guides/manage-uploads).\n\n- To download and export files, see [Download and export\n files](/workspace/drive/api/guides/manage-downloads)."]]