← YouTube (Data API)

Update Playlist with YouTube (Data API) API

Pipedream makes it easy to connect APIs for YouTube (Data API) and 900+ other apps remarkably fast.

Trigger workflow on
HTTP requests, schedules and app events
Next, do this
Update Playlist with the YouTube (Data API) API
No credit card required
Into to Pipedream
Watch us build a workflow
Watch us build a workflow
7 min
Watch now ➜
Trusted by 250,000+ developers from startups to Fortune 500 companies:
Trusted by 250,000+ developers from startups to Fortune 500 companies

Developers Pipedream

Getting Started

Create a workflow to Update Playlist with the YouTube (Data API) API. When you configure and deploy the workflow, it will run on Pipedream's servers 24x7 for free.

  1. Configure the Update Playlist action
    1. Connect your YouTube (Data API) account
    2. Configure Playlist Id
    3. Optional- Configure On Behalf Of Content Owner
  2. Select a trigger to run your workflow on HTTP requests, schedules or app events
  3. Deploy the workflow
  4. Send a test event to validate your setup
  5. Turn on the trigger

Integrations

Update Playlist with YouTube (Data API) API on New Requests (Payload Only) from HTTP / Webhook API
HTTP / Webhook + YouTube (Data API)
 
Try it
Update Playlist with YouTube (Data API) API on New Message from Discord API
Discord + YouTube (Data API)
 
Try it
Update Playlist with YouTube (Data API) API on New Message in Channel from Discord Bot API
Discord Bot + YouTube (Data API)
 
Try it
Update Playlist with YouTube (Data API) API on New Submission from Typeform API
Typeform + YouTube (Data API)
 
Try it
Update Playlist with YouTube (Data API) API on Custom Events from Zoom API
Zoom + YouTube (Data API)
 
Try it

Details

This is a pre-built, open source component from Pipedream's GitHub repo. The component is 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.

Update Playlist on YouTube (Data API)
Description:Modifies a playlist. For example, you could change a playlist's title, description, or privacy status. **If you are submitting an update request, and your request does not specify a value for a property that already has a value, the property's existing value will be deleted.** [See the docs](https://developers.google.com/youtube/v3/docs/playlists/update) for more information
Version:0.0.1
Key:youtube_data_api-update-playlist

Code

import youtubeDataApi from "../../youtube_data_api.app.mjs";
import consts from "../../consts.mjs";

export default {
  key: "youtube_data_api-update-playlist",
  name: "Update Playlist",
  description: "Modifies a playlist. For example, you could change a playlist's title, description, or privacy status. **If you are submitting an update request, and your request does not specify a value for a property that already has a value, the property's existing value will be deleted.** [See the docs](https://developers.google.com/youtube/v3/docs/playlists/update) for more information",
  version: "0.0.1",
  type: "action",
  props: {
    youtubeDataApi,
    id: {
      propDefinition: [
        youtubeDataApi,
        "playlistId",
      ],
      optional: false,
      reloadProps: true,
    },
    onBehalfOfContentOwner: {
      propDefinition: [
        youtubeDataApi,
        "onBehalfOfContentOwner",
      ],
      reloadProps: true,
    },
  },
  async additionalProps() {
    const dynamicProps = {};
    const playlist = await this.fetchPlaylist(this.id);
    if (!playlist) {
      return dynamicProps;
    }
    dynamicProps.title = {
      ...youtubeDataApi.propDefinitions.title,
      description: `The playlist's title.\n\n**Current title**: \`${playlist.snippet.title}\``,
    };
    dynamicProps.description = {
      ...youtubeDataApi.propDefinitions.description,
      description: `The playlist's description.\n\n**Current title**: \`${playlist.snippet.description}\``,
    };
    dynamicProps.privacyStatus = {
      label: "Privacy Status",
      description: `The playlist's privacy status.\n\n**Current privacy status**: \`${playlist.status.privacyStatus}\``,
      type: "string",
      options: consts.UPDATE_PLAYLIST_PRIVACY_STATUS_OPTS,
    };
    return dynamicProps;
  },
  methods: {
    async fetchPlaylist(id) {
      let playlist = null;
      if (id) {
        const playlistsData = (await this.youtubeDataApi.listPlaylists({
          part: consts.UPDATE_PLAYLIST_PART,
          id: id,
        })).data;
        playlist = playlistsData.items.pop();
      }
      if (!playlist) {
        console.log("The provided id is either not valid or you can't fetch this data.");
        return null;
      }
      return playlist;
    },
  },
  async run({ $ }) {
    const {
      id,
      title,
      description,
      privacyStatus,
      onBehalfOfContentOwner,
    } = this;

    const playlist = await this.fetchPlaylist(id);
    const updatedPlaylist = (await this.youtubeDataApi.updatePlaylist({
      onBehalfOfContentOwner,
      part: consts.UPDATE_PLAYLIST_PART,
      requestBody: {
        etag: playlist.etag,
        id: playlist.id,
        kind: playlist.kind,
        snippet: {
          title,
          description,
        },
        status: {
          privacyStatus,
        },
      },
    })).data;
    $.export("$summary", `Successfully updated playlist "${playlist.id}"`);

    return updatedPlaylist;
  },
};

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
YouTube (Data API)youtubeDataApiappThis component uses the YouTube (Data API) app.
Playlist Ididstring

The playlistId parameter specifies a unique YouTube playlist ID.

On Behalf Of Content OwneronBehalfOfContentOwnerstring

This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners.

Authentication

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

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

emailprofilehttps://www.googleapis.com/auth/youtube.readonlyhttps://www.googleapis.com/auth/youtube.uploadhttps://www.googleapis.com/auth/youtube

About YouTube (Data API)

Online video platform

More Ways to Use YouTube (Data API)

Triggers

New Liked Videos from the YouTube (Data API) API

Emit new event for each new Youtube video liked by the authenticated user.

 
Try it
New Subscriber from the YouTube (Data API) API

Emit new event for each new Youtube subscriber to user Channel.

 
Try it
New Subscription from the YouTube (Data API) API

Emit new event for each new subscription from authenticated user.

 
Try it
New Videos from the YouTube (Data API) API

Emit new event for each new Youtube video the user posts.

 
Try it
New Videos by Location from the YouTube (Data API) API

Emit new event for each new YouTube video tied to a location.

 
Try it

Actions

Channel Statistics with the YouTube (Data API) API

Returns statistics from my YouTube Channel or by id. See the docs for more information

 
Try it
List Activities with the YouTube (Data API) API

Returns a list of channel activity events that match the request criteria. See the docs for more information

 
Try it
List Playlists with the YouTube (Data API) API

Returns a collection of playlists that match the API request parameters. See the docs for more information

 
Try it
List Videos with the YouTube (Data API) API

Returns a list of videos that match the API request parameters. See the docs for more information

 
Try it
Upload Video with the YouTube (Data API) API

Post a video to your channel. See the docs for more information

 
Try it