Esegui la migrazione all'API Drive v3
Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Se al momento utilizzi l'API Drive v2, puoi eseguire la migrazione alla v3.
Consulta il riferimento da v2 a v3 per una mappatura completa di tutte le differenze tra le risorse delle versioni.
La versione di {drive_api_short} è impostata in modo diverso per ogni lingua:
var DISCOVERY_DOCS = ["https://www.googleapis.com/discovery/v1/apis/drive/v3/rest"];
- Per Python, specifichi la versione quando crei l'oggetto servizio. Per un esempio, consulta la guida rapida di Python.
service = build('drive', 'v3', credentials=creds)
- Per Node.js, definisci la versione quando imposti il costruttore google.drive. Per un esempio,
vedi la guida rapida di Node.js.
const drive = google.drive({version: 'v3', auth});
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-08-29 UTC.
[null,null,["Ultimo aggiornamento 2025-08-29 UTC."],[],[],null,["# Migrate to Drive API v3\n\nIf you are currently using Drive API v2, you can migrate to v3.\n\nYou should review the [V2 to v3 reference](/workspace/drive/api/guides/v2-to-v3-reference) for a complete map of all resource differences between versions.\n\nThe {drive_api_short} version is set differently for each language:\n\n- For Java, you download the v3 library. See [Drive API client library for Java](https://github.com/googleapis/google-api-java-client-services/tree/main/clients/google-api-services-drive/v3).\n For an example, see [Java Quickstart](/workspace/drive/api/quickstart/java).\n\n- For JavaScript, you define the version with the Discovery docs URL. For an example,\n see [Browser Quickstart](/workspace/drive/api/quickstart/js).\n\n var DISCOVERY_DOCS = [\"https://www.googleapis.com/discovery/v1/apis/drive/v3/rest\"];\n\n- For Python, you specify the version when you build the service object. For an example, see [Python Quickstart](/workspace/drive/api/quickstart/python).\n\n service = build('drive', 'v3', credentials=creds)\n\n- For Node.js, you define the version when you set the google.drive constructor. For an example, see [Node.js Quickstart](/workspace/drive/api/quickstart/nodejs).\n\n const drive = google.drive({version: 'v3', auth});"]]