Quantcast
Channel: Active questions tagged youtube-api - Stack Overflow
Viewing all articles
Browse latest Browse all 3831

How to authorize a Google Service Account to upload videos via YouTube Data API v3?

$
0
0

I'm developing a backend application using a Google Service Account to upload videos to YouTube via the YouTube Data API v3.

  1. The service account is granted OAuth scopes:

    https://www.googleapis.com/auth/adwords
    https://www.googleapis.com/auth/youtube

  2. I'm able to access the Google Ads API successfully using this service account.

  3. However, when trying to upload a video using the following API:

    POST https://www.googleapis.com/upload/youtube/v3/videos?part=snippet,status&uploadType=resumable

I get a 401 Unauthorized error with this response:

"error": {"code": 401,"message": "Unauthorized","errors": [      {"message": "Unauthorized","domain": "youtube.header","reason": "youtubeSignupRequired","location": "Authorization","locationType": "header"      }    ]  }}

My question:How can I correctly authorize a Google Service Account to access the YouTube Data API and upload videos?

It seems like YouTube channel ownership is required, but service accounts don't have a YouTube channel by default. Is there a recommended workaround (such as impersonation via domain-wide delegation or OAuth flow with a real user account)?Any guidance from Google engineers or those who’ve dealt with this before would be appreciated.


Viewing all articles
Browse latest Browse all 3831

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>