{"openapi":"3.1.0","info":{"title":"Google Photos Picker API","version":"v1","description":"View photos you select from your Google Photos library. "},"servers":[{"url":"https://www.googleapis.com/"}],"paths":{"/v1/sessions/{sessionId}":{"get":{"operationId":"photospicker.sessions.get","x-executor-toolPath":"photospicker.sessions.get","x-executor-pathTemplate":"/v1/sessions/{+sessionId}","tags":["Google Photos Picker API"],"description":"Retrieves information about the specified session. If the specified session does not exist or is not owned by the user, a `NOT_FOUND` error is returned. If the session exists but access to the session has expired, a `PERMISSION_DENIED` error is returned.","servers":[{"url":"https://photospicker.googleapis.com/"}],"parameters":[{"name":"upload_protocol","in":"query","required":false,"description":"Upload protocol for media (e.g. \"raw\", \"multipart\").","schema":{"description":"Upload protocol for media (e.g. \"raw\", \"multipart\").","type":"string"},"style":"form","explode":false},{"name":"quotaUser","in":"query","required":false,"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":{"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.","type":"string"},"style":"form","explode":false},{"name":"alt","in":"query","required":false,"description":"Data format for response.","schema":{"description":"Data format for response.","default":"json","enum":["json","media","proto"],"type":"string"},"style":"form","explode":false},{"name":"callback","in":"query","required":false,"description":"JSONP","schema":{"description":"JSONP","type":"string"},"style":"form","explode":false},{"name":"$.xgafv","in":"query","required":false,"description":"V1 error format.","schema":{"description":"V1 error format.","enum":["1","2"],"type":"string"},"style":"form","explode":false},{"name":"fields","in":"query","required":false,"description":"Selector specifying which fields to include in a partial response.","schema":{"description":"Selector specifying which fields to include in a partial response.","type":"string"},"style":"form","explode":false},{"name":"prettyPrint","in":"query","required":false,"description":"Returns response with indentations and line breaks.","schema":{"description":"Returns response with indentations and line breaks.","default":"true","type":"boolean"},"style":"form","explode":false},{"name":"uploadType","in":"query","required":false,"description":"Legacy upload protocol for media (e.g. \"media\", \"multipart\").","schema":{"description":"Legacy upload protocol for media (e.g. \"media\", \"multipart\").","type":"string"},"style":"form","explode":false},{"name":"sessionId","in":"path","required":true,"description":"Required. The Google-generated identifier for this session.","schema":{"description":"Required. The Google-generated identifier for this session.","type":"string"},"allowReserved":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/photospicker_v1_PickingSession"}}}}},"security":[{"googleOAuth2":["https://www.googleapis.com/auth/photospicker.mediaitems.readonly"]}],"x-google-scopes":["https://www.googleapis.com/auth/photospicker.mediaitems.readonly"]},"delete":{"operationId":"photospicker.sessions.delete","x-executor-toolPath":"photospicker.sessions.delete","x-executor-pathTemplate":"/v1/sessions/{+sessionId}","tags":["Google Photos Picker API"],"description":"Deletes the specified session. A `NOT_FOUND` error is returned if the session does not exist or is not owned by the user. An empty response indicates successful deletion.","servers":[{"url":"https://photospicker.googleapis.com/"}],"parameters":[{"name":"upload_protocol","in":"query","required":false,"description":"Upload protocol for media (e.g. \"raw\", \"multipart\").","schema":{"description":"Upload protocol for media (e.g. \"raw\", \"multipart\").","type":"string"},"style":"form","explode":false},{"name":"quotaUser","in":"query","required":false,"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":{"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.","type":"string"},"style":"form","explode":false},{"name":"alt","in":"query","required":false,"description":"Data format for response.","schema":{"description":"Data format for response.","default":"json","enum":["json","media","proto"],"type":"string"},"style":"form","explode":false},{"name":"callback","in":"query","required":false,"description":"JSONP","schema":{"description":"JSONP","type":"string"},"style":"form","explode":false},{"name":"$.xgafv","in":"query","required":false,"description":"V1 error format.","schema":{"description":"V1 error format.","enum":["1","2"],"type":"string"},"style":"form","explode":false},{"name":"fields","in":"query","required":false,"description":"Selector specifying which fields to include in a partial response.","schema":{"description":"Selector specifying which fields to include in a partial response.","type":"string"},"style":"form","explode":false},{"name":"prettyPrint","in":"query","required":false,"description":"Returns response with indentations and line breaks.","schema":{"description":"Returns response with indentations and line breaks.","default":"true","type":"boolean"},"style":"form","explode":false},{"name":"uploadType","in":"query","required":false,"description":"Legacy upload protocol for media (e.g. \"media\", \"multipart\").","schema":{"description":"Legacy upload protocol for media (e.g. \"media\", \"multipart\").","type":"string"},"style":"form","explode":false},{"name":"sessionId","in":"path","required":true,"description":"Required. The Google-generated identifier for the session to delete.","schema":{"description":"Required. The Google-generated identifier for the session to delete.","type":"string"},"allowReserved":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/photospicker_v1_Empty"}}}}},"security":[{"googleOAuth2":["https://www.googleapis.com/auth/photospicker.mediaitems.readonly"]}],"x-google-scopes":["https://www.googleapis.com/auth/photospicker.mediaitems.readonly"]}},"/v1/sessions":{"post":{"operationId":"photospicker.sessions.create","x-executor-toolPath":"photospicker.sessions.create","x-executor-pathTemplate":"/v1/sessions","tags":["Google Photos Picker API"],"description":"Generates a new session during which the user can pick photos and videos for third-party access. If the user doesn't have an active Google Photos account, a `FAILED_PRECONDITION` error is returned. If the client application creates too many sessions per user, a `RESOURCE_EXHAUSTED` error is returned. Clients are unlikely to reach these limits under normal circumstances. However, clients are still recommended to call `sessions.delete` after each session, to proactively stay within resource limits. Once [a user taps the **Done**](https://developers.google.com/photos/picker/guides/picking-experience#done_screen) button to complete a picking session, the `pickerUri` will no longer work. Create a new session to allow the user to pick more photos.","servers":[{"url":"https://photospicker.googleapis.com/"}],"parameters":[{"name":"upload_protocol","in":"query","required":false,"description":"Upload protocol for media (e.g. \"raw\", \"multipart\").","schema":{"description":"Upload protocol for media (e.g. \"raw\", \"multipart\").","type":"string"},"style":"form","explode":false},{"name":"quotaUser","in":"query","required":false,"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":{"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.","type":"string"},"style":"form","explode":false},{"name":"alt","in":"query","required":false,"description":"Data format for response.","schema":{"description":"Data format for response.","default":"json","enum":["json","media","proto"],"type":"string"},"style":"form","explode":false},{"name":"callback","in":"query","required":false,"description":"JSONP","schema":{"description":"JSONP","type":"string"},"style":"form","explode":false},{"name":"$.xgafv","in":"query","required":false,"description":"V1 error format.","schema":{"description":"V1 error format.","enum":["1","2"],"type":"string"},"style":"form","explode":false},{"name":"fields","in":"query","required":false,"description":"Selector specifying which fields to include in a partial response.","schema":{"description":"Selector specifying which fields to include in a partial response.","type":"string"},"style":"form","explode":false},{"name":"prettyPrint","in":"query","required":false,"description":"Returns response with indentations and line breaks.","schema":{"description":"Returns response with indentations and line breaks.","default":"true","type":"boolean"},"style":"form","explode":false},{"name":"uploadType","in":"query","required":false,"description":"Legacy upload protocol for media (e.g. \"media\", \"multipart\").","schema":{"description":"Legacy upload protocol for media (e.g. \"media\", \"multipart\").","type":"string"},"style":"form","explode":false},{"name":"requestId","in":"query","required":false,"description":"Optional. A client-provided unique identifier for this request. This ID is used to enable the streamlined picking experience for applications using the OAuth 2.0 flow for limited-input devices. This ID must have the format of a UUID (version 4) string and follow these requirements: - Must not contain any sensitive identifying information about the user. - Must contain 32 hexadecimal characters divided into five groups separated by hyphens, in the format \"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\" (or 8-4-4-4-12).","schema":{"description":"Optional. A client-provided unique identifier for this request. This ID is used to enable the streamlined picking experience for applications using the OAuth 2.0 flow for limited-input devices. This ID must have the format of a UUID (version 4) string and follow these requirements: - Must not contain any sensitive identifying information about the user. - Must contain 32 hexadecimal characters divided into five groups separated by hyphens, in the format \"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\" (or 8-4-4-4-12).","type":"string"},"style":"form","explode":false}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/photospicker_v1_PickingSession"}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/photospicker_v1_PickingSession"}}}}},"security":[{"googleOAuth2":["https://www.googleapis.com/auth/photospicker.mediaitems.readonly"]}],"x-google-scopes":["https://www.googleapis.com/auth/photospicker.mediaitems.readonly"]}},"/v1/mediaItems":{"get":{"operationId":"photospicker.mediaItems.list","x-executor-toolPath":"photospicker.mediaItems.list","x-executor-pathTemplate":"/v1/mediaItems","tags":["Google Photos Picker API"],"description":"Returns a list of media items picked by the user during the specified session. A `FAILED_PRECONDITION` error is returned if the user has not yet finished picking media items for the specified session. In this scenario, your application should poll `sessions.get` until the session is ready before retrying this method.","servers":[{"url":"https://photospicker.googleapis.com/"}],"parameters":[{"name":"upload_protocol","in":"query","required":false,"description":"Upload protocol for media (e.g. \"raw\", \"multipart\").","schema":{"description":"Upload protocol for media (e.g. \"raw\", \"multipart\").","type":"string"},"style":"form","explode":false},{"name":"quotaUser","in":"query","required":false,"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":{"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.","type":"string"},"style":"form","explode":false},{"name":"alt","in":"query","required":false,"description":"Data format for response.","schema":{"description":"Data format for response.","default":"json","enum":["json","media","proto"],"type":"string"},"style":"form","explode":false},{"name":"callback","in":"query","required":false,"description":"JSONP","schema":{"description":"JSONP","type":"string"},"style":"form","explode":false},{"name":"$.xgafv","in":"query","required":false,"description":"V1 error format.","schema":{"description":"V1 error format.","enum":["1","2"],"type":"string"},"style":"form","explode":false},{"name":"fields","in":"query","required":false,"description":"Selector specifying which fields to include in a partial response.","schema":{"description":"Selector specifying which fields to include in a partial response.","type":"string"},"style":"form","explode":false},{"name":"prettyPrint","in":"query","required":false,"description":"Returns response with indentations and line breaks.","schema":{"description":"Returns response with indentations and line breaks.","default":"true","type":"boolean"},"style":"form","explode":false},{"name":"uploadType","in":"query","required":false,"description":"Legacy upload protocol for media (e.g. \"media\", \"multipart\").","schema":{"description":"Legacy upload protocol for media (e.g. \"media\", \"multipart\").","type":"string"},"style":"form","explode":false},{"name":"pageSize","in":"query","required":false,"description":"Optional. The maximum number of media items to return. The service may return fewer than this value (including zero results). If unspecified or set to 0, at most 50 media items is returned. The maximum value is 100; values above 100 will be coerced to 100. Negative values will result in an `INVALID_ARGUMENT` error.","schema":{"description":"Optional. The maximum number of media items to return. The service may return fewer than this value (including zero results). If unspecified or set to 0, at most 50 media items is returned. The maximum value is 100; values above 100 will be coerced to 100. Negative values will result in an `INVALID_ARGUMENT` error.","format":"int32","type":"integer"},"style":"form","explode":false},{"name":"sessionId","in":"query","required":true,"description":"Required. The Google-generated identifier for this session.","schema":{"description":"Required. The Google-generated identifier for this session.","type":"string"},"style":"form","explode":false},{"name":"pageToken","in":"query","required":false,"description":"Optional. A page token, received from a previous `mediaItems.list` call. Provide this to retrieve the subsequent page.","schema":{"description":"Optional. A page token, received from a previous `mediaItems.list` call. Provide this to retrieve the subsequent page.","type":"string"},"style":"form","explode":false}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/photospicker_v1_ListMediaItemsResponse"}}}}},"security":[{"googleOAuth2":["https://www.googleapis.com/auth/photospicker.mediaitems.readonly"]}],"x-google-scopes":["https://www.googleapis.com/auth/photospicker.mediaitems.readonly"]}}},"components":{"schemas":{"photospicker_v1_PollingConfig":{"description":"Configuration for polling the API.","type":"object","properties":{"pollInterval":{"description":"Output only. Recommended time between poll requests.","format":"google-duration","readOnly":true,"type":"string"},"timeoutIn":{"description":"Output only. The length of time after which the client should stop polling. A value of 0 indicates that the client should stop polling if it hasn't already.","format":"google-duration","readOnly":true,"type":"string"}}},"photospicker_v1_PickingConfig":{"description":"Client-specified configuration for the user's picking experience during this session.","type":"object","properties":{"maxItemCount":{"description":"Optional. The maximum number of items that the user can pick during this session. Defaults to 2000 if not specified. If unspecified or set to 0, at most 2000 items can be picked. Values above 2000 will be coerced to 2000. Negative values will result in an `INVALID_ARGUMENT` error.","format":"int64","type":"string"}}},"photospicker_v1_ListMediaItemsResponse":{"description":"Response to the `mediaItems.list` method.","type":"object","properties":{"nextPageToken":{"description":"If set, this field can be used as the `pageToken` in a subsequent `mediaItems.list` call to retrieve the next page of picked media items. If this field is omitted, there are no subsequent pages.","type":"string"},"mediaItems":{"description":"A page of picked media items.","type":"array","items":{"$ref":"#/components/schemas/photospicker_v1_PickedMediaItem"}}}},"photospicker_v1_VideoMetadata":{"description":"Metadata that is specific to a video. For example, fps.","type":"object","properties":{"processingStatus":{"description":"Processing status of the video.","enum":["UNSPECIFIED","PROCESSING","READY","FAILED"],"type":"string"},"fps":{"description":"Frame rate of the video.","format":"double","type":"number"}}},"photospicker_v1_MediaFileMetadata":{"description":"Metadata about a media file.","type":"object","properties":{"photoMetadata":{"$ref":"#/components/schemas/photospicker_v1_PhotoMetadata"},"height":{"description":"Original height (in pixels) of the media file.","format":"int32","type":"integer"},"width":{"description":"Original width (in pixels) of the media file.","format":"int32","type":"integer"},"videoMetadata":{"$ref":"#/components/schemas/photospicker_v1_VideoMetadata"},"cameraMake":{"description":"Brand of the camera with which the media was captured.","type":"string"},"cameraModel":{"description":"Model of the camera with which the media was captured.","type":"string"}}},"photospicker_v1_PickedMediaItem":{"description":"Representation of a photo or video that was picked by the user.","type":"object","properties":{"createTime":{"description":"Time when the media item was created (not when it was uploaded to Google Photos).","format":"google-datetime","type":"string"},"type":{"description":"The type of this media item.","enum":["TYPE_UNSPECIFIED","PHOTO","VIDEO"],"type":"string"},"id":{"description":"Identifier for the media item. This is a persistent identifier that can be used between sessions to identify this media item.","type":"string"},"mediaFile":{"$ref":"#/components/schemas/photospicker_v1_MediaFile"}}},"photospicker_v1_PhotoMetadata":{"description":"Metadata that is specific to a photo, such as, ISO, focal length, and exposure time. Some of these fields may not be set.","type":"object","properties":{"apertureFNumber":{"description":"Aperture f number of the camera lens with which the photo was taken.","format":"float","type":"number"},"exposureTime":{"description":"Exposure time of the camera aperture when the photo was taken.","format":"google-duration","type":"string"},"isoEquivalent":{"description":"ISO of the camera with which the photo was taken.","format":"int32","type":"integer"},"focalLength":{"description":"Focal length of the camera lens with which the photo was taken.","format":"float","type":"number"}}},"photospicker_v1_MediaFile":{"description":"Representation of a media file.","type":"object","properties":{"baseUrl":{"description":"A URL to fetch the media file's bytes. To download a media file, the API client must add the parameters specified in the developer documentation to this URL. For example, `'=w2048-h1024'` will set the dimensions of a media item of type photo to have a width of 2048 px and height of 1024 px.","type":"string"},"filename":{"description":"Filename of the media file.","type":"string"},"mediaFileMetadata":{"$ref":"#/components/schemas/photospicker_v1_MediaFileMetadata"},"mimeType":{"description":"MIME type of the media file. For example, `image/jpeg`.","type":"string"}}},"photospicker_v1_PickingSession":{"description":"Representation of a user session during which the user can pick photos and videos using Google Photos.","type":"object","properties":{"id":{"description":"Output only. The Google-generated identifier for this session.","readOnly":true,"type":"string"},"pickingConfig":{"$ref":"#/components/schemas/photospicker_v1_PickingConfig"},"mediaItemsSet":{"description":"Output only. If set to `true`, media items have been picked for this session and your application can request the list of picked media items via `mediaItems.list`.","readOnly":true,"type":"boolean"},"pollingConfig":{"$ref":"#/components/schemas/photospicker_v1_PollingConfig"},"expireTime":{"description":"Output only. Time when access to this session (and its picked media items) will expire.","format":"google-datetime","readOnly":true,"type":"string"},"pickerUri":{"description":"Output only. The URI used to redirect the user to Google Photos (on web) so they can pick photos and videos for the current session. To view this page successfully, the user must be logged into the Google account that owns this session in their web browser. The `pickerUri` cannot be opened in an iframe due to security reasons. For web-based applications, you can append `/autoclose` to this URI. The Google Photos window or tab will then close automatically after the user has finished picking, instead of displaying a \"Done\" screen.","readOnly":true,"type":"string"}}},"photospicker_v1_Empty":{"description":"A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }","type":"object"}},"securitySchemes":{"googleOAuth2":{"type":"oauth2","flows":{"authorizationCode":{"authorizationUrl":"https://accounts.google.com/o/oauth2/v2/auth","tokenUrl":"https://oauth2.googleapis.com/token","scopes":{"openid":"","email":"","profile":"","https://www.googleapis.com/auth/photospicker.mediaitems.readonly":""}}}}}},"security":[{"googleOAuth2":["openid","email","profile","https://www.googleapis.com/auth/photospicker.mediaitems.readonly"]}],"x-executor-origin":{"kind":"googleDiscoveryBundle","services":[{"discoveryUrl":"https://photospicker.googleapis.com/$discovery/rest?version=v1","service":"photospicker","version":"v1"}]}}