Google Directory Read
In this article
- 1 Overview
- 2 Snap Views
- 3 Snap Settings
- 3.1.1 Supported Filter Attributes by Resource
- 3.1.1.1 User
- 3.1.1.2 User.Photo
- 3.1.1.3 OrgUnit
- 3.1.1.4 Group
- 3.1.1 Supported Filter Attributes by Resource
- 3.2 Troubleshooting
- 3.3 Examples
Overview
You can use this Snap to read the data of the Users, User photos, Groups and Org units from the Google Directory.
Verify that you have the correct Application scope defined for your account. See Google Directory Application Scope for more information.
Access tokens for Google Directory accounts expire in one hour.
Snap Type
The Google Directory Read Snap is a Write-type Snap.
Prerequisites
A valid account with the required permissions.
Support for Ultra Pipelines
Works in Ultra Pipelines.
Snap Views
Type | Format | Number of Views | Examples of Upstream and Downstream Snaps | Description |
|---|---|---|---|---|
Input | Document
|
|
| Resource type and Filter attributes(Filter keys, Filter values) |
Output | Document
|
|
| The data for the resource type provided. |
Error | Error handling is a generic way to handle errors without losing data or failing the Snap execution. You can handle the errors that the Snap might encounter while running the Pipeline by choosing one of the following options from the When errors occur list under the Views tab:
Learn more about Error handling in Pipelines. | |||
Snap Settings
Asterisk ( * ): Indicates a mandatory field.
Suggestion icon (): Indicates a list that is dynamically populated based on the configuration.
Expression icon ( ): Indicates the value is an expression (if enabled) or a static value (if disabled). Learn more about Using Expressions in SnapLogic.
Add icon ( ): Indicates that you can add fields in the fieldset.
Remove icon ( ): Indicates that you can remove fields from the fieldset.
Upload icon ( ): Indicates that you can upload files.
Field Name | Field Type | Description | |
|---|---|---|---|
Label*
| String | Specify a unique name for the Snap. You can modify this to be more specific, especially if you have more than one of the same Snap in your Pipeline. Default Value: Google Directory Read | |
Resource
| Dropdown | Required. The type of resource to be created. The options available include:
Default value: user | |
Filter Attributes | Use this field set to list the attributes to return the search results. | ||
Filter Keys
| String/Expression/Suggestion | The suggested filter attributes based on the provided Resource Type selected. Default value: user | |
Filter values
| String/Expression/Suggestion | The corresponding values of the suggested filter key to read the resource. Default value: user | |
On empty result
| Dropdown | Specify or select the Snap behavior when no matching filter value is found. The available options are: Ignore: Select this option if you do not require an output document. Error: Select this option if you want to send an error document to the error view. Output: Select this option if you want an empty output document.
Default value: None | |
| Dropdown list |
| |
Supported Filter Attributes by Resource
User
userKey - Required for Users Get API. Set the expression toggle (=) off and enter the userKey.
domain - Optional. Set the expression toggle (=) off and enter the domain.
showDeleted - Optional. Set the expression toggle (=) off and enter true | false.
fields - Optional. Set the expression toggle (=) off and list the fields to return, separated by a comma. See the API documentation referenced at the bottom of the page for the complete list of fields.
query - Optional. Set the expression toggle (=) off and enter the query without quotation marks.
maxResults - Optional. Set the expression toggle (=) off and enter an integer (1 to 500, inclusive).
customer - Set the expression toggle (=) off and enter the customerID. If you are an account administrator, you can use the my_customer alias with the expression toggle off.
projection - Optional. Set the expression toggle (=) off and enter
customorfullin the Filter value field to retrieve the schema field.customFieldMask - Optional. Set the expression toggle (=) off and list the custom fields to retrieve custom schema fields.
User.Photo
userKey - Required. Set the expression toggle (=) off and enter the userKey.
OrgUnit
customerID - Required. Set the expression toggle (=) off and enter the customerID.
GetOrgUnitPath - Required to call the OrgUnits Get API. Set the expression toggle (=) off and list the name of the org without a preceding slash (that is, TestOrg instead of /TestOrg).
ListOrgUnitPath - Required to call the OrgUnits List API. Set the expression toggle (=) off and list the name of the org without a preceding slash (that is, TestOrg instead of /TestOrg).
type - An optional parameter from the OrgUnits List API. Set the expression toggle (=) off and enter all | children.
fields - An optional parameter for either the OrgUnits Get API or the OrgUnits List API. Set the expression toggle (=) off and list the fields to return, separated by a comma. See the API documentation referenced at the bottom of the page for the complete list of fields.
Group
groupKey - Required for Groups Get API. Set the expression toggle (=) off and enter the groupKey.
customer - Set the expression toggle (=) off and enter the customerID. If you are an account administrator, you can use the my_customer alias with the expression toggle off.
domain - Optional. Set the expression toggle (=) off and enter the domain.
maxResults - Optional. Set the expression toggle (=) off and enter an integer.
fields - Optional. Set the expression toggle (=) off and list the fields to return, separated by a comma. See the API documentation referenced at the bottom of the page for the complete list of fields.
userKey - Optional. Set the expression toggle (=) off and enter the userKey. Returns all groups to which this user belongs.
Troubleshooting
Error | Reason | Resolution |
|---|---|---|
|
| Provide the customerID as Google Service Account is not associated with any customer. Ensure that the scope is correctly defined for the action/resource being executed. |
| Either provide customer or domain information as Google Service Account is not associated with any customer or domain. |
Examples
Perform End-to-End Operations in Google Directory.
The following tables provides sample:
Resource | Filter key | Filter value | Result |
|---|---|---|---|
userPhoto | userkey | (expression toggle (=) off) user@example.com | Returns the resource data for the user's photo. |
user | [None] | [None] | Returns all users. |
user | domain | (expression toggle (=) off) example.com | Returns all users within the specified domain. |
user | showDeleted | (expression toggle (=) off) true | Returns deleted users. |
user | customer | (expression toggle (=) off) my_customer | Returns all users for the customer ID if the account is an account administrator. |
user | fields | (expression toggle (=) off) users(aliases,name,primaryEmail) | Returns the name, primary email and email aliases for all users. |
user | query | (expression toggle (=) off) isAdmin=true | Returns all admins. |
user | query | (expression toggle (=) off) givenName:Tim* | Returns all users whose givenName starts with Tim. |
orgunit | fields | (expression toggle (=) off) kind,name,orgUnitPath | Returns kind,name,orgUnitPath fields of the orgunits. |
Related links:
For users:
For user photo: https://developers.google.com/admin-sdk/directory/reference/rest/v1/users.photos/get
For groups:
For org units:
Have feedback? Email documentation@snaplogic.com | Ask a question in the SnapLogic Community
© 2017-2025 SnapLogic, Inc.