Skip to content

Instantly share code, notes, and snippets.

@AlexDev404
Last active June 20, 2022 02:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AlexDev404/4041742c1c710ab2a0c3df1c62df6137 to your computer and use it in GitHub Desktop.
Save AlexDev404/4041742c1c710ab2a0c3df1c62df6137 to your computer and use it in GitHub Desktop.
{
"openapi": "3.0.1",
"info": {
"title": "Takeout API",
"description": "",
"contact": {
"name": "Google",
"url": "https://google.com"
},
"version": "v2"
},
"servers": [
{
"url": "https://takeout-pa.googleapis.com/"
}
],
"tags": [
{
"name": "exports"
}
],
"paths": {
"/v2/{service}/exports/{exportId}": {
"get": {
"tags": [
"exports"
],
"description": "Gets the status of a single export job.",
"operationId": "takeout_pa.exports.get",
"parameters": [
{
"name": "key",
"in": "query",
"description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.",
"schema": {
"type": "string"
}
},
{
"name": "access_token",
"in": "query",
"description": "OAuth access token.",
"schema": {
"type": "string"
}
},
{
"name": "upload_protocol",
"in": "query",
"description": "Upload protocol for media (e.g. \"raw\", \"multipart\").",
"schema": {
"type": "string"
}
},
{
"name": "prettyPrint",
"in": "query",
"description": "Returns response with indentations and line breaks.",
"schema": {
"type": "boolean",
"default": true
}
},
{
"name": "quotaUser",
"in": "query",
"description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.",
"schema": {
"type": "string"
}
},
{
"name": "fields",
"in": "query",
"description": "Selector specifying which fields to include in a partial response.",
"schema": {
"type": "string"
}
},
{
"name": "uploadType",
"in": "query",
"description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").",
"schema": {
"type": "string"
}
},
{
"name": "$.xgafv",
"in": "query",
"description": "V1 error format.",
"schema": {
"type": "string",
"enum": [
"1",
"2"
]
}
},
{
"name": "oauth_token",
"in": "query",
"description": "OAuth 2.0 token for the current user.",
"schema": {
"type": "string"
}
},
{
"name": "callback",
"in": "query",
"description": "JSONP",
"schema": {
"type": "string"
}
},
{
"name": "alt",
"in": "query",
"description": "Data format for response.",
"schema": {
"type": "string",
"default": "json",
"enum": [
"json",
"media",
"proto"
]
}
},
{
"name": "service",
"in": "path",
"description": "The Takeout service, from jcg/dataliberation/common/model/Service.java.",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "exportId",
"in": "path",
"description": "The ID of the export to get.",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Successful response",
"content": {
"*/*": {
"schema": {
"$ref": "#/components/schemas/GetExportResponse"
}
}
}
}
},
"security": [
{
"Oauth2": [
"https://www.googleapis.com/auth/drive.readonly"
]
}
]
}
},
"/v2/{service}/exports": {
"post": {
"tags": [
"exports"
],
"description": "Creates a new Export Job for the user. This will return immediately,\nthe ID in the response can then be used to poll GetExport to tell when\nthe job is done.",
"operationId": "takeout_pa.exports.create",
"parameters": [
{
"name": "key",
"in": "query",
"description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.",
"schema": {
"type": "string"
}
},
{
"name": "access_token",
"in": "query",
"description": "OAuth access token.",
"schema": {
"type": "string"
}
},
{
"name": "upload_protocol",
"in": "query",
"description": "Upload protocol for media (e.g. \"raw\", \"multipart\").",
"schema": {
"type": "string"
}
},
{
"name": "prettyPrint",
"in": "query",
"description": "Returns response with indentations and line breaks.",
"schema": {
"type": "boolean",
"default": true
}
},
{
"name": "quotaUser",
"in": "query",
"description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.",
"schema": {
"type": "string"
}
},
{
"name": "fields",
"in": "query",
"description": "Selector specifying which fields to include in a partial response.",
"schema": {
"type": "string"
}
},
{
"name": "uploadType",
"in": "query",
"description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").",
"schema": {
"type": "string"
}
},
{
"name": "$.xgafv",
"in": "query",
"description": "V1 error format.",
"schema": {
"type": "string",
"enum": [
"1",
"2"
]
}
},
{
"name": "oauth_token",
"in": "query",
"description": "OAuth 2.0 token for the current user.",
"schema": {
"type": "string"
}
},
{
"name": "callback",
"in": "query",
"description": "JSONP",
"schema": {
"type": "string"
}
},
{
"name": "alt",
"in": "query",
"description": "Data format for response.",
"schema": {
"type": "string",
"default": "json",
"enum": [
"json",
"media",
"proto"
]
}
},
{
"name": "service",
"in": "path",
"description": "The Takeout service, from jcg/dataliberation/common/model/Service.java.",
"required": true,
"schema": {
"type": "string"
}
}
],
"requestBody": {
"content": {
"*/*": {
"schema": {
"$ref": "#/components/schemas/ExportRequest"
}
}
},
"required": false
},
"responses": {
"200": {
"description": "Successful response",
"content": {
"*/*": {
"schema": {
"$ref": "#/components/schemas/CreateExportResponse"
}
}
}
}
},
"security": [
{
"Oauth2": [
"https://www.googleapis.com/auth/drive.readonly"
]
}
],
"x-codegen-request-body-name": "body"
}
},
"/v2/{service}/exports/{exportId}:cancel": {
"post": {
"tags": [
"exports"
],
"description": "Cancels a running export job.",
"operationId": "takeout_pa.exports.cancel",
"parameters": [
{
"name": "key",
"in": "query",
"description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.",
"schema": {
"type": "string"
}
},
{
"name": "access_token",
"in": "query",
"description": "OAuth access token.",
"schema": {
"type": "string"
}
},
{
"name": "upload_protocol",
"in": "query",
"description": "Upload protocol for media (e.g. \"raw\", \"multipart\").",
"schema": {
"type": "string"
}
},
{
"name": "prettyPrint",
"in": "query",
"description": "Returns response with indentations and line breaks.",
"schema": {
"type": "boolean",
"default": true
}
},
{
"name": "quotaUser",
"in": "query",
"description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.",
"schema": {
"type": "string"
}
},
{
"name": "fields",
"in": "query",
"description": "Selector specifying which fields to include in a partial response.",
"schema": {
"type": "string"
}
},
{
"name": "uploadType",
"in": "query",
"description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").",
"schema": {
"type": "string"
}
},
{
"name": "$.xgafv",
"in": "query",
"description": "V1 error format.",
"schema": {
"type": "string",
"enum": [
"1",
"2"
]
}
},
{
"name": "oauth_token",
"in": "query",
"description": "OAuth 2.0 token for the current user.",
"schema": {
"type": "string"
}
},
{
"name": "callback",
"in": "query",
"description": "JSONP",
"schema": {
"type": "string"
}
},
{
"name": "alt",
"in": "query",
"description": "Data format for response.",
"schema": {
"type": "string",
"default": "json",
"enum": [
"json",
"media",
"proto"
]
}
},
{
"name": "service",
"in": "path",
"description": "The Takeout service, from jcg/dataliberation/common/model/Service.java.",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "exportId",
"in": "path",
"description": "The ID of the export to cancel.",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Successful response",
"content": {
"*/*": {
"schema": {
"$ref": "#/components/schemas/CancelExportResponse"
}
}
}
}
},
"security": [
{
"Oauth2": [
"https://www.googleapis.com/auth/drive.readonly"
]
}
]
}
}
},
"components": {
"schemas": {
"ErrorProto": {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "Location of the error, as specified by the location type.\n\nIf location_type is PATH, this should be a path to a field that's\nrelative to the request, using FieldPath notation\n(net/proto2/util/public/field_path.h).\n\nExamples:\n authenticated_user.gaia_id\n resource.address[2].country"
},
"debugInfo": {
"type": "string",
"description": "Debugging information, which should not be\nshared externally."
},
"code": {
"type": "string",
"description": "Error code in the error domain. This should correspond to\na value of the enum type whose name is in domain. See\nthe core error domain in error_domain.proto."
},
"locationType": {
"type": "string",
"enum": [
"PATH",
"OTHER",
"PARAMETER"
]
},
"argument": {
"type": "array",
"description": "Error arguments, to be used when building user-friendly error messages\ngiven the error domain and code. Different error codes require different\narguments.",
"items": {
"type": "string"
}
},
"externalErrorMessage": {
"type": "string",
"description": "A short explanation for the error, which can be shared outside Google.\n\nPlease set domain, code and arguments whenever possible instead of this\nerror message so that external APIs can build safe error messages\nthemselves.\n\nExternal messages built in a RoSy interface will most likely refer to\ninformation and concepts that are not available externally and should not\nbe exposed. It is safer if external APIs can understand the errors and\ndecide what the error message should look like."
},
"domain": {
"type": "string",
"description": "Error domain. RoSy services can define their own\ndomain and error codes. This should normally be\nthe name of an enum type, such as: gdata.CoreErrorDomain"
}
},
"description": "Describes one specific error."
},
"Errors": {
"type": "object",
"properties": {
"error": {
"type": "array",
"description": "Specific error description and codes",
"items": {
"$ref": "#/components/schemas/ErrorProto"
}
},
"code": {
"type": "string",
"description": "Global error code. Deprecated and ignored.\nSet custom error codes in ErrorProto.domain and ErrorProto.code\ninstead.",
"enum": [
"BAD_REQUEST",
"FORBIDDEN",
"NOT_FOUND",
"CONFLICT",
"GONE",
"PRECONDITION_FAILED",
"INTERNAL_ERROR",
"SERVICE_UNAVAILABLE"
]
},
"requestId": {
"type": "string",
"description": "Request identifier generated by the service, which can be\nused to identify the error in the logs"
}
},
"description": "Request Error information.\n\nThe presence of an error field signals that the operation\nhas failed."
},
"ExportJob": {
"type": "object",
"properties": {
"failedItemInfos": {
"type": "array",
"description": "The set of items that couldn't be included in the archive.\nIf a directory was specified in ExportRequest.items and items in that\ndirectory failed, each individual file that failed will have an entry in\nfailed_item_infos.",
"items": {
"$ref": "#/components/schemas/FailedItemInfo"
}
},
"status": {
"type": "string",
"description": "The current status of this export job.",
"enum": [
"UNKNOWN",
"QUEUED",
"COUNTING",
"BUILDING",
"SUCCEEDED",
"FAILED"
]
},
"failedItems": {
"type": "array",
"description": "Use failed_item_info instead.",
"items": {
"type": "string"
}
},
"debugFailureInfo": {
"type": "string",
"description": "Detailed information about what failed in the case status = FAILED.\nThis information is for internal debugging only and should not be shared\nwith user."
},
"archives": {
"type": "array",
"description": "A set of records that contain information about the completed archives\ncreated by this job. This will only be present if status = SUCCEEDED.",
"items": {
"$ref": "#/components/schemas/Archive"
}
},
"items": {
"type": "array",
"description": "The items being exported. If a directory is present all\nitems under that directory will be included.",
"items": {
"$ref": "#/components/schemas/TakeoutItem"
}
},
"id": {
"type": "string",
"description": "The ID of this job. Can be used to get or cancel this job."
}
},
"description": "The representation of an export job. Used for creating new jobs\nand reporting the state of existing jobs."
},
"ExportRequest": {
"type": "object",
"properties": {
"locale": {
"type": "string",
"description": "Allows the client to specify a locale for the request.\nThe format of the string is an IETF\nlanguage tag, such as \"en-US\", as defined in\nBCP 47 (http://tools.ietf.org/html/bcp47). More practically, the content\nof the string should be one that is appropriate for creating a java\nLocale object. Defaults to \"en-US\" if not specified."
},
"items": {
"type": "array",
"description": "The requested items to export. If a directory is specified, all\nitems under that directory will be exported, but only top-level\nitems are captured in this field.",
"items": {
"$ref": "#/components/schemas/TakeoutItem"
}
},
"initiatingClientService": {
"type": "string",
"enum": [
"UNKNOWN_SERVICE",
"ACCOUNT_CENTRAL",
"LIS",
"DASHER",
"PATRONUS",
"PROBATE",
"DRIVE_SERVICE",
"TAKEDOWN",
"DASHER_SUPPLEMENTAL",
"LRTOOL_SOCIAL_RETENTION",
"ACCOUNT_MIGRATION_UI",
"NEST_SERVICE",
"ACCOUNT_CENTRAL_SCHEDULED",
"TRANSFER",
"PHOTOS_DOWNLOAD_SERVICE",
"TAKEOUT_INTERNAL"
]
},
"archivePrefix": {
"type": "string",
"description": "Optional prefix for the archive filename. Will be followed by a '-'\n& an ISO standard timestamp in yyyyMMdd'T'HHmmssZ format. Prefix\ndefaults to \"takeout\" if none specified, resulting in an archive\nname like \"takeout-20150924T221439Z.zip\"."
},
"service": {
"type": "string",
"description": "The Takeout service, from jcg/dataliberation/common/model/Service.java."
}
},
"description": "A request to create a new export."
},
"CreateExportResponse": {
"type": "object",
"properties": {
"exportJob": {
"$ref": "#/components/schemas/ExportJob"
},
"errors": {
"$ref": "#/components/schemas/Errors"
}
},
"description": "The result of a request to create a new export."
},
"FailedItemInfo": {
"type": "object",
"properties": {
"title": {
"type": "string",
"description": "The user visible title of the item that failed, empty if the failure was\ndue to permissions."
},
"cause": {
"type": "string",
"description": "The cause of the failure, if known.",
"enum": [
"UNKNOWN",
"GENERIC",
"ITEM_NOT_FOUND",
"DOWNLOAD_PROHIBITED",
"CONTAINS_VIRUS"
]
},
"relativePath": {
"type": "string",
"description": "The path to the failed item from one of the root items specified when\nstarting the export. The path includes the file name.\nIf this item is reachable via multiple paths (e.g. the individual item\nwas selected as well as the parent folder or the item is multi-included\nin several folders) it is undefined (and non-deterministic) which root\nnode this path will be relative to."
},
"docId": {
"type": "string",
"description": "The document ID of the item that failed."
},
"mediaType": {
"type": "string",
"description": "The mime type of the file."
}
},
"description": "Info about a failed item (file or folder) in an export."
},
"Archive": {
"type": "object",
"properties": {
"storagePath": {
"type": "string",
"description": "The downloadable url of the completed archive."
},
"compressedSize": {
"type": "string",
"description": "The size, in bytes, of the compressed archive.",
"format": "uint64"
},
"fileName": {
"type": "string",
"description": "The full name of the archive file, including extension (but not\nincluding path)."
},
"sizeOfContents": {
"type": "string",
"description": "The size, in bytes, of all the items in the archive.",
"format": "uint64"
}
},
"description": "A completed archive file (e.g. zip or tgz)."
},
"GetExportResponse": {
"type": "object",
"properties": {
"exportJob": {
"$ref": "#/components/schemas/ExportJob"
},
"percentDone": {
"type": "integer",
"description": "Percent done (# completed files) / (# total files).\nIncluded for BUILDING exports only.",
"format": "int32"
},
"numFetchedFiles": {
"type": "integer",
"description": "Total number of fetched files. Set for completed exports only.\nIf a folder containing 2 files was downloaded, num_fetched_files = 2.",
"format": "int32"
},
"errors": {
"$ref": "#/components/schemas/Errors"
}
},
"description": "Details about a given export."
},
"TakeoutItem": {
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "The ID of the item, must line up with the id that that service's\nTakeout integration produces."
}
},
"description": "Represents an item (file/folder/album) in the product."
},
"CancelExportResponse": {
"type": "object",
"properties": {
"errors": {
"$ref": "#/components/schemas/Errors"
},
"succeeded": {
"type": "boolean",
"description": "Whether the export was successfully cancelled"
}
},
"description": "The result of a request to cancel a given export."
}
},
"parameters": {
"key": {
"name": "key",
"in": "query",
"description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.",
"schema": {
"type": "string"
}
},
"access_token": {
"name": "access_token",
"in": "query",
"description": "OAuth access token.",
"schema": {
"type": "string"
}
},
"upload_protocol": {
"name": "upload_protocol",
"in": "query",
"description": "Upload protocol for media (e.g. \"raw\", \"multipart\").",
"schema": {
"type": "string"
}
},
"prettyPrint": {
"name": "prettyPrint",
"in": "query",
"description": "Returns response with indentations and line breaks.",
"schema": {
"type": "boolean",
"default": true
}
},
"quotaUser": {
"name": "quotaUser",
"in": "query",
"description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.",
"schema": {
"type": "string"
}
},
"fields": {
"name": "fields",
"in": "query",
"description": "Selector specifying which fields to include in a partial response.",
"schema": {
"type": "string"
}
},
"uploadType": {
"name": "uploadType",
"in": "query",
"description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").",
"schema": {
"type": "string"
}
},
"$.xgafv": {
"name": "$.xgafv",
"in": "query",
"description": "V1 error format.",
"schema": {
"type": "string",
"enum": [
"1",
"2"
]
}
},
"oauth_token": {
"name": "oauth_token",
"in": "query",
"description": "OAuth 2.0 token for the current user.",
"schema": {
"type": "string"
}
},
"callback": {
"name": "callback",
"in": "query",
"description": "JSONP",
"schema": {
"type": "string"
}
},
"alt": {
"name": "alt",
"in": "query",
"description": "Data format for response.",
"schema": {
"type": "string",
"default": "json",
"enum": [
"json",
"media",
"proto"
]
}
}
},
"securitySchemes": {
"Oauth2": {
"type": "oauth2",
"description": "Oauth 2.0 authentication",
"flows": {
"implicit": {
"authorizationUrl": "https://accounts.google.com/o/oauth2/auth",
"scopes": {
"https://www.googleapis.com/auth/drive.readonly": "See and download all your Google Drive files"
}
}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment