Skip to main content

NIM

Google Workspace

Google Workspace is a cloud-based suite of productivity and collaboration tools aimed at facilitating communication and teamwork within organizations. It includes applications such as Gmail, Google Drive, Google Docs, Sheets, Slides, Meet, Calendar, Forms, Chat, and Sites. The suite is designed to provide a seamless and integrated environment for users to collaborate on documents, hold virtual meetings, manage calendars, and share information, enhancing overall productivity and communication.

About

Vendor

Google

Product

Workspace

Integration Type

REST

Links

github-mark.png
IntegrationConfig.png

Table

Key

Read

Create

Update

Delete

Chrome OS Devices

deviceId

GreenCheckMark.png
RedCheckmark.png
GreenCheckMark.png
RedCheckmark.png

Classroom Courses

id

GreenCheckMark.png
GreenCheckMark.png
GreenCheckMark.png
GreenCheckMark.png

Classroom Course Aliases

alias

GreenCheckMark.png
GreenCheckMark.png
RedCheckmark.png
GreenCheckMark.png

Classroom Course Students

courseId

GreenCheckMark.png
GreenCheckMark.png
RedCheckmark.png
GreenCheckMark.png

Classroom Course Teachers

courseId

GreenCheckMark.png
GreenCheckMark.png
RedCheckmark.png
GreenCheckMark.png

Classroom Invitations

id

GreenCheckMark.png
GreenCheckMark.png
RedCheckmark.png
GreenCheckMark.png

Classroom User Profiles Guardian Invitations

invitationId

GreenCheckMark.png
GreenCheckMark.png
RedCheckmark.png
RedCheckmark.png

Custom Fields

schemaId

GreenCheckMark.png
RedCheckmark.png
RedCheckmark.png
RedCheckmark.png

Classroom User Profiles Guardians

guardianId

GreenCheckMark.png
RedCheckmark.png
RedCheckmark.png
GreenCheckMark.png

Data Transfers

id

GreenCheckMark.png
GreenCheckMark.png
RedCheckmark.png
RedCheckmark.png

Drives

id

GreenCheckMark.png
GreenCheckMark.png
RedCheckmark.png
GreenCheckMark.png

Groups

id

GreenCheckMark.png
GreenCheckMark.png
GreenCheckMark.png
GreenCheckMark.png

Groups Aliases

id

GreenCheckMark.png
GreenCheckMark.png
RedCheckmark.png
GreenCheckMark.png

Groups Settings

email

GreenCheckMark.png
RedCheckmark.png
GreenCheckMark.png
RedCheckmark.png

Licenses

skuId

GreenCheckMark.png
RedCheckmark.png
RedCheckmark.png
RedCheckmark.png

License Assignments

--

GreenCheckMark.png
GreenCheckMark.png
RedCheckmark.png
GreenCheckMark.png

Members

--

GreenCheckMark.png
GreenCheckMark.png
RedCheckmark.png
GreenCheckMark.png

Managers

--

GreenCheckMark.png
GreenCheckMark.png
RedCheckmark.png
GreenCheckMark.png

Owners

--

GreenCheckMark.png
GreenCheckMark.png
RedCheckmark.png
GreenCheckMark.png

Mobile Devices

resourceId

GreenCheckMark.png
RedCheckmark.png
RedCheckmark.png
GreenCheckMark.png

Org Units

orgUnitId

GreenCheckMark.png
GreenCheckMark.png
GreenCheckMark.png
GreenCheckMark.png

Privileges

serviceId

GreenCheckMark.png
RedCheckmark.png
RedCheckmark.png
RedCheckmark.png

Role Assignments

roleAssignmentId

GreenCheckMark.png
GreenCheckMark.png
RedCheckmark.png
GreenCheckMark.png

Roles

roleId

GreenCheckMark.png
RedCheckmark.png
RedCheckmark.png
RedCheckmark.png

Users

id

GreenCheckMark.png
GreenCheckMark.png
GreenCheckMark.png
GreenCheckMark.png

Users Aliases

id

GreenCheckMark.png
GreenCheckMark.png
RedCheckmark.png
GreenCheckMark.png

Users ASPS

id

GreenCheckMark.png
RedCheckmark.png
RedCheckmark.png
GreenCheckMark.png

Users Gmail Settings AutoForwarding

user_id

GreenCheckMark.png
RedCheckmark.png
GreenCheckMark.png
RedCheckmark.png

Users Gmail Settings Delegates

user_id

GreenCheckMark.png
GreenCheckMark.png
RedCheckmark.png
GreenCheckMark.png

Users Gmail Settings Forwarding Addresses

user_id

GreenCheckMark.png
GreenCheckMark.png
RedCheckmark.png
GreenCheckMark.png

Users Gmail Settings IMAP

user_id

GreenCheckMark.png
RedCheckmark.png
GreenCheckMark.png
RedCheckmark.png

Users Gmail Settings Language

user_id

GreenCheckMark.png
RedCheckmark.png
GreenCheckMark.png
RedCheckmark.png

Users Gmail Settings POP

user_id

GreenCheckMark.png
RedCheckmark.png
GreenCheckMark.png
RedCheckmark.png

Users Gmail Settings Send As

user_id

GreenCheckMark.png
GreenCheckMark.png
GreenCheckMark.png
GreenCheckMark.png

Users Gmail Settings Vacation

user_id

GreenCheckMark.png
RedCheckmark.png
GreenCheckMark.png
RedCheckmark.png

Users Tokens

user_id

GreenCheckMark.png
RedCheckmark.png
RedCheckmark.png
GreenCheckMark.png

Users Verification Codes

userId

GreenCheckMark.png
GreenCheckMark.png
RedCheckmark.png
GreenCheckMark.png

Referencing Table

Foreign Key

Parent table

Primary Key

  1. Go to Systems > Overview.

    2023-10-12_11-00-21.jpg
  2. Click Add.

  3. Select Google for System Type.

  4. Enter a System Name.

    2021-07-08_12-01-54.png
  5. Click Save.

  6. The new system is added to the Configured Systems pane.

    2021-07-08_12-05-13.png
  7. In a new tab, go to the Google Cloud Platform console at https://console.cloud.google.com/.

  8. Create a new project named NIMproject and switch to it.

  9. Open Cloud Shell

  10. Run the following commands

    • gcloud services enable admin.googleapis.com

    • gcloud services enable groupssettings.googleapis.com

    • gcloud services enable licensing.googleapis.com

    • gcloud services enable drive.googleapis.com

    • gcloud services enable gmail.googleapis.com

    • gcloud services enable classroom.googleapis.com

  11. Expand the menu and go to APIs & Services > OAuth Consent Screen.

  12. Select the Internal user type and click Create. Enter NIM for the App Name. Enter a relevant User Support Email and Developer Email Address. Click Save And Continue.

  13. On the Scopes page, click Save And Continue.

  14. On the Summary page, click Back To Dashboard.

  15. Expand the menu and go to APIs & Services > Credentials.

  16. Click Create Credentials > Service Account.

  17. For the Service Account Name, enter NIM. Accept the default generated Service Account ID value. Click Create and Continue. Click Done.

  18. Click the pencil icon to edit the newly created NIM service account. On the Details tab, Copy the Email and Unique ID to a local text editor application.

  19. Go to the Keys tab. Click Add Key > Create New Key. Select P12. Click Create. The .p12 file is downloaded. Copy the Private Key Password (notasecret) to a local text editor application. Click Close.

  20. Go to the Google Admin Console at https://admin.google.com/.

  21. Go to Security > Access > API Controls.

  22. Click Manage Domain-Wide Delegation.

  23. Click Add New.

  24. Paste the Unique ID you copied earlier into the Client ID field.

  25. In the OAuth Scopes (Comma-Delimited) field

    https://www.googleapis.com/auth/admin.directory.device.chromeos,https://www.googleapis.com/auth/admin.directory.user,https://www.googleapis.com/auth/admin.directory.group,https://www.googleapis.com/auth/admin.directory.orgunit,https://www.googleapis.com/auth/apps.licensing,https://www.googleapis.com/auth/admin.directory.user.security,https://www.googleapis.com/auth/classroom.courses,https://www.googleapis.com/auth/classroom.rosters,https://www.googleapis.com/auth/classroom.guardianlinks.students,https://www.googleapis.com/auth/gmail.settings.basic,https://www.googleapis.com/auth/gmail.settings.sharing,https://www.googleapis.com/auth/admin.directory.device.mobile,https://www.googleapis.com/auth/apps.groups.settings,https://www.googleapis.com/auth/admin.datatransfer,https://www.googleapis.com/auth/drive,https://www.googleapis.com/auth/admin.directory.userschema
  26. Click Authorize. The new OAuth application is added with the scopes.

  27. Go to Account > Account Settings > Copy Customer ID

  28. Return to your NIM browser tab. Add a certificate using the .p12 certificate you downloaded earlier, and the password you copied (notasecret). Name the certificate Google.

  29. In NIM, edit the Google system you created previously. See Edit a system.

  30. For the Application (Client) ID, paste the service account Email you copied previously. For the Directory (Tenant) ID, enter the email address you use to log in to Google Cloud Platform. For the Certificate, select the Google certificate you just added. For Customer ID, paste the Customer ID you copied previously.

    2021-07-15_14-44-39.png
  31. Click Save.

  32. Click Test Connection. A success message is returned.

    2021-05-17_10-00-11.png
Add Custom Schema Fields to Google Workspace

Google Workspace offers the capability to extend its user management features by adding custom schema fields to user profiles. These fields are particularly useful for storing specialized information, which can be selectively visible across the organization. They are instrumental in automating various aspects of user account management, especially in tracking the lifecycle of an employee within the company. Custom schema fields provide a tailored approach to handle specific data needs that are not covered by the default user attributes.

For those interested in exploring this feature further, comprehensive information and guidelines on custom schemas in Google Workspace can be found at this link: Google Workspace Custom Schemas. This resource provides valuable insights into how to effectively utilize custom schema fields to optimize your organization’s user account management processes.

  1. Open the Developer API console and use the below values for the customerId and Request Body values and then press Execute. If prompted, allow access for the application to execute the command. You should see a response payload show up once the command has finished.

  2. Specify the following request parameters

    customerId = my_customer
  3. Define the following request body

    {
      "fields": [
        {
          "fieldName": "ID",
          "fieldType": "STRING",
          "readAccessType": "ADMINS_AND_SELF",
          "multiValued": false,
          "displayName": "ID"
        },
        {
          "fieldName": "Type",
          "fieldType": "STRING",
          "readAccessType": "ADMINS_AND_SELF",
          "multiValued": false,
          "displayName": "Type"
        },
        {
          "fieldName": "DeleteDate",
          "fieldType": "STRING",
          "readAccessType": "ADMINS_AND_SELF",
          "multiValued": false,
          "displayName": "DeleteDate"
        }
      ],
      "schemaName": "Tools4ever",
      "displayName": "Tools4ever"
    }
  4. Click Execute. After execution the request should be successful and the fields should have been created.

Add Google Workspace Custom Schema Fields to System

Given that Google Workspace Custom Schema Fields are uniquely tailored to each specific tenant, it's required to configure NIM accordingly. This involves informing NIM about the existence and details of these custom fields. By doing so, you enable NIM to accurately import this data into the user table of the configured system. This step is essential for ensuring that NIM recognizes and correctly handles the custom attributes defined in your Google Workspace tenant. Proper configuration guarantees seamless integration and efficient management of user data between Google Workspace and NIM.

NIM imports custom fields with the name format of customSchemas_[schemaName]_[fieldName]

After creating the custom attributes, update the Settings of the Google Workspace Users table in NIM to include the customSchemas_Tools4ever_<fieldName> fields.

GoogleWorkspaceCustomSchemaNIM.png
  1. Save the CustomSchema.json file into the NIM server at C:\ProgramData\Tools4ever\NIM\config\rest\systems. The "Rest" folder path may not exist by default - be sure to create it if needed.

    {
      "schema": {
        "crud_objects": {
          "users": {
            "resources": {
              "customSchemas": {
                "Tools4ever": {
                  "ID": "_:string*",
                  "Type": "_:string*",
                  "DeleteDate": "_:string*"
                }
              }
            }
          }
        }
      }
    }
  2. Rename the file to match your Google system name in NIM. For example, my Google system in NIM is called GoogleWorkspace so my CustomSchema.json file should be named GoogleWorkspace.json

  3. If you used different attribute names in the Google console then update the names from the defaults in the CustomSchema.json file to match the correct names.