issues with the project id #5930
Replies: 2 comments
-
can i use an api key to call the api? seems pretty difficult to figure out all of the myriad of mechanisms to connect although the project id doesnt seem very easy to use? |
Beta Was this translation helpful? Give feedback.
-
I'd be willing to bet you have some authentication default credentials that are being used over the project you're providing. Please read the documentation on authentication to better troubleshoot your environment. As a way of testing, please remove any automatic login: |
Beta Was this translation helpful? Give feedback.
-
Using the simple example for cloud translation, I provide a project id for a billable project where cloud translate api is enabled. I unfortunately get an error message indicating that my project has not enabled the cloud translation api. The project in the error message is not my project!! The id i provided is something different. In my google cloud console, i have an organization with multiple projects. The id is a generated id with words and numbers, which as you can see doesnt match the project in the error.
Any ideas why the project id would change from request to response?
const projectId = "my project id"
// Imports the Google Cloud client library
const {Translate} = require('@google-cloud/translate').v2;
// Instantiates a client
const translate = new Translate({projectId});
Beta Was this translation helpful? Give feedback.
All reactions