ByteChef LogoByteChef

Google Photos

Google Photos is a photo sharing and storage service.

Categories: File Storage

Type: googlePhotos/v1


Connections

Version: 1

OAuth2 Authorization Code

Properties

NameLabelTypeDescriptionRequired
clientIdClient IdSTRINGtrue
clientSecretClient SecretSTRINGtrue

Connection Setup

Create OAuth 2.0 Application

Creation of OAuth 2.0 application is documented here.

Enable Google Photos API

  1. In the Google Cloud Console, select your project.
  2. Go to the APIs & Services.
  3. Click on ENABLE APIS AND SERVICES.
  4. Search for "google photos library api" in the search bar.
  5. Click on Google Photos Library API.
  6. Click Enable.

Actions

Create Album

Name: createAlbum

Creates an album in a user's Google Photos library.

Properties

NameLabelTypeDescriptionRequired
titleTitleSTRINGName of the album.true

Example JSON Structure

{
  "label" : "Create Album",
  "name" : "createAlbum",
  "parameters" : {
    "title" : ""
  },
  "type" : "googlePhotos/v1/createAlbum"
}

Output

Type: OBJECT

Properties

NameTypeDescription
idSTRINGIdentifier for the album.
titleSTRINGName of the album.
productUrlSTRINGGoogle Photos URL for the album.
isWriteableBOOLEAN
Options true, false
True if you can create media items in this album.
shareInfoOBJECT
Properties {{BOOLEAN(isCollaborative), BOOLEAN(isCommentable)}(sharedAlbumOptions), STRING(shareableUrl), STRING(shareToken), BOOLEAN(isJoined), BOOLEAN(isOwned), BOOLEAN(isJoinable)}
mediaItemsCountSTRINGThe number of media items in the album.
coverPhotoBaseUrlSTRINGA URL to the cover photo's bytes.
coverPhotoMediaItemIdSTRINGIdentifier for the media item associated with the cover photo.

Output Example

{
  "id" : "",
  "title" : "",
  "productUrl" : "",
  "isWriteable" : false,
  "shareInfo" : {
    "sharedAlbumOptions" : {
      "isCollaborative" : false,
      "isCommentable" : false
    },
    "shareableUrl" : "",
    "shareToken" : "",
    "isJoined" : false,
    "isOwned" : false,
    "isJoinable" : false
  },
  "mediaItemsCount" : "",
  "coverPhotoBaseUrl" : "",
  "coverPhotoMediaItemId" : ""
}

Get Album

Name: getAlbum

Returns the app created album based on the specified albumId. The albumId must be the ID of an album created by your app.

Properties

NameLabelTypeDescriptionRequired
albumIdAlbum IDSTRINGIdentifier of the album to be requested. Only albums created by your app will be listed.true

Example JSON Structure

{
  "label" : "Get Album",
  "name" : "getAlbum",
  "parameters" : {
    "albumId" : ""
  },
  "type" : "googlePhotos/v1/getAlbum"
}

Output

Type: OBJECT

Properties

NameTypeDescription
idSTRINGIdentifier for the album.
titleSTRINGName of the album.
productUrlSTRINGGoogle Photos URL for the album.
isWriteableBOOLEAN
Options true, false
True if you can create media items in this album.
shareInfoOBJECT
Properties {{BOOLEAN(isCollaborative), BOOLEAN(isCommentable)}(sharedAlbumOptions), STRING(shareableUrl), STRING(shareToken), BOOLEAN(isJoined), BOOLEAN(isOwned), BOOLEAN(isJoinable)}
mediaItemsCountSTRINGThe number of media items in the album.
coverPhotoBaseUrlSTRINGA URL to the cover photo's bytes.
coverPhotoMediaItemIdSTRINGIdentifier for the media item associated with the cover photo.

Output Example

{
  "id" : "",
  "title" : "",
  "productUrl" : "",
  "isWriteable" : false,
  "shareInfo" : {
    "sharedAlbumOptions" : {
      "isCollaborative" : false,
      "isCommentable" : false
    },
    "shareableUrl" : "",
    "shareToken" : "",
    "isJoined" : false,
    "isOwned" : false,
    "isJoinable" : false
  },
  "mediaItemsCount" : "",
  "coverPhotoBaseUrl" : "",
  "coverPhotoMediaItemId" : ""
}

Find Album ID

To find the Album ID, click here

Upload Media

Name: uploadMedia

Upload media to an album in a user's Google Photos library.

Properties

NameLabelTypeDescriptionRequired
albumIdAlbum IDSTRINGIdentifier of the album to be requested. Only albums created by your app will be listed.true
mediaMediaARRAY
Items [{FILE_ENTRY(fileEntry), STRING(fileName)}]
Media files to upload to album. Photos and videos are supported.true

Example JSON Structure

{
  "label" : "Upload Media",
  "name" : "uploadMedia",
  "parameters" : {
    "albumId" : "",
    "media" : [ {
      "fileEntry" : {
        "extension" : "",
        "mimeType" : "",
        "name" : "",
        "url" : ""
      },
      "fileName" : ""
    } ]
  },
  "type" : "googlePhotos/v1/uploadMedia"
}

Output

Type: OBJECT

Properties

NameTypeDescription
newMediaItemResultsARRAY
Items [{STRING(uploadToken), {INTEGER(code), STRING(message), [{}](details)}(status), {STRING(id), STRING(description), STRING(productUrl), STRING(baseUrl), STRING(mimeType), {STRING(creationTime), STRING(width), STRING(height), {STRING(cameraMake), STRING(cameraModel), NUMBER(focalLength), NUMBER(apertureFNumber), INTEGER(isoEquivalent), STRING(exposureTime)}(photo), {STRING(cameraMake), STRING(cameraModel), NUMBER(fps), STRING(status)}(video)}(mediaMetadata), {STRING(profilePictureBaseUrl), STRING(displayName)}(contributorInfo), STRING(filename)}(mediaItem)}]

Output Example

{
  "newMediaItemResults" : [ {
    "uploadToken" : "",
    "status" : {
      "code" : 1,
      "message" : "",
      "details" : [ { } ]
    },
    "mediaItem" : {
      "id" : "",
      "description" : "",
      "productUrl" : "",
      "baseUrl" : "",
      "mimeType" : "",
      "mediaMetadata" : {
        "creationTime" : "",
        "width" : "",
        "height" : "",
        "photo" : {
          "cameraMake" : "",
          "cameraModel" : "",
          "focalLength" : 0.0,
          "apertureFNumber" : 0.0,
          "isoEquivalent" : 1,
          "exposureTime" : ""
        },
        "video" : {
          "cameraMake" : "",
          "cameraModel" : "",
          "fps" : 0.0,
          "status" : ""
        }
      },
      "contributorInfo" : {
        "profilePictureBaseUrl" : "",
        "displayName" : ""
      },
      "filename" : ""
    }
  } ]
}

Find Album ID

To find the Album ID, click here

What to do if your action is not listed here?

If this component doesn't have the action you need, you can use Custom Action to create your own. Custom Actions empower you to define HTTP requests tailored to your specific requirements, allowing for greater flexibility in integrating with external services or APIs.

To create a Custom Action, simply specify the desired HTTP method, path, and any necessary parameters. This way, you can extend the functionality of your component beyond the predefined actions, ensuring that you can meet all your integration needs effectively.


Additional Instructions

How to find Album ID

Your application can only access Album IDs for albums that were created by your app.

To retrieve these Album IDs, use the Google Photos Library API albums.list method. Its endpoint is GET https://photoslibrary.googleapis.com/v1/albums.

Troubleshooting

Access Blocked: Verification Process Not Completed

Documentation for how to add a test user can be found here

How is this guide?

Last updated on

On this page