← Grain + Google Photos integrations

Upload Item with Google Photos API on New Highlight (Instant) from Grain API

Pipedream makes it easy to connect APIs for Google Photos, Grain and 2,700+ other apps remarkably fast.

Trigger workflow on
New Highlight (Instant) from the Grain API
Next, do this
Upload Item with the Google Photos API
No credit card required
Intro to Pipedream
Watch us build a workflow
Watch us build a workflow
8 min
Watch now ➜

Trusted by 1,000,000+ developers from startups to Fortune 500 companies

Adyen logo
Appcues logo
Bandwidth logo
Checkr logo
ChartMogul logo
Dataminr logo
Gopuff logo
Gorgias logo
LinkedIn logo
Logitech logo
Replicated logo
Rudderstack logo
SAS logo
Scale AI logo
Webflow logo
Warner Bros. logo
Adyen logo
Appcues logo
Bandwidth logo
Checkr logo
ChartMogul logo
Dataminr logo
Gopuff logo
Gorgias logo
LinkedIn logo
Logitech logo
Replicated logo
Rudderstack logo
SAS logo
Scale AI logo
Webflow logo
Warner Bros. logo

Developers Pipedream

Getting Started

This integration creates a workflow with a Grain trigger and Google Photos action. When you configure and deploy the workflow, it will run on Pipedream's servers 24x7 for free.

  1. Select this integration
  2. Configure the New Highlight (Instant) trigger
    1. Connect your Grain account
    2. Select a View ID
  3. Configure the Upload Item action
    1. Connect your Google Photos account
    2. Configure File Path or URL
    3. Optional- Configure Description
    4. Optional- Select a Album ID
    5. Optional- Configure syncDir
  4. Deploy the workflow
  5. Send a test event to validate your setup
  6. Turn on the trigger

Details

This integration uses pre-built, source-available components from Pipedream's GitHub repo. These components are developed by Pipedream and the community, and verified and maintained by Pipedream.

To contribute an update to an existing component or create a new component, create a PR on GitHub. If you're new to Pipedream component development, you can start with quickstarts for trigger span and action development, and then review the component API reference.

Trigger

Description:Emit new event when a highlight that matches the filter is added.
Version:0.0.1
Key:grain-new-highlight-instant

Trigger Code

import common from "../common/base.mjs";
import sampleEmit from "./test-event.mjs";

export default {
  ...common,
  key: "grain-new-highlight-instant",
  name: "New Highlight (Instant)",
  description: "Emit new event when a highlight that matches the filter is added.",
  version: "0.0.1",
  type: "source",
  dedupe: "unique",
  props: {
    ...common.props,
    viewId: {
      propDefinition: [
        common.props.grain,
        "viewId",
        () => ({
          type: "highlights",
        }),
      ],
    },
  },
  methods: {
    ...common.methods,
    getAction() {
      return [
        "added",
      ];
    },
    getSummary({ data }) {
      return `New highlight added: ${data.id}`;
    },
  },
  sampleEmit,
};

Trigger Configuration

This component may be configured based on the props defined in the component code. Pipedream automatically prompts for input values in the UI and CLI.
LabelPropTypeDescription
GraingrainappThis component uses the Grain app.
N/Ahttp$.interface.httpThis component uses $.interface.http to generate a unique URL when the component is first instantiated. Each request to the URL will trigger the run() method of the component.
N/Adb$.service.dbThis component uses $.service.db to maintain state between executions.
View IDviewIdstringSelect a value from the drop down menu.

Trigger Authentication

Grain uses OAuth authentication. When you connect your Grain account, Pipedream will open a popup window where you can sign into Grain and grant Pipedream permission to connect to your account. Pipedream securely stores and automatically refreshes the OAuth tokens so you can easily authenticate any Grain API.

Pipedream requests the following authorization scopes when you connect your account:

About Grain

Grain joins your calls to take notes, document the next steps, and file automated meeting notes in platforms like Slack, HubSpot, and more.

Action

Description:Uploads an item to Google Photos. [See the documentation](https://developers.google.com/photos/library/guides/upload-media)
Version:1.0.1
Key:google_photos-upload-item

Google Photos Overview

The Google Photos API allows you to integrate with Google's photo storage and sharing service, enabling you to create powerful automations around photo and album management. You can upload photos, create and manage albums, share photos and albums, and retrieve media items. When combined with Pipedream's ability to connect to hundreds of other apps, you can craft workflows that automate digital asset management, enhance productivity, and sync data across platforms.

Action Code

import app from "../../google_photos.app.mjs";
import {
  ConfigurationError, getFileStreamAndMetadata,
} from "@pipedream/platform";

export default {
  key: "google_photos-upload-item",
  version: "1.0.1",
  type: "action",
  name: "Upload Item",
  description: "Uploads an item to Google Photos. [See the documentation](https://developers.google.com/photos/library/guides/upload-media)",
  props: {
    app,
    file: {
      type: "string",
      label: "File Path or URL",
      description: "The media content to upload. Provide a file URL or a path to a file in the `/tmp` directory.",
    },
    description: {
      type: "string",
      label: "Description",
      description: "Description.",
      optional: true,
    },
    albumId: {
      propDefinition: [
        app,
        "albumId",
      ],
      optional: true,
    },
    syncDir: {
      type: "dir",
      accessMode: "read",
      sync: true,
      optional: true,
    },
  },
  methods: {
    streamToUint8Array(stream) {
      return new Promise((resolve, reject) => {
        const chunks = [];
        stream.on("data", (chunk) => chunks.push(chunk));
        stream.on("end", () => {
          const buffer = Buffer.concat(chunks);
          resolve(new Uint8Array(buffer));
        });
        stream.on("error", reject);
      });
    },
  },
  async run ({ $ }) {
    const {
      stream, metadata,
    } = await getFileStreamAndMetadata(this.file);
    if (!metadata.contentType) {
      throw new ConfigurationError("Can't determine content type of the file. Please specify it in the source step.");
    }

    const bytes = await this.streamToUint8Array(stream);
    const uploadToken = await this.app.uploadBytes({
      $,
      headers: {
        "Content-type": "application/octet-stream",
        "X-Goog-Upload-Content-Type": metadata.contentType,
        "X-Goog-Upload-Protocol": "raw",
      },
      data: bytes,
    });
    const resp = await this.app.createItem({
      $,
      data: {
        albumId: this.albumId,
        newMediaItems: [
          {
            description: this.description,
            simpleMediaItem: {
              fileName: metadata.name,
              uploadToken,
            },
          },
        ],
      },
    });
    $.export("$summary", "Item has been uploaded successfully.");
    return resp;
  },
};

Action Configuration

This component may be configured based on the props defined in the component code. Pipedream automatically prompts for input values in the UI.

LabelPropTypeDescription
Google PhotosappappThis component uses the Google Photos app.
File Path or URLfilestring

The media content to upload. Provide a file URL or a path to a file in the /tmp directory.

Descriptiondescriptionstring

Description.

Album IDalbumIdstringSelect a value from the drop down menu.
syncDirsyncDirdir

Action Authentication

Google Photos uses OAuth authentication. When you connect your Google Photos account, Pipedream will open a popup window where you can sign into Google Photos and grant Pipedream permission to connect to your account. Pipedream securely stores and automatically refreshes the OAuth tokens so you can easily authenticate any Google Photos API.

Pipedream requests the following authorization scopes when you connect your account:

emailprofilehttps://www.googleapis.com/auth/photoslibrary.readonly.appcreateddatahttps://www.googleapis.com/auth/photoslibrary.edit.appcreateddatahttps://www.googleapis.com/auth/photoslibraryhttps://www.googleapis.com/auth/photoslibrary.appendonlyhttps://www.googleapis.com/auth/photoslibrary.sharinghttps://www.googleapis.com/auth/photoslibrary.readonly

About Google Photos

Google Photos is the home for all your photos and videos

More Ways to Connect Google Photos + Grain

Add Items To Album with Google Photos API on New Highlight (Instant) from Grain API
Grain + Google Photos
 
Try it
Create Album with Google Photos API on New Highlight (Instant) from Grain API
Grain + Google Photos
 
Try it
Get Media Item with Google Photos API on New Highlight (Instant) from Grain API
Grain + Google Photos
 
Try it
List Library Contents with Google Photos API on New Highlight (Instant) from Grain API
Grain + Google Photos
 
Try it
Share Album with Google Photos API on New Highlight (Instant) from Grain API
Grain + Google Photos
 
Try it
New Highlight (Instant) from the Grain API

Emit new event when a highlight that matches the filter is added.

 
Try it
New Highlight Removed (Instant) from the Grain API

Emit new event when a highlight is removed.

 
Try it
New Highlight Updated (Instant) from the Grain API

Emit new event when a highlight is updated.

 
Try it
New Recording (Instant) from the Grain API

Emit new event when a recording that matches the filter is added.

 
Try it
New Recording Removed (Instant) from the Grain API

Emit new event when a recording is removed.

 
Try it
Get Recording with the Grain API

Fetches a specific recording by its ID from Grain, optionally including the transcript and intelligence notes. See the documentation

 
Try it
Add Items To Album with the Google Photos API

Adds selected items to the selected album. See the documentation

 
Try it
Create Album with the Google Photos API

Creates an album. See the documentation

 
Try it
Get Media Item with the Google Photos API

Retrieves a media item See the documentation

 
Try it
List Library Contents with the Google Photos API

Retrieves library contents See the documentation

 
Try it

Explore Other Apps

1
-
24
of
2,700+
apps by most popular

HTTP / Webhook
HTTP / Webhook
Get a unique URL where you can send HTTP or webhook requests
Node
Node
Anything you can do with Node.js, you can do in a Pipedream workflow. This includes using most of npm's 400,000+ packages.
Python
Python
Anything you can do in Python can be done in a Pipedream Workflow. This includes using any of the 350,000+ PyPi packages available in your Python powered workflows.
Pipedream Utils
Pipedream Utils
Utility functions to use within your Pipedream workflows
Notion
Notion
Notion is a new tool that blends your everyday work apps into one. It's the all-in-one workspace for you and your team.
OpenAI (ChatGPT)
OpenAI (ChatGPT)
OpenAI is an AI research and deployment company with the mission to ensure that artificial general intelligence benefits all of humanity. They are the makers of popular models like ChatGPT, DALL-E, and Whisper.
Anthropic (Claude)
Anthropic (Claude)
AI research and products that put safety at the frontier. Introducing Claude, a next-generation AI assistant for your tasks, no matter the scale.
Google Sheets
Google Sheets
Use Google Sheets to create and edit online spreadsheets. Get insights together with secure sharing in real-time and from any device.
Telegram
Telegram
Telegram, is a cloud-based, cross-platform, encrypted instant messaging (IM) service.
Google Drive
Google Drive
Google Drive is a file storage and synchronization service which allows you to create and share your work online, and access your documents from anywhere.
Pinterest
Pinterest
Pinterest is a visual discovery engine for finding ideas like recipes, home and style inspiration, and more.
Google Calendar
Google Calendar
With Google Calendar, you can quickly schedule meetings and events and get reminders about upcoming activities, so you always know what’s next.
Shopify
Shopify
Shopify is a complete commerce platform that lets anyone start, manage, and grow a business. You can use Shopify to build an online store, manage sales, market to customers, and accept payments in digital and physical locations.
Supabase
Supabase
Supabase is an open source Firebase alternative.
MySQL
MySQL
MySQL is an open-source relational database management system.
PostgreSQL
PostgreSQL
PostgreSQL is a free and open-source relational database management system emphasizing extensibility and SQL compliance.
Premium
AWS
AWS
Amazon Web Services (AWS) offers reliable, scalable, and inexpensive cloud computing services.
Premium
Twilio SendGrid
Twilio SendGrid
Send marketing and transactional email through the Twilio SendGrid platform with the Email API, proprietary mail transfer agent, and infrastructure for scalable delivery.
Amazon SES
Amazon SES
Amazon SES is a cloud-based email service provider that can integrate into any application for high volume email automation
Premium
Klaviyo
Klaviyo
Email Marketing and SMS Marketing Platform
Premium
Zendesk
Zendesk
Zendesk is award-winning customer service software trusted by 200K+ customers. Make customers happy via text, mobile, phone, email, live chat, social media.
Premium
ServiceNow
ServiceNow
The smarter way to workflow
Slack
Slack
Slack is a channel-based messaging platform. With Slack, people can work together more effectively, connect all their software tools and services, and find the information they need to do their best work — all within a secure, enterprise-grade environment.
Microsoft Teams
Microsoft Teams
Microsoft Teams has communities, events, chats, channels, meetings, storage, tasks, and calendars in one place.