Method: labels.list

List labels.

HTTP request

GET https://drivelabels.googleapis.com/v2/labels

The URL uses gRPC Transcoding syntax.

Query parameters

Parameters
publishedOnly

boolean

Whether to include only published labels in the results.

  • When true, only the current published label revisions are returned. Disabled labels are included. Returned label resource names reference the published revision (labels/{id}/{revisionId}).
  • When false, the current label revisions are returned, which might not be published. Returned label resource names don't reference a specific revision (labels/{id}).
languageCode

string

The BCP-47 language code to use for evaluating localized field labels. When not specified, values in the default configured language are used.

pageSize

integer

Maximum number of labels to return per page. Default: 50. Max: 200.

pageToken

string

The token of the page to return.

view

enum (LabelView)

When specified, only certain fields belonging to the indicated view are returned.

Union parameter access.

access can be only one of the following:

useAdminAccess

boolean

Set to true in order to use the user's admin credentials. This will return all Labels within the customer.

minimumRole

enum (LabelRole)

Specifies the level of access the user must have on the returned Labels. The minimum role a user must have on a label. Defaults to READER.

Request body

The request body must be empty.

Response body

If successful, the response body contains data with the following structure:

Response for listing Labels.

JSON representation
{
  "labels": [
    {
      object (Label)
    }
  ],
  "nextPageToken": string
}
Fields
labels[]

object (Label)

Labels.

nextPageToken

string

The token of the next page in the response.

Authorization Scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/drive.labels
  • https://www.googleapis.com/auth/drive.labels.readonly
  • https://www.googleapis.com/auth/drive.admin.labels
  • https://www.googleapis.com/auth/drive.admin.labels.readonly

For more information, see the OAuth 2.0 Overview.

LabelRole

Roles are concentric with subsequent role.

Enums
LABEL_ROLE_UNSPECIFIED Unknown role.
READER A reader can read the label and associated metadata applied to Drive items.
APPLIER An applier can write associated metadata on Drive items in which they also have write access to. Implies READER.
ORGANIZER An organizer can pin this label in shared drives they manage and add new appliers to the label.
EDITOR Editors can make any update including deleting the label which also deletes the associated Drive item metadata. Implies APPLIER.