When an API requires an API key and the API is associated with a Google Cloud project that you don't have access to, you have the following options to obtain an API key:
Option 1: Ask a security admin to create an API key for you.
Option 2: Ask a security admin to grant you access to the project so that you can create an API key in the same project that the API is associated with.
Option 3: Ask a security admin to grant you access to enable the API in your own Google Cloud project so that you can create an API key.
Enabling an API
If you used option 3 and asked someone to grant you access to enable the API, follow the steps below to enable the API in your own Google Cloud project.
To enable an API:
- In the Cloud console, go to APIs & services for your project.
- On the Library page, click Private APIs. If you don't see the API listed, that means you haven't been granted access to enable the API.
- Click the API you want to enable. If you need help finding the API, use the search field.
- In the page that displays information about the API, click Enable.
Enter the following to display the project IDs for your Google Cloud projects:
gcloud projects list
Using the applicable project ID from the previous step, set the default project to the one in which you want to enable the API:
gcloud config set project YOUR_PROJECT_ID
Get a list of services that you can enable in your project:
gcloud services list --available
If you don't see the API listed, that means you haven't been granted access to enable the API.
Using the applicable service name from the previous step, enable the service:
gcloud services enable SERVICE_NAME
For more information on the preceding commands, see the