I am able to get and list assets using googleapiclient and oauth2client,but when I try to add one, I get 403:
googleapiclient.errors.HttpError: <HttpError 403 when requesting https://www.googleapis.com/youtube/partner/v1/assets?alt=json returned "Forbidden". Details: "[{'message': 'Forbidden', 'domain': 'global', 'reason': 'forbidden'}]">
Edit:here's the piece of code that does the insertion:
def insert_asset(self, work_id=None, artist=None, title=None, isrc=None): body = {"kind": "youtubePartner#asset","type": "sound_recording","status": "active","metadataMine": {"customId": work_id,"title": title,"isrc": isrc,"artist": [artist], }, } return self.service_youtube_content_id.assets().insert(body=body).execute()
and the service_youtube_content_id
is instantiated as
self.service_youtube_content_id = build("youtubePartner", "v1", http=self.http, static_discovery=False )