My main question is: can I use the access token got from service account to upload a video to youtube?
Account is new, connected to youtube, channel is created got the access token in the following mode:
$client = new Google_Client();
$client->setApplicationName('Youtube Login');
$key = file_get_contents($key_file);
$client->setClientId($client_id);
$client->setAssertionCredentials(new Google_AssertionCredentials(
$service_account_name,
array(
'https://www.googleapis.com/auth/youtube.upload',
'https://www.googleapis.com/auth/youtube'
'https://gdata.youtube.com/action/GetUploadToken',
'https://gdata.youtube.com'
),
$key)
);
$client::$auth->refreshTokenWithAssertion();
$json = $client->getAccessToken();
$accessToken = json_decode($json)->access_token;
So the access token is ok. Now when I create the header and insert the access token and developer key and everything needed described here: https://developers.google.com/youtube/2.0/developers_guide_protocol_browser_based_uploading I get NoLinkedYouTubeAccount error.
If a Service Account cannot be used to upload a video this way, is there a way to skip user interaction in video upload?
We have the account, but we do not want users to be redirected anywhere just because ClientLogin is deprecated and Youtube API v2.0 does not support OAuth2 Service Account access token.
Is there a way? Searched all over the net, saw similar unanswered questions, but got nowhere.