0

私はGoogleの管理APIを使用していて、少し修正してサンプルコードをまとめていました。私はgoogleの終わりに物事を正しく設定しましたが、私がスクリプトを実行するとエラーが出てきました。以下はPythonで私のコードです:私は取得していますgoogle admin api - client_secretsエラー

from __future__ import print_function 

from apiclient.discovery import build 
from httplib2 import Http 
from oauth2client import file, client, tools 

SCOPES = 'https://www.googleapis.com/auth/admin.directory.user' 
store = file.Storage('storage.json') 
creds = store.get() 
if not creds or creds.invalid: 
    flow = client.flow_from_clientsecrets('client_secret.json', SCOPES) 
    creds = tools.run_flow(flow, store) 
SERVICE = build('admin', 'directory_v1', http=creds.authorize(Http())) 


results = SERVICE.users().list(customer='my_customer', maxResults=10, 
    orderBy='email').execute() 
users = results.get('users', []) 

エラーはこれです:

Traceback (most recent call last): 
    File "quickstart.py", line 11, in <module> 
    flow = client.flow_from_clientsecrets('client_secret.json', SCOPES) 
    File "build/bdist.macosx-10.12-intel/egg/oauth2client/_helpers.py", line 133, in positional_wrapper 
    File "build/bdist.macosx-10.12-intel/egg/oauth2client/client.py", line 2125, in flow_from_clientsecrets 
    File "build/bdist.macosx-10.12-intel/egg/oauth2client/clientsecrets.py", line 165, in loadfile 
    File "build/bdist.macosx-10.12-intel/egg/oauth2client/clientsecrets.py", line 126, in _loadfile 
    File "build/bdist.macosx-10.12-intel/egg/oauth2client/clientsecrets.py", line 101, in _validate_clientsecrets 
oauth2client.clientsecrets.InvalidClientSecretsError: Missing property "client_secret" in a client type of "installed". 

私はGoogleのAPIに新しいですし、非常に多くの任意の助けのためにいただければ幸いです。

おかげclient_secret.json再び

+0

あなたはこれを理解しましたか? Googleのドキュメントは駄目です。 – cph

答えて

-1

ダウンロード。そのファイルに問題があります。

this linkを小さなチュートリアルに使用してclient_secretを取得することができます。

関連する問題