Data connectors

Use the Google Drive data connector to import files from your users’ Google Drive accounts into the platform as assets. Each user grants your application access to their account, and you import the files they select on their behalf.

A connection represents an authorized link to a user’s Google Drive account. After you create a connection, you generate a short-lived access token for the Google Drive Picker, the user selects files, and you import those files as assets.

Import limits:

  • Video: Up to 10 GB
  • Audio: Up to 4 GB
  • Images: Up to 32 MB

You can import up to 100 files per request.

Workflow

1

Connect an account: The platform connects a user’s account through the standard OAuth 2.0 authorization code flow. Invoke the POST method of the /connections:authorize endpoint with your redirect URL to receive an authorization URL, then redirect the user to it. When the user grants access, the platform returns them to your redirect URL with the identifier of the new connection in the connection_id query parameter. Store this identifier and pass it as the connection_id path parameter in the following steps.

2

Generate a picker token: Invoke the POST method of the /connections/{connection_id}/picker-token endpoint to generate a short-lived, read-only access token. Use it with the Google Drive Picker so the user can select files. Store the value of the source_id field of each file.

3

Import the files: Invoke the POST method of the /connections/{connection_id}/imports endpoint. Provide up to 100 items, each with a value for the source_id field. Each accepted item creates an asset in the processing status and returns the value of its asset_id field. Check the has_failures field in the response, and inspect the error object of any item the platform rejected.

4

Check the import status: Invoke the GET method of the /connections/{connection_id}/imports/{import_id} endpoint until each item reaches the ready or failed status. When an item reaches the ready status, use the value of its asset_id field with the rest of the API, such as the Index content endpoints.

5

(Optional) Disconnect the account: Invoke the DELETE method of the /connections/{connection_id} endpoint. The platform revokes access at the provider and deletes the stored tokens. Assets you already imported are retained.

For the fields and statuses these endpoints return, see The connection object and The import object pages. To review existing connections and imports, use the List connections and List imports endpoints.

Imported files become assets, the same as files you upload directly. Each imported asset includes a source field that describes the origin of the file at the provider.