The photos space will sunset in early January 2018. Your users can continue to access Google Photos via the drive space by enabling the Google Photos folder in My Drive in the Drive client settings

Enable the Drive Platform

To get started integrating with the Drive UI, you need to enable the Drive API and provide configuration details in your API project. This gives you access to the API as well as access to UI integration features.

Enable the Drive API

To interact with the Drive API, you need to enable the Drive API service for your app. You can do this in the Google API project for the app.

To enable the Drive API, complete these steps:

  1. Go to the Google API Console.
  2. Select a project.
  3. In the sidebar on the left, expand APIs & auth and select APIs.
  4. In the displayed list of available APIs, click the link for the Drive API and click Enable API.
  5. Within the Drive API page, select the Drive UI Integration tab and begin configuring how your App will integrate with the Drive UI.

Configure your App's Drive UI Integration

Configuring your App's Drive UI Integration requires you to provide detailed developer information for your app. To begin configuring, navigate to the Drive UI Integration tab within the Drive API page.

Drive Integration Configuration

This section contains fields to enter information describing your application. The Application Name and Short Description fields are displayed to users in the Manage apps dialog in the Drive UI. The Long Description field can be used to describe your application in more detail.

Icons

Specify application and document icons to display in Google Drive. For more information on the requirements for these assets, see the Branding Guidelines.

Drive Integration

In this section, you'll need to specify the Open URL for your app, and your preferences on how users create and open files with the app. Also, you can select from optional features like support for multiple file selection and Google doc import.

Authentication

Install URL

You can use the Install URL if you wish to redirect your users to a special URL the first time they open your app from Drive.

Open URL

There are two important things to keep in mind for the Open URL:

  • Make sure you give a fully qualified domain name for Open URL, localhost does not work.
  • The URL must belong to you. After the app registration is complete, you will need to verify your ownership of this URL in order to create a Chrome Web Store listing. For more information, see Site Verification

Open URLs may include the template variable placeholders:

Variable Placeholder Description
{ids} A comma-separated list of file IDs that are being opened.
{exportIds} A comma-separated list of file IDs that are being exported.
{userId} The profile ID that uniquely identifies the user.
{action} The action being performed. Either: open or create

If no template variables are used in the Open URL, a state query parameter is automatically appended. It contains a JSON encoded string of all the above template variables. You may choose to use either the state query parameter or URL template variable substitution.

See Open Files for more information on handling file open actions.

Setting MIME types and file extensions

Specify the MIME types and file extensions your app can open. When entering these values, consider the following:

  • Specify both MIME types and file extensions. There are cases where just one or the other is not sufficient.
  • Make sure the MIME types you enter are standard, canonical types or Google MIME types, free of typos or misspellings.
  • Consider carefully whether your app needs default or secondary status.

Default vs. Secondary status is related to opening files with your app by default. Simply put, default types are the MIME types and file extensions you really want your app to open by default (the user makes the final choice on this). Secondary types are ones that your app can open. For example, an image editor might need to list numerous secondary types to open (png, jpg, and so on) but few default types, which might include only its native format for layering and editing images.

When multiple installed apps are registered as the default type for a particular MIME type or file extension, the last-installed app acts as default until the user makes a specific selection.

Creating files

You can control whether or not users can create new Drive files with your application by checking the Allow users to create new documents using this application option. If enabled, you must provide a New URL that users are redirected to when a user selects your application from the New menu in Drive. You can optionally fill in the Document Name field to provide a name for the type of document your application creates. This is displayed in the New menu in Drive.

Multiple file support

If your application supports opening multiple files in a single instance, you can check this option to enable multiple file support. Otherwise, each time a user opens a file a new instance of your application is spawned.

Importing

You can opt to import files and convert them into formats supported by your app. For more information, see Open and convert Google Docs in your app.

Mobile browser support

Select this option if your application can be used in a mobile browser.

Next steps

After you have enabled the Drive API and filled out the Drive UI Integration tab, you'll need users -- or a test account for development -- to install your app.

发送以下问题的反馈:

此网页
Drive REST API
Drive REST API