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

The request uses the mine parameter but is not properly authorized

$
0
0

I'm trying to make this call to YouTube channels API with mine parameter but i got below error.

["error" => array:3 ["errors" => array:1 [      0 => array:5 ["domain" => "youtube.parameter""reason" => "authorizationRequired""message" => "The request uses the <code>mine</code> parameter but is not properly authorized.""locationType" => "parameter""location" => "mine"      ]    ]"code" => 401"message" => "The request uses the <code>mine</code> parameter but is not properly authorized."  ]]

By the below code i am calling youtube v3 APIs

$client = new \Google_Client();    $client->setAuthConfig(app_path('google-api.json'));    $client->setScopes(['https://www.googleapis.com/auth/youtube','https://www.googleapis.com/auth/youtubepartner-channel-audit',        \Google_Service_YouTube::YOUTUBE_FORCE_SSL,    ]);    $client->setRedirectUri('http://' . $_SERVER['HTTP_HOST'] . '/login');    $client->setAccessType('offline');           $client->setIncludeGrantedScopes(true);    $httpClient = $client->authorize();    $customerResponse = $httpClient->get('https://www.googleapis.com/youtube/v3/channels?part=snippet%2CcontentDetails%2Cstatistics&mine=true&key={API_KEY}');    $customer = json_decode($customerResponse->getBody()->getContents(), true);

Viewing all articles
Browse latest Browse all 3831

Trending Articles



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