Set up the OAuth application on the Google Sheets API

  • 릴리스 버전: Australia
  • 업데이트 날짜 2026년 03월 12일
  • 소요 시간: 6분
  • Set up the OAuth application on the Google Sheets API so that you can authenticate requests from your ServiceNow instance to access Google Sheets.

    시작하기 전에

    • Create a business account on https://console.developers.google.com/.
    • Create a domain and an email address that is associated with the domain. For example, www.mydomain.com and jane-admin@mydomain.com.
      주:
      You can register only one email address per domain in Google Workspace.
    • Role required: admin

    이 태스크 정보

    Setting up the OAuth application on the Google Sheets API enables you to access and update spreadsheets securely from your instance. For example, if you're exporting incident records from the ServiceNow instance to a Google Sheet, OAuth ensures that the system has permission to create or update the sheet on your behalf, without needing you to log in manually each time.

    프로시저

    1. Navigate to Google Workspace and set up a project.
      The project includes the details of the OAuth application and the API permissions, if applicable.
      1. Log in to https://console.developers.google.com/ with the same domain email ID and password as mentioned in the prerequisites.
      2. In the Google Cloud Console, select Select a project.

        Creating a project on Google Workspace.

      3. In the Search projects and folders field, select New project.
        Creating a new project on Google Workspace.
      4. In the Project name* field, enter a unique name for the project.
      5. In the Location* field, select Browse and then select an organization.
      6. Select Create.
        The project is created and appears in the Notifications box.
    2. Enable the Google Sheets API.

      Project selection on Google Sheets API.

      1. Open the project that you created in step 1.
        The API and services dashboard page opens for the selected project.
      2. In the search box, enter Google Drive.
      3. From the search results list, select Google Drive API.
        Searching for Google Drive API.
      4. Select Enable.
        The Google Drive APIs are enabled on your project.
    3. Create the OAuth app and credentials.
      1. In the Enabled APIs & services dashboard, select Create credentials.
        The Create credentials page is displayed.

        Create credentials button in the Google workspace.

      2. In the Credential Type section, select User data and then select Next.
        Create credentials form displays in the APIs & Services dashboard in Google Workspace.
      3. On the form in the OAuth Consent, fill in the fields.
        표 1. OAuth Consent Screen form
        Field Description
        App name Name of the OAuth app.
        User support email Email at which users can send queries to you about their consent.
        Logo file to upload Logo representing the OAuth app.
        Developer contact information Developer to contact for changes to the project.
      4. Select Save and continue.
    4. In the Scopes section, define the API scopes.
      API scopes enable you to select specific APIs. For example, the /auth/spreadsheets scope enables you to create, edit, or remove spreadsheets.
      1. Select Add or remove scopes.
        Adding or removing scopes in the Scopes section of the Create credentials form.
      2. In the Update selected scopes list, search for Google Drive API, and then select the .../auth/drive.file scope.
        Selecting a file for the Google Drive API scope.
      3. Select Update and then select Save and continue.
      The API scope is selected.
    5. In the OAuth Client ID section, create the OAuth client ID.
      1. From the Application type* list, select Web application.
      2. In the Name* field, enter a unique name for the OAuth client.
    6. On the Authorized redirect URIs heading, select + ADD URI.
    7. In the URI field, enter the redirect URI in the following format: https://instance.service-now.com/oauth_redirect.do.
    8. Select Create.
      The OAuth details are generated in a JSON file.
      팁:
      Select DOWNLOAD to download the JSON file for later reference.

      Downloading the OAuth credentials file.

    9. Select Done.
      The OAuth application on Google Workspace is created.
    10. Configure the audience allowed to access Google Sheets API.
      For example, your audience is the ServiceNow instance.
      1. In the APIs & Services dashboard menu, select OAuth consent screen and then select Audience.
      2. In the User type section, select External and add the user that you want to give access to the instance.

    결과

    The OAuth application is enabled to authenticate the access of Google Sheets from your instance.

    다음에 수행할 작업

    To enable OAuth authorization for exporting table records to Google Sheets, register the Google Drive application in your instance. For more information, see Create an application registry for Google Sheets on a ServiceNow instance.