Help with apiKey login
See original GitHub issueI’m pretty new to google apis, and am not sure if this is an error or I’m doing something wrong (It’s probably my fault). I’m trying to get a simple API test working on my node server. This is what I have:
var google = require('googleapis');
google.options({ auth: '...myApiKey...' });
var androidpublisher = google.androidpublisher('v2');
app.get("/test3", function(req, res){
//test googe apis
var apiKey = "...myApiKey...";
androidpublisher.edits.get({ editId: 1, packageName: "com.web2apptests"}, function(err, data){
if(err){
console.log("err:" + err);
res.end("Look at the console.");
}else{
console.log(data);
res.end("Look at the console.");
}
});
});
But I get the error: “Error: Login Required” I even tried with this line of code:
androidpublisher.edits.get({ auth: apiKey, editId: 1, packageName: "com.web2apptests"}, function(err, data){
What am I doing wrong? Is it possible to use androidpublisher with apiKey or does it have to be OAuth? Maybe I’m using the wrong key…
Issue Analytics
- State:
- Created 7 years ago
- Comments:10 (3 by maintainers)
Top Results From Across the Web
Authenticate using API keys - Google Cloud
Sign in · Documentation · Contact Us Start free · Google Cloud · Overview. More. Solutions. More. Products. More. Pricing. More. Resources. More....
Read more >API Keys: API Authentication Methods & Examples
There are many methods of API authentication, such as Basic Auth (username and password) and OAuth (a standard for accessing user permissions without...
Read more >Setting up API keys - API Console Help - Google Support
To create your application's API key: Go to the API Console. ... Click Create credentials and then select API key. Note: In addition...
Read more >Use API Keys | Maps JavaScript API - Google Developers
Go to the Google Maps Platform > Credentials page. Go to the Credentials page · On the Credentials page, click Create credentials >...
Read more >API Keys - Swagger
Some APIs use API keys for authorization. An API key is a token that a client provides when making API calls. The key...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I was clicking around a bit. Creating service accounts, adding permissions, downloading keys and in the end I ended up with the same settings as before (i think), but this time it’s working, in response I get the ID and expiry time with this code:
Yes, it’s working 😃