Google Directory

Manage your domain's users, connected devices, and third-party applications

Go to site
Explore
/
Apps
/
Google Directory

Google Directory API Integrations

Build and run workflows using the Google Directory API. Use 1000s of source-available triggers and actions across 1000+ apps. Or write custom code to integrate any app or API in seconds.

Overview

With the Google Directory API, you can:

  • List all users in your Google Apps domain
  • Get information about a specific user
  • Update a user's name, email address, and other profile information
  • Change a user's password
  • Suspend or delete a user
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import { axios } from "@pipedream/platform";

export default defineComponent({
  props: {
    google_directory: {
      type: "app",
      app: "google_directory",
    }
  },
  async run({steps, $}) {
    return axios($, {
      url: "https://admin.googleapis.com/admin/directory/v1/users",
      headers: {
        Authorization: `Bearer ${this.google_directory.$auth.oauth_access_token}`
      }
    });
  },
})

Authentication

Google Directory uses OAuth authentication. When you connect your Google Directory account, Pipedream will open a popup window where you can sign into Google Directory and grant Pipedream permission to connect to your account. Pipedream securely stores and automatically refreshes the OAuth tokens so you can easily authenticate any Google Directory API.

Pipedream requests the following authorization scopes when you connect your account:

emailprofilehttps://www.googleapis.com/auth/admin.directory.grouphttps://www.googleapis.com/auth/admin.directory.group.memberhttps://www.googleapis.com/auth/admin.directory.userhttps://www.googleapis.com/auth/admin.directory.user.alias
OAuth Request Configurations:
  1. authorization
    GEThttps://accounts.google.com/o/oauth2/auth?client_id={{oauth.client_id}}&redirect_uri={{oauth.redirect_uri}}&state={{oauth.state}}&response_type=code&scope={{oauth.space_separated_scopes}}&access_type=offline&prompt=consent
  2. accessToken
    POSThttps://oauth2.googleapis.com/tokencontent-type: application/x-www-form-urlencodedaccept: application/json
    client_id={{oauth.client_id}}&client_secret={{oauth.client_secret}}&redirect_uri={{oauth.redirect_uri}}&grant_type=authorization_code&code={{oauth.code}}
  3. refreshToken
    POSThttps://oauth2.googleapis.com/tokencontent-type: application/x-www-form-urlencodedaccept: application/json
    client_id={{oauth.client_id}}&client_secret={{oauth.client_secret}}&grant_type=refresh_token&refresh_token={{oauth.refresh_token}}