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}).
customer

string

The customer to scope this list request to. For example: "customers/abcd1234". If unset, will return all labels within the current customer.

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

Response for listing Labels.

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

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 Authorization guide.