Jegan
Jegan

Reputation: 530

Php video upload to youtube via youtube data api

Im getting the below error while uploading the video to you tube.

exception 'Google_ServiceException' with message 'Error calling POST
https://www.googleapis.com/upload/youtube/v3/videos?part=snippet%2Cstatus&uploadType=multipart&key=AIzaSyCfF7aL8R9qBbXTfl-TkdwcypMfWtPbtOI:
(403) There is a per-IP or per-Referer restriction configured on your
API key and the request does not match these restrictions. Please use
the Google Developers Console to update your API key configuration if
request from this IP or referer should be allowed.' in
/home/acealgos/public_html/demo/maid/app/webroot/youtube_upload/google-api-php-client/src/io/Google_REST.php:66
Stack trace: #0
/home/acealgos/public_html/demo/maid/app/webroot/youtube_upload/google-api-php-client/src/io/Google_REST.php(36):
Google_REST::decodeHttpResponse(Object(Google_HttpRequest)) #1/home/acealgos/public_html/demo/maid/app/webroot/youtube_upload/google-api-php-client/src/service/Google_ServiceResource.php(186):
Google_REST::execute(Object(Google_HttpRequest)) #2
/home/acealgos/public_html/demo/maid/app/webroot/youtube_upload/google-api-php-client/src/contrib/Google_YouTubeService.php(887):
Google_ServiceResource->__call('insert', Array) #3 /home/acealgos/public_html/demo/maid/app/webroot/youtube_upload/index.php(73):
Google_VideosServiceResource->insert('snippet,status',
Object(Google_Video), Array) #4 {main}

In google developer console below api's are enabled

BigQuery API        
Debuglet Controller API     
Google Cloud SQL            
Google Cloud Storage JSON API           
YouTube Analytics API           
YouTube Data API v3

which api should enable to resolve the issue.

Upvotes: 0

Views: 202

Answers (1)

krachleur
krachleur

Reputation: 366

if we read this msg :

There is a per-IP or per-Referer restriction configured on your API key and the request does not match these restrictions. Please use the Google Developers Console to update your API key configuration if request from this IP or referer should be allowed.

Haven't you moved the project to another host, or are you working in another comp, As I know google Api gives an api key related to the host you're working in, so in your case, you have to go to the regenerate a newer key!

Upvotes: 1

Related Questions