Solved

YouTube API 3 removing video from playlist

Posted on 2014-09-22
5
380 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
  • 2
  • 2
5 Comments
 
LVL 61

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 61

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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Hi, Even though I have created this Tutorial on My personal Blog, Some people might not able to find my website, So here i am posting it again Today, from the topic it is very clear that i will be showing you here the very basic usage of how we …
These days socially coordinated efforts have turned into a critical requirement for enterprises.
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 create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

760 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now