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

I am unable to create new asset, getting error 403

$
0
0

I am trying to enable monetization of a video but I'm getting error 403 and no more additional info

        $asset = new \Google_Service_YouTubePartner_Asset();        $metadata = new \Google_Service_YouTubePartner_Metadata();        //if (array_key_exists('title', $data))       $metadata->setTitle($data['title']);        //if (array_key_exists('description', $data)) $metadata->setDescription($data['description']);        $metadata->setTitle('test title');        $metadata->setDescription('test desc');        $asset->setMetadata($metadata);        $asset->setType("web");        // Insert the asset resource. Extract its unique asset ID from the API        // response.        $assetInsertResponse = $this->youtube_partner->assets->insert($asset, ['onBehalfOfContentOwner' => $contentOwnerId]);

and the response is always

{"error": {"code": 403,"message": "Forbidden","errors": [{"message": "Forbidden","domain": "global","reason": "forbidden"}]}}

Everything else seems to be working, i.e I can create policies with

        $policy = new \Google_Service_YouTubePartner_Policy();        $policyRule = new \Google_Service_YouTubePartner_PolicyRule();        $policyRule->setAction("monetize");        $policy->setRules(array($policyRule));        $policy->setName('test');        $response = $this->youtube_partner->policies->insert($policy);

Viewing all articles
Browse latest Browse all 3831

Trending Articles



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