Solved

YouTube API 3 removing video from playlist

Posted on 2014-09-22
5
407 Views
Last Modified: 2014-10-07
Hello, does anybody have an idea how to delete a video from a youtube playlist?  I have the video id and I believe I actually have to capture the playlistItemID on the return call but the syntax I'm not sure how to construct. The video adding which I have working is below.

                <cfset jsondet={

                    "snippet" = {
                       "playlistId" = "#youtube_playlist_id#",
                      "description" = "#getPlaylistData.playlist_description#",
                       "resourceId" = {
                          "kind"    = "youtube##video",
                          "videoId" = "#getPlaylistData.video_id#"
                       },
                       "position"   = 0
                    }

                }>

Open in new window

0
Comment
Question by:brihol44
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 62

Assisted Solution

by:gheist
gheist earned 334 total points
ID: 40339930
Code is in coldfusion. Are PHP and JavaScript areas related at all?
0
 
LVL 82

Assisted Solution

by:leakim971
leakim971 earned 166 total points
ID: 40340568
Here the doc :
https://developers.google.com/youtube/2.0/developers_guide_protocol_updating_and_deleting_videos#Deleting_a_video

So once you've the auth token and Id f the video send a DELETE to your video URL :

<cfhttp url="http://gdata.youtube.com/feeds/api/users/default/uploads/VIDEO_ID" method="delete" result="result">
        <cfhttpparam type="header" name="Authorization" value="GoogleLogin" auth=#variables.authtoken#">
        <cfhttpparam type="header" name="X-GData-Client" value="youtubecfc">
        <cfhttpparam type="header" name="X-GData-Key" value="key=#variables.devkey#">
</cfhttp>

Open in new window

0
 
LVL 62

Accepted Solution

by:
gheist earned 334 total points
ID: 40340914
0
 

Author Comment

by:brihol44
ID: 40342226
In order of the comments...

1. I looked through the code examples (js, php, others) and none refer to json structure I need to verify deleting playlist items.

2. Thx, I'm using 3.0 api not 2.0.

3. That page I have read three times but its not clear how to formulate the structure to send to make the video go away.

Thx for the initial help
0
 

Author Closing Comment

by:brihol44
ID: 40367660
Thx!
0

Featured Post

Webinar: Aligning, Automating, Winning

Join Dan Russo, Senior Manager of Operations Intelligence, for an in-depth discussion on how Dealertrack, leading provider of integrated digital solutions for the automotive industry, transformed their DevOps processes to increase collaboration and move with greater velocity.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Sometimes databases have MILLIONS of records and we need a way to quickly query that table to return the results me need. Sure you could use CFQUERY but it takes too long when there are millions of records. That is why SOLR was invented. Please …
This article discusses how to implement server side field validation and display customized error messages to the client.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to count occurrences of each item in an array.

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question