Hello,
How can I solve this error, please?
"NameError: name 'client' is not defined"
I get the error when I try to report through DCM's API using the following Python code to make a request:
# Set up a Flow object to be used if we need to authenticate.
flow = client.flow_from_clientsecrets(
path_to_client_secrets_file, scope=OAUTH_SCOPES)
# Check whether credentials exist in the credential store. Using a credential
# store allows auth credentials to be cached, so they survive multiple runs
# of the application. This avoids prompting the user for authorization every
# time the access token expires, by remembering the refresh token.
storage = Storage(CREDENTIAL_STORE_FILE)
credentials = storage.get()
# If no credentials were found, go through the authorization process and
# persist credentials to the credential store.
if credentials is None or credentials.invalid:
credentials = tools.run_flow(flow, storage,
tools.argparser.parse_known_args()[0])
# Use the credentials to authorize an httplib2.Http instance.
http = credentials.authorize(httplib2.Http())
Thank you!
Looking forward to your confirmation.
Regards,
Eshra