Getting and Restricting your API Key
Perspective API Key
Your API Key can be obtained from Google Developer Console
If you already have a project created for your site, skip to step 5 to retrieve your ID, then continue to step 6.
If you don’t currently have an active project for your site, from the top navigation bar next to the “Google APIs” logo, click the active project
- In the following modal, click “New project”
- Enter a comprehensive project name, and organize your project appropriately
After saving the project, click the active project dropdown in the top navigation bar next to the “Google APIs” logo
In the following modal, copy the “ID” of your newly created project and store it for later
Select your newly created project
Head to the following form: https://docs.google.com/forms/d/e/1FAIpQLSdhBBnVVVbXSElby-jhNnEj-Zwpt5toQSCFsJerGfpXW66CuQ/viewform
- Provide information about your project
- When asked for your Google Cloud Project (GCP) ID, paste the ID obtained in step 5
- Submit your access request and wait for email confirmation before continuing
- Once you have received confirmation that your access to the Perspective API has been approved, head back to your developer console (see step 1)
Once again select your project from the top navigation bar
Select “Dashboard” from the left hand navigation
Click “Enable APIs and services” on the top below the navigation bar
Search for “Perspective” in the search bar above the following list, and select “Perspective Comment Analyzer API” from the search results
Select “Enable” in the following screen or skip this step, if the API is showing as already enabled, and return to the main dashboard with the left-pointing arrow in the sub navigation bar
Select “Credentials” from the left hand navigation bar
Select” Create credentials” from the sub navigation bar
Select “API key” to proceed to the next screen
Copy your API key and store it for later use
If you are setting up a clients site, continue to “How to properly restrict an API key” below and click “Restrict key”, otherwise continue
Head back to your XenForo Admin Control Panel and place the retrieved API key in your Audentio Google Perspective Integration add-ons options
How to properly restrict an API key
Retrieve your client’s server’s IP address
Return to the Google Developer Console API key restriction page
Set “Application restrictions” to “IP addresses”
- Click “add an item” under “Accept requests from these server IP addresses”
- Provide your previously obtained IP address and click “done”
- Repeat a through b for all obtained IP addresses
Select “Restrict key” under “API restrictions”
- In the modal, type “Perspective” in the filter field
- Select “Perspective Comment Analyzer API” from the search results
Save