Skip to main content

tokens

Creates, updates, deletes, gets or lists a tokens resource.

Overview

Nametokens
TypeResource
Idgoogleadmin.directory.tokens

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
anonymousbooleanWhether the application is registered with Google. The value is true if the application has an anonymous Client ID.
clientIdstringThe Client ID of the application the token is issued to.
displayTextstringThe displayable name of the application the token is issued to.
etagstringETag of the resource.
kindstringThe type of the API resource. This is always admin#directory#token. (default: admin#directory#token)
nativeAppbooleanWhether the token is issued to an installed application. The value is true if the application is installed to a desktop or mobile device.
scopesarrayA list of authorization scopes the application is granted.
userKeystringThe unique ID of the user that issued the token.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectuserKey, clientIdGets information about an access token issued by a user.
listselectuserKeyReturns the set of tokens specified user has issued to 3rd party applications.
deletedeleteuserKey, clientIdDeletes all access tokens issued by a user for an application.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
clientIdstring
userKeystring

SELECT examples

Gets information about an access token issued by a user.

SELECT
anonymous,
clientId,
displayText,
etag,
kind,
nativeApp,
scopes,
userKey
FROM googleadmin.directory.tokens
WHERE userKey = '{{ userKey }}' -- required
AND clientId = '{{ clientId }}' -- required;

DELETE examples

Deletes all access tokens issued by a user for an application.

DELETE FROM googleadmin.directory.tokens
WHERE userKey = '{{ userKey }}' --required
AND clientId = '{{ clientId }}' --required;