- Navigation GuideYou are on a Command (operation) page with structural examples. Use the navigation breadcrumb if you would like to return to the Client landing page.
ListHandshakesForOrganizationCommand
Lists the handshakes that are associated with the organization that the requesting user is part of. The ListHandshakesForOrganization
operation returns a list of handshake structures. Each structure contains details and status about a handshake.
Handshakes that are ACCEPTED
, DECLINED
, CANCELED
, or EXPIRED
appear in the results of this API for only 30 days after changing to that state. After that, they're deleted and no longer accessible.
Always check the NextToken
response parameter for a null
value when calling a List*
operation. These operations can occasionally return an empty set of results even when there are more results available. The NextToken
response parameter value is null
only when there are no more results to display.
This operation can be called only from the organization's management account or by a member account that is a delegated administrator for an Amazon Web Services service.
Example Syntax
Use a bare-bones client and the command you need to make an API call.
import { OrganizationsClient, ListHandshakesForOrganizationCommand } from "@aws-sdk/client-organizations"; // ES Modules import
// const { OrganizationsClient, ListHandshakesForOrganizationCommand } = require("@aws-sdk/client-organizations"); // CommonJS import
const client = new OrganizationsClient(config);
const input = { // ListHandshakesForOrganizationRequest
Filter: { // HandshakeFilter
ActionType: "INVITE" || "ENABLE_ALL_FEATURES" || "APPROVE_ALL_FEATURES" || "ADD_ORGANIZATIONS_SERVICE_LINKED_ROLE",
ParentHandshakeId: "STRING_VALUE",
},
NextToken: "STRING_VALUE",
MaxResults: Number("int"),
};
const command = new ListHandshakesForOrganizationCommand(input);
const response = await client.send(command);
// { // ListHandshakesForOrganizationResponse
// Handshakes: [ // Handshakes
// { // Handshake
// Id: "STRING_VALUE",
// Arn: "STRING_VALUE",
// Parties: [ // HandshakeParties
// { // HandshakeParty
// Id: "STRING_VALUE", // required
// Type: "ACCOUNT" || "ORGANIZATION" || "EMAIL", // required
// },
// ],
// State: "REQUESTED" || "OPEN" || "CANCELED" || "ACCEPTED" || "DECLINED" || "EXPIRED",
// RequestedTimestamp: new Date("TIMESTAMP"),
// ExpirationTimestamp: new Date("TIMESTAMP"),
// Action: "INVITE" || "ENABLE_ALL_FEATURES" || "APPROVE_ALL_FEATURES" || "ADD_ORGANIZATIONS_SERVICE_LINKED_ROLE",
// Resources: [ // HandshakeResources
// { // HandshakeResource
// Value: "STRING_VALUE",
// Type: "ACCOUNT" || "ORGANIZATION" || "ORGANIZATION_FEATURE_SET" || "EMAIL" || "MASTER_EMAIL" || "MASTER_NAME" || "NOTES" || "PARENT_HANDSHAKE",
// Resources: [
// {
// Value: "STRING_VALUE",
// Type: "ACCOUNT" || "ORGANIZATION" || "ORGANIZATION_FEATURE_SET" || "EMAIL" || "MASTER_EMAIL" || "MASTER_NAME" || "NOTES" || "PARENT_HANDSHAKE",
// Resources: "<HandshakeResources>",
// },
// ],
// },
// ],
// },
// ],
// NextToken: "STRING_VALUE",
// };
Example Usage
ListHandshakesForOrganizationCommand Input
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
Filter | HandshakeFilter | undefined | A filter of the handshakes that you want included in the response. The default is all types. Use the |
MaxResults | number | undefined | The total number of results that you want included on each page of the response. If you do not include this parameter, it defaults to a value that is specific to the operation. If additional items exist beyond the maximum you specify, the |
NextToken | string | undefined | The parameter for receiving additional results if you receive a |
ListHandshakesForOrganizationCommand Output
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
$metadata Required | ResponseMetadata | Metadata pertaining to this request. |
Handshakes | Handshake[] | undefined | A list of Handshake objects with details about each of the handshakes that are associated with an organization. |
NextToken | string | undefined | If present, indicates that more output is available than is included in the current response. Use this value in the |
Throws
Name | Fault | Details |
---|
Name | Fault | Details |
---|---|---|
AccessDeniedException | client | You don't have permissions to perform the requested operation. The user or role that is making the request must have at least one IAM permissions policy attached that grants the required permissions. For more information, see Access Management in the IAM User Guide. |
AWSOrganizationsNotInUseException | client | Your account isn't a member of an organization. To make this request, you must use the credentials of an account that belongs to an organization. |
ConcurrentModificationException | client | The target of the operation is currently being modified by a different request. Try again later. |
InvalidInputException | client | The requested operation failed because you provided invalid values for one or more of the request parameters. This exception includes a reason that contains additional information about the violated limit: Some of the reasons in the following list might not be applicable to this specific API or operation.
|
ServiceException | server | Organizations can't complete your request because of an internal service error. Try again later. |
TooManyRequestsException | client | You have sent too many requests in too short a period of time. The quota helps protect against denial-of-service attacks. Try again later. For information about quotas that affect Organizations, see Quotas for Organizations in the Organizations User Guide. |
OrganizationsServiceException | Base exception class for all service exceptions from Organizations service. |