googleworkspace / php-samples

PHP samples for Google Workspace APIs
Apache License 2.0
288 stars 348 forks source link

Quickstart, invalid client secret JSON file #36

Closed alexblly closed 5 years ago

alexblly commented 5 years ago

Hello, for my project I need to be able to modify a calendar with PHP. To begin, I'm trying out Google's test (https://developers.google.com/calendar/quickstart/php) When executing the command 'php quickstart.php' I have the following error.

`PHP Fatal error: Uncaught Google_Exception: Invalid client secret JSON file. in /var/www/html/google-api-php-client/src/Google/Client.php:171 Stack trace:

0 /var/www/html/quickstart.php(17): Google_Client->setAuthConfig('credentials.jso...')

1 /var/www/html/quickstart.php(63): getClient()

2 {main}

thrown in /var/www/html/google-api-php-client/src/Google/Client.php on line 171`

I tried creating other client ID but the problem is the same I followed the guide but I block on it.

In the Google Developers i made another credentials.json and i checked it but it's not the solution.

Maybe i have a problem with Oauth?

erickoledadevrel commented 5 years ago

Did you create the credentials.json file using the button in the quickstart instructions? You need to make sure the client ID is of type "Other".

erickoledadevrel commented 5 years ago

Closing due to inactivity.

hamzazafeer commented 5 years ago

I am following this https://developers.google.com/analytics/devguides/reporting/core/v4/quickstart/web-php?authuser=1 and it shows the error "Use Composer" , then i changed the api code by using this https://github.com/google/google-api-php-client/tree/v1-master it shows error that Invalid client secret JSON file..

how to resolve this?

erickoledadevrel commented 5 years ago

The Analytics API is not a part of G Suite. See their support page for options on how to get help: https://developers.google.com/analytics/devguides/reporting/core/v4/help