Skip to main content

Getting and Restricting your API Key

 Preview of a API key being aquired

Perspective API Key

  1. Your API Key can be obtained from Google Developer Console

  2. If you already have a project created for your site, skip to step 5 to retrieve your ID, then continue to step 6.

  3. 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

    1. In the following modal, click “New project”
    2. Enter a comprehensive project name, and organize your project appropriately
  4. After saving the project, click the active project dropdown in the top navigation bar next to the “Google APIs” logo

  5. In the following modal, copy the “ID” of your newly created project and store it for later

  6. Select your newly created project

  7. Head to the following form: https://docs.google.com/forms/d/e/1FAIpQLSdhBBnVVVbXSElby-jhNnEj-Zwpt5toQSCFsJerGfpXW66CuQ/viewform

    1. Provide information about your project
    2. When asked for your Google Cloud Project (GCP) ID, paste the ID obtained in step 5
    3. Submit your access request and wait for email confirmation before continuing
    4. Once you have received confirmation that your access to the Perspective API has been approved, head back to your developer console (see step 1)
  8. Once again select your project from the top navigation bar

  9. Select “Dashboard” from the left hand navigation

  10. Click “Enable APIs and services” on the top below the navigation bar

  11. Search for “Perspective” in the search bar above the following list, and select “Perspective Comment Analyzer API” from the search results

  12. 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

  13. Select “Credentials” from the left hand navigation bar

  14. Select” Create credentials” from the sub navigation bar

  15. Select “API key” to proceed to the next screen

  16. Copy your API key and store it for later use

  17. If you are setting up a clients site, continue to “How to properly restrict an API key” below and click “Restrict key”, otherwise continue

  18. 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

  1. Retrieve your client’s server’s IP address

  2. Return to the Google Developer Console API key restriction page

  3. Set “Application restrictions” to “IP addresses”

    1. Click “add an item” under “Accept requests from these server IP addresses”
    2. Provide your previously obtained IP address and click “done”
    3. Repeat a through b for all obtained IP addresses
  4. Select “Restrict key” under “API restrictions”

    1. In the modal, type “Perspective” in the filter field
    2. Select “Perspective Comment Analyzer API” from the search results
  5. Save

 Preview of a API key being restricted