GetPersonalAccessTokenMetadataCommand

Requests details of a specific Personal Access Token within the WorkMail organization.

Example Syntax

Use a bare-bones client and the command you need to make an API call.

import { WorkMailClient, GetPersonalAccessTokenMetadataCommand } from "@aws-sdk/client-workmail"; // ES Modules import
// const { WorkMailClient, GetPersonalAccessTokenMetadataCommand } = require("@aws-sdk/client-workmail"); // CommonJS import
const client = new WorkMailClient(config);
const input = { // GetPersonalAccessTokenMetadataRequest
  OrganizationId: "STRING_VALUE", // required
  PersonalAccessTokenId: "STRING_VALUE", // required
};
const command = new GetPersonalAccessTokenMetadataCommand(input);
const response = await client.send(command);
// { // GetPersonalAccessTokenMetadataResponse
//   PersonalAccessTokenId: "STRING_VALUE",
//   UserId: "STRING_VALUE",
//   Name: "STRING_VALUE",
//   DateCreated: new Date("TIMESTAMP"),
//   DateLastUsed: new Date("TIMESTAMP"),
//   ExpiresTime: new Date("TIMESTAMP"),
//   Scopes: [ // PersonalAccessTokenScopeList
//     "STRING_VALUE",
//   ],
// };

GetPersonalAccessTokenMetadataCommand Input

Parameter
Type
Description
OrganizationId
Required
string | undefined

The Organization ID.

PersonalAccessTokenId
Required
string | undefined

The Personal Access Token ID.

GetPersonalAccessTokenMetadataCommand Output

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.
DateCreated
Date | undefined

The date when the Personal Access Token ID was created.

DateLastUsed
Date | undefined

The date when the Personal Access Token ID was last used.

ExpiresTime
Date | undefined

The time when the Personal Access Token ID will expire.

Name
string | undefined

The Personal Access Token name.

PersonalAccessTokenId
string | undefined

The Personal Access Token ID.

Scopes
string[] | undefined

Lists all the Personal Access Token permissions for a mailbox.

UserId
string | undefined

The WorkMail User ID.

Throws

Name
Fault
Details
InvalidParameterException
client

One or more of the input parameters don't match the service's restrictions.

OrganizationNotFoundException
client

An operation received a valid organization identifier that either doesn't belong or exist in the system.

OrganizationStateException
client

The organization must have a valid state to perform certain operations on the organization or its members.

ResourceNotFoundException
client

The resource cannot be found.

WorkMailServiceException
Base exception class for all service exceptions from WorkMail service.