Search for shared drives (admins-only)

    Use the drives.list method to search for drives in your organization.

    Search for all drives in an organization

    To search for all shared drives in the organization, set the useDomainAdminAccess parameter to true and call the drives.list method. If you do not set the useDomainAdminAccess parameter, only the shared drives for which the current user of your app is a member are returned.

    Search for specific drives in an organization (need to useDomainAdminAccess)

    To search for a specific set of shared drives, set the useDomainAdminAccess parameter to true and use the query string q with drives.list to filter the drives to return.

    A query contains three parts: a term, an operator and a value for the returned query result. This example shows a basic query:

    query_term operator values

    Where:

    • query_term is the query term or field to search upon. To identify which query terms can be used to filter shared drives, refer to Shared drive query terms.
    • operator specifies the condition for the query term. To identify which operators you can use with each query term, refer to Query operators.
    • values are the specific values you want to use to filter your search results.

    Query search examples

    The following table shows some basic search queries for shared drives:

    What you want to query Example
    Shared drives with no assigned organizer organizerCount = 01
    Shared drives with the word 'confidential' in the title and 20 or more members name contains 'confidential' and memberCount >= 20
    Shared drives created after June 1, 2017 createdDate > '2017-06-01T12:00:00'

    Query multiple terms with parentheses

    You can use parentheses to group multiple query terms together. For example, to search for shared drives created after a specific date and that either have more than 5 organizers or more than 20 members, use this query:

    createdDate > '2019-01-01T12:00:00' and (organizerCount > 5 or memberCount > 20)

    This search returns all shared drives created after January 1st, 2019 and that have more than 5 organizers or more than 20 members.

    Drive API evaluates and and or operators from left to right, so the same search without parentheses would return:

    • only shared drives with more than 5 organizers that were created after January 1st, 2019.
    • all shared drives with more than 20 members, even those created before January 1st, 2019.
    Was this page helpful?