YouTube GData API returning error 400 when uploading a video

I’ve been battling with the YouTube API for the last 2 days now and found the single line of code that has been preventing me from generating a form upload token.

I was following the example code at and kept receiving “Expected response code 200, got 400″ when calling the getFormUploadToken function. HTTP error code 400 is a bad request which wasn’t really much help.

Eventually I found the problem and I will own up straight away that it was basically my fault, I’d made what I considered to be a slight change to the example code, I changed

$mediaGroup->category = array(  $yt->newMediaCategory()->setText('Autos')->setScheme




to the following

$mediaGroup->category = $yt->newMediaCategory()->setText('Autos')->setScheme

because I wasn’t interested in multiple categories, just something simple. My mistake was not in removing the two developer tags but removing the array(). This took me almost an entire day to realise and resulted in a “You have to be kidding” comment from me once fixed. *Sigh* oh well, not going to get that time back but at least I learned not to mess with example code.

I’ve finally embraced CSS

I’ve been putting together sites for years but never really taken the time to learn CSS properly and sticking with table based structure for far too long, finally I have built my first site using nothing but CSS and div tags for layout. It’s probably not perfect but it works and that’s the main thing for me.

The site in question is

With my new found confidence in CSS I will now attempt to create a WordPress theme for that same site’s blog section, let’s see how it goes…