ListAccessTokensCommand

Lists all personal access tokens (PATs) associated with the user who calls the API. You can only list PATs associated with your Amazon Web Services Builder ID.

Example Syntax

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

import { CodeCatalystClient, ListAccessTokensCommand } from "@aws-sdk/client-codecatalyst"; // ES Modules import
// const { CodeCatalystClient, ListAccessTokensCommand } = require("@aws-sdk/client-codecatalyst"); // CommonJS import
const client = new CodeCatalystClient(config);
const input = { // ListAccessTokensRequest
  maxResults: Number("int"),
  nextToken: "STRING_VALUE",
};
const command = new ListAccessTokensCommand(input);
const response = await client.send(command);
// { // ListAccessTokensResponse
//   items: [ // AccessTokenSummaries // required
//     { // AccessTokenSummary
//       id: "STRING_VALUE", // required
//       name: "STRING_VALUE", // required
//       expiresTime: new Date("TIMESTAMP"),
//     },
//   ],
//   nextToken: "STRING_VALUE",
// };

ListAccessTokensCommand Input

See ListAccessTokensCommandInput for more details

Parameter
Type
Description
maxResults
number | undefined

The maximum number of results to show in a single call to this API. If the number of results is larger than the number you specified, the response will include a NextToken element, which you can use to obtain additional results.

nextToken
string | undefined

A token returned from a call to this API to indicate the next batch of results to return, if any.

ListAccessTokensCommand Output

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.
items
Required
AccessTokenSummary[] | undefined

A list of personal access tokens (PATs) associated with the calling user identity.

nextToken
string | undefined

A token returned from a call to this API to indicate the next batch of results to return, if any.

Throws

Name
Fault
Details
AccessDeniedException
client

The request was denied because you don't have sufficient access to perform this action. Verify that you are a member of a role that allows this action.

ConflictException
client

The request was denied because the requested operation would cause a conflict with the current state of a service resource associated with the request. Another user might have updated the resource. Reload, make sure you have the latest data, and then try again.

ResourceNotFoundException
client

The request was denied because the specified resource was not found. Verify that the spelling is correct and that you have access to the resource.

ServiceQuotaExceededException
client

The request was denied because one or more resources has reached its limits for the tier the space belongs to. Either reduce the number of resources, or change the tier if applicable.

ThrottlingException
client

The request was denied due to request throttling.

ValidationException
client

The request was denied because an input failed to satisfy the constraints specified by the service. Check the spelling and input requirements, and then try again.

CodeCatalystServiceException
Base exception class for all service exceptions from CodeCatalyst service.