Solved

YouTube API 3 removing video from playlist

Posted on 2014-09-22
5
392 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 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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

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 …
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to count occurrences of each item in an array.

772 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