GeezerVison is showing github.com — I have issue to add the json key file · Issue #158 · GoogleCloudPlatform/nodejs-docs-samples
I have issue to add the json key file #158Labels 🚨This issue needs some love.triage meI really want to be triaged. Activityjmdobry commented on Jul 24, 2016 Can you please provide more information about your setup? Did you run gcloud beta auth application-default login or are you trying to use a service account? Is your GOOGLE_APPLICATION_CREDENTIALS environment variable set to the correct value? aligajani commented on Jul 24, 2016 @jmdobry Hey man, I am a bit confused. Do I have to use gcloud to use the natural language API, because it seems like an over kill. Can't I just supply the API key or the service account .json file and be ready to make calls from my PHP app using Guzzle. I haven't seen any API endpoint being accessed in such a non-trivial way, such that it makes beginner trials boring and tedious Reacted by Marc de Ruijter, shrutirajagopal and Jimmy McCabe jmdobry commented on Jul 25, 2016 @aligajani You are not required to use Google client libraries in order to communicate with Google APIs, but it is useful if you don't have time to implement your own client library.
If you're struggling to deploy one of the Node.js samples in this repository, then opening an issue here is good way to get help, only you must provide enough information for me to be able to reproduce the error before I can help you, e.g. which sample you're trying to deploy, stack trace, app.yaml, package.json, Node version, etc.
If you're looking for free general support, you can hop onto our Slack channels and post your question (there's even a php channel), or search Stack Overflow. Here are some more links to Google Cloud Platform developer communities.
If you're looking for paid technical support, you can find that on cloud.google.com/support. elibixby commented on Jul 25, 2016 @aligajani Just to clarify what @jmdobry is saying:
You don't need gcloud to use Google APIs. In this case you can just point to a service account json file:
export GOOGLE_APPLICATION_CREDENTIALS=/path/to/my/service_account.json
aligajani commented on Jul 27, 2016 @elibixby Do you guys have a tutorial on how to use Natural Language API via PHP? jmdobry commented on Jul 28, 2016 hung101 commented on Jan 20, 2017 hung101 commented on Jan 20, 2017 I found the solution:
putenv(GOOGLE_APPLICATION_CREDENTIALS=/[filekey].json);
must set the environment variable Reacted by Jason Dobry, Rashedul Islam Sagor, Aurélie Leportier, Nisar Khalid and Rajneesh Mitharwal informaticosgb commented on Jul 21, 2017 I solved it:
putenv('GOOGLE_APPLICATION_CREDENTIALS=../service-account.json');
$client = new Google_Client();
$client->useApplicationDefaultCredentials();
$client->setScopes(['https://www.googleapis.com/auth/analytics.readonly']);
$client->refreshTokenWithAssertion();
$token = $client->getAccessToken();
$accessToken = $token['access_token'];
dd($accessToken);
👍 Reacted by Paul Makhnovskiy
MetadataMetadata🚨This issue needs some love.triage meI really want to be triaged. DevelopmentNo branches or pull requestsIssue actions
|