To configure OAuth for your application, you set up an OAuth workflow, and you enable the Data Portability API OAuth scopes.
Set up an OAuth workflow
To set up an OAuth flow for your application, follow the basic steps in the Google Identity documentation.
Most developers use the Server-side Web Apps flow for obtaining OAuth consent, but you can also use the JavaScript Web Apps flow or the Mobile and Desktop Apps flow.
Data Portability API OAuth scopes
When you configure your Data Portability API application for OAuth, enable the
Data Portability API OAuth scopes that are relevant to your application. Some scopes
are sensitive
and restricted
and are subject to additional requirements.
When you add the Data Portability API scopes to your OAuth flow, there may be cases where your user gives consent to some but not all of the scopes. Your app must be able to handle these cases by:
- Allowing partial data exports
- Notifying the user that they didn't select all the necessary scopes (and failing gracefully)
- Asking the user for the remaining consents
You should note that a user's consent allows you one data export for that specific consent. To download the data again, you need a new consent from the user.
You should also note that during the OAuth flow, your app does not know which Google Account was used to give consent. The OAuth token your application receives is opaque.
If you are looking for information on how users share data, see Share a copy of your data with a third party.
Scopes restrictions
This section covers restrictions in scopes that result in errors.
Mixed scopes
Requests for Data Portability API scopes (such as, https://www.googleapis.com/auth/dataportability.*) can't be mixed with other scopes (such as, https://www.googleapis.com/auth/userinfo.email). Here is an example of a bad request, with the restricted part bolded:
https://accounts.google.com/o/oauth2/v2/auth?
client_id=client_id&
redirect_uri=redirect_uri&
response_type=token&
scope=https://www.googleapis.com/auth/dataportability.myactivity.search+https://www.googleapis.com/auth/userinfo.email&
include_granted_scopes=false
Previously granted scopes
You should never set include_granted_scopes=true
when requesting DPAPI scopes.
Here is an example of a bad request, with the restricted part bolded:
https://accounts.google.com/o/oauth2/v2/auth?
client_id=client_id&
redirect_uri=redirect_uri&
response_type=token&
scope=https://www.googleapis.com/auth/dataportability.myactivity.search&
include_granted_scopes=true
Scopes categories
This table contains all OAuth scopes supported by the Data Portability API and their categories. For a list of all resource groups and OAuth scopes supported by a particular service, see the schema reference page for that service.
Scopes | Description | Category |
---|---|---|
https://www.googleapis.com/auth/dataportability.alerts.subscriptions | Move a copy of the Google Alerts subscriptions you created. | Sensitive |
https://www.googleapis.com/auth/dataportability.businessmessaging.conversations | Move a copy of messages between you and the businesses you have conversations with across Google services. | Restricted |
https://www.googleapis.com/auth/dataportability.chrome.autofill | Move a copy of the information you entered into online forms in Chrome. | Restricted |
https://www.googleapis.com/auth/dataportability.chrome.bookmarks | Move a copy of pages you bookmarked in Chrome. | Restricted |
https://www.googleapis.com/auth/dataportability.chrome.dictionary | Move a copy of words you added to Chrome's dictionary. | Sensitive |
https://www.googleapis.com/auth/dataportability.chrome.extensions | Move a copy of extensions you installed from the Chrome Web Store. | Sensitive |
https://www.googleapis.com/auth/dataportability.chrome.history | Move a copy of sites you visited in Chrome. | Restricted |
https://www.googleapis.com/auth/dataportability.chrome.reading_list | Move a copy of pages you added to your reading list in Chrome. | Sensitive |
https://www.googleapis.com/auth/dataportability.chrome.settings | Move a copy of your settings in Chrome. | Sensitive |
https://www.googleapis.com/auth/dataportability.discover.follows | Move a copy of searches and sites you follow, saved by Discover. | Sensitive |
https://www.googleapis.com/auth/dataportability.discover.likes | Move a copy of links to your liked documents, saved by Discover. | Sensitive |
https://www.googleapis.com/auth/dataportability.discover.not_interested | Move a copy of content you marked as not interested, saved by Discover. | Sensitive |
https://www.googleapis.com/auth/dataportability.maps.aliased_places | Move a copy of the places you labeled on Maps. | Restricted |
https://www.googleapis.com/auth/dataportability.maps.commute_routes | Move a copy of your pinned trips on Maps. | Restricted |
https://www.googleapis.com/auth/dataportability.maps.commute_settings | Move a copy of your commute settings on Maps. | Sensitive |
https://www.googleapis.com/auth/dataportability.maps.ev_profile | Move a copy of your electric vehicle profile on Maps. | Sensitive |
https://www.googleapis.com/auth/dataportability.maps.factual_contributions | Move a copy of the corrections you made to places or map information on Maps. | Sensitive |
https://www.googleapis.com/auth/dataportability.maps.offering_contributions | Move a copy of your updates to places on Maps. | Sensitive |
https://www.googleapis.com/auth/dataportability.maps.photos_videos | Move a copy of the photos and videos you posted on Maps. | Sensitive |
https://www.googleapis.com/auth/dataportability.maps.questions_answers | Move a copy of the questions and answers you posted on Maps. | Sensitive |
https://www.googleapis.com/auth/dataportability.maps.reviews | Move a copy of your reviews and posts on Maps. | Sensitive |
https://www.googleapis.com/auth/dataportability.maps.starred_places | Move a copy of your Starred places list on Maps. | Restricted |
https://www.googleapis.com/auth/dataportability.myactivity.maps | Move a copy of your Maps activity. | Restricted |
https://www.googleapis.com/auth/dataportability.myactivity.myadcenter | Move a copy of your My Ad Center activity. | Sensitive |
https://www.googleapis.com/auth/dataportability.myactivity.play | Move a copy of your Google Play activity. | Restricted |
https://www.googleapis.com/auth/dataportability.myactivity.search | Move a copy of your Google Search activity. | Restricted |
https://www.googleapis.com/auth/dataportability.myactivity.shopping | Move a copy of your Shopping activity. | Restricted |
https://www.googleapis.com/auth/dataportability.myactivity.youtube | Move a copy of your YouTube activity. | Restricted |
https://www.googleapis.com/auth/dataportability.mymaps.maps | Move a copy of the maps you created in My Maps. | Restricted |
https://www.googleapis.com/auth/dataportability.order_reserve.purchases_reservations | Move a copy of your food purchase and reservation activity. | Sensitive |
https://www.googleapis.com/auth/dataportability.play.devices | Move a copy of information about your devices with Google Play Store installed. | Sensitive |
https://www.googleapis.com/auth/dataportability.play.grouping | Move a copy of your Google Play Store Grouping tags created by app developers. | Sensitive |
https://www.googleapis.com/auth/dataportability.play.installs | Move a copy of your Google Play Store app installations. | Sensitive |
https://www.googleapis.com/auth/dataportability.play.library | Move a copy of your Google Play Store downloads, including books, games, and apps. | Sensitive |
https://www.googleapis.com/auth/dataportability.play.playpoints | Move a copy of information about your Google Play Store Points. | Sensitive |
https://www.googleapis.com/auth/dataportability.play.promotions | Move a copy of information about your Google Play Store promotions. | Sensitive |
https://www.googleapis.com/auth/dataportability.play.purchases | Move a copy of your Google Play Store purchases. | Restricted |
https://www.googleapis.com/auth/dataportability.play.redemptions | Move a copy of your Google Play Store redemption activities. | Sensitive |
https://www.googleapis.com/auth/dataportability.play.subscriptions | Move a copy of your Google Play Store subscriptions. | Sensitive |
https://www.googleapis.com/auth/dataportability.play.usersettings | Move a copy of your Google Play Store user settings and preferences. | Sensitive |
https://www.googleapis.com/auth/dataportability.saved.collections | Move a copy of your saved links, images, places, and collections from your use of Google services. | Sensitive |
https://www.googleapis.com/auth/dataportability.search_ugc.media.reviews_and_stars | Move a copy of your media reviews on Google Search. | Sensitive |
https://www.googleapis.com/auth/dataportability.search_ugc.media.streaming_video_providers | Move a copy of your self-reported video streaming provider preferences from Google Search and Google TV. | Sensitive |
https://www.googleapis.com/auth/dataportability.search_ugc.media.thumbs | Move a copy of your indicated thumbs up and thumbs down on media in Google Search and Google TV. | Sensitive |
https://www.googleapis.com/auth/dataportability.search_ugc.media.watched | Move a copy of information about the movies and TV shows you marked as watched on Google Search and Google TV. | Sensitive |
https://www.googleapis.com/auth/dataportability.searchnotifications.settings | Move a copy of your notification settings on the Google Search app. | Sensitive |
https://www.googleapis.com/auth/dataportability.searchnotifications.subscriptions | Move a copy of your notification subscriptions on Google Search app. | Sensitive |
https://www.googleapis.com/auth/dataportability.shopping.addresses | Move a copy of your shipping information on Shopping. | Sensitive |
https://www.googleapis.com/auth/dataportability.shopping.reviews | Move a copy of reviews you wrote about products or online stores on Google Search. | Sensitive |
https://www.googleapis.com/auth/dataportability.streetview.imagery | Move a copy of the images and videos you uploaded to Street View. | Sensitive |
https://www.googleapis.com/auth/dataportability.youtube.channel | Move a copy of information about your YouTube channel. | Restricted |
https://www.googleapis.com/auth/dataportability.youtube.clips | Move a copy of your YouTube clips metadata. | Sensitive |
https://www.googleapis.com/auth/dataportability.youtube.comments | Move a copy of your YouTube comments. | Sensitive |
https://www.googleapis.com/auth/dataportability.youtube.live_chat | Move a copy of your YouTube messages in live chat. | Sensitive |
https://www.googleapis.com/auth/dataportability.youtube.music | Move a copy of your uploaded YouTube music tracks and your YouTube music library. | Sensitive |
https://www.googleapis.com/auth/dataportability.youtube.playable | Move a copy of your YouTube playables saved game progress files. | Sensitive |
https://www.googleapis.com/auth/dataportability.youtube.posts | Move a copy of your YouTube posts. | Sensitive |
https://www.googleapis.com/auth/dataportability.youtube.private_playlists | Move a copy of your YouTube private playlists. | Sensitive |
https://www.googleapis.com/auth/dataportability.youtube.private_videos | Move a copy of your private YouTube videos and information about them. | Restricted |
https://www.googleapis.com/auth/dataportability.youtube.public_playlists | Move a copy of your public YouTube playlists. | Sensitive |
https://www.googleapis.com/auth/dataportability.youtube.public_videos | Move a copy of your public YouTube videos and information about them. | Sensitive |
https://www.googleapis.com/auth/dataportability.youtube.shopping | Move a copy of your YouTube shopping wishlists, and wishlist items. | Sensitive |
https://www.googleapis.com/auth/dataportability.youtube.subscriptions | Move a copy of your YouTube channel subscriptions, even if they're private. | Sensitive |
https://www.googleapis.com/auth/dataportability.youtube.unlisted_playlists | Move a copy of your unlisted YouTube playlists. | Sensitive |
https://www.googleapis.com/auth/dataportability.youtube.unlisted_videos | Move a copy of your unlisted YouTube videos and information about them. | Sensitive |