将Google帐户与youtube帐户相关联

I'm trying to use the YouTube Data API to upload videos, but using a Google service account. When I try to upload the video I always get a "NoLinkedYouTubeAccount" error, even though it seems that the google account is linked with youtube.

My problem is that I found a way to upgrade the account to be linked with YouTube here: https://developers.google.com/youtube/2.0/developers_guide_protocol_profiles#Upgrading_an_Unlinked_Google_Account

But when I run the PUT request it gives me this response:

HTTP 400

GDataParseExceptionPremature end of file.

The headers that I send are the following:

Authorization: Bearer <token>
X-GData-Key: key=<youtube dev key>
GData-Version: 2.1
Content-Type: application/atom+xml; charset=UTF-8

I deliberately changed "token" and "youtube dev key"

To the best of my knowledge, it's not possible to link a YouTube channel to a Service Account. They need to be linked to a full Google Account.

That being said, I can't guess what the response is that you're getting back from your API request. Based on the error message, it sounds like you're not getting back valid XML, but you'd have to turn on logging (say with Zend_Gdata_YouTube#enableRequestDebugLogging()) to or sniff the network traffic to see exactly what you're getting back.