tokens
Creates, updates, deletes, gets or lists a tokens
resource.
Overview
Name | tokens |
Type | Resource |
Id | googleadmin.directory.tokens |
Fields
The following fields are returned by SELECT
queries:
- get
- list
Successful response
Name | Datatype | Description |
---|---|---|
anonymous | boolean | Whether the application is registered with Google. The value is true if the application has an anonymous Client ID. |
clientId | string | The Client ID of the application the token is issued to. |
displayText | string | The displayable name of the application the token is issued to. |
etag | string | ETag of the resource. |
kind | string | The type of the API resource. This is always admin#directory#token . (default: admin#directory#token) |
nativeApp | boolean | Whether the token is issued to an installed application. The value is true if the application is installed to a desktop or mobile device. |
scopes | array | A list of authorization scopes the application is granted. |
userKey | string | The unique ID of the user that issued the token. |
Successful response
Name | Datatype | Description |
---|---|---|
etag | string | ETag of the resource. |
items | array | A list of Token resources. |
kind | string | The type of the API resource. This is always admin#directory#tokenList . (default: admin#directory#tokenList) |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
get | select | userKey , clientId | Gets information about an access token issued by a user. | |
list | select | userKey | Returns the set of tokens specified user has issued to 3rd party applications. | |
delete | delete | userKey , clientId | Deletes 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.
Name | Datatype | Description |
---|---|---|
clientId | string | |
userKey | string |
SELECT
examples
- get
- list
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;
Returns the set of tokens specified user has issued to 3rd party applications.
SELECT
etag,
items,
kind
FROM googleadmin.directory.tokens
WHERE userKey = '{{ userKey }}' -- required;
DELETE
examples
- delete
Deletes all access tokens issued by a user for an application.
DELETE FROM googleadmin.directory.tokens
WHERE userKey = '{{ userKey }}' --required
AND clientId = '{{ clientId }}' --required;