Required Credentials For Hawk JS
Google Service Account Credentials for GWebmaster
, GWebmaster2
and GIndex
.
Prerequisites
Before you begin, ensure you have the following:
- A Google account
- Access to the Google Cloud Console
- Admin access to your Google Search Console property
Step-by-Step Instructions
Step 1: Create a New Project in Google Cloud Console
- Go to the Google Cloud Console: Open Google Cloud Console (opens in a new tab).
- Create a New Project:
- Click on the project dropdown at the top left of the page.
- Select "New Project".
- Enter a name for your project and click "Create".
Step 2: Enable the Required APIs
- Navigate to the API & Services Dashboard:
- From the left-hand navigation menu, go to
APIs & Services
>Dashboard
.
- From the left-hand navigation menu, go to
- Enable the Indexing API:
- Click
Enable APIs and Services
at the top. - Search for "Indexing API" and click on it.
- Click
Enable
.
- Click
- Enable the Search Console API:
- Repeat the above steps to search for "Search Console API".
- Click on it and click
Enable
.
Step 3: Create a Service Account
- Navigate to the Service Accounts Page:
- Go to
IAM & Admin
>Service Accounts
.
- Go to
- Create a Service Account:
- Click
+ Create Service Account
. - Enter a name and description for the service account, then click
Create
.
- Click
- Grant the Service Account Permissions:
- In the "Grant this service account access to project" section, add the role
Owner
. - Click
Continue
, thenDone
.
- In the "Grant this service account access to project" section, add the role
Step 4: Generate and Download the JSON Key
- Create Key for Service Account:
- Find your service account in the list and click on its email.
- Go to the
Keys
tab. - Click
Add Key
>Create New Key
. - Select
JSON
and clickCreate
. This will download a JSON file containing your credentials. Store this file securely asgserv.json
in your web project root directory so Hawk JS will use it for API authentication.
Step 5: Add Service Account to Google Search Console
- Open Google Search Console: Go to Google Search Console (opens in a new tab).
- Add the Service Account as an Owner:
- Select your property in Google Search Console.
- Go to
Settings
>Users and permissions
>Add user
. - Enter the email address of your service account and select the role
Owner
. - Click
Add
.
By following these steps, you should be able to successfully obtain and configure service account credentials for accessing the Google Indexing API and Google Search Console API. For any issues or further assistance, refer to the Google Cloud Console Documentation (opens in a new tab) and Google Search Console Help (opens in a new tab).
Let's see how to fire up with CLI!
Keywords:
- Search Console API
- Indexing API
- service account setup