GetCurrentUserDataCommand

Gets the real-time active user data from the specified Amazon Connect instance.

Example Syntax

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

import { ConnectClient, GetCurrentUserDataCommand } from "@aws-sdk/client-connect"; // ES Modules import
// const { ConnectClient, GetCurrentUserDataCommand } = require("@aws-sdk/client-connect"); // CommonJS import
const client = new ConnectClient(config);
const input = { // GetCurrentUserDataRequest
  InstanceId: "STRING_VALUE", // required
  Filters: { // UserDataFilters
    Queues: [ // Queues
      "STRING_VALUE",
    ],
    ContactFilter: { // ContactFilter
      ContactStates: [ // ContactStates
        "INCOMING" || "PENDING" || "CONNECTING" || "CONNECTED" || "CONNECTED_ONHOLD" || "MISSED" || "ERROR" || "ENDED" || "REJECTED",
      ],
    },
    RoutingProfiles: [ // RoutingProfiles
      "STRING_VALUE",
    ],
    Agents: [ // AgentsMinOneMaxHundred
      "STRING_VALUE",
    ],
    UserHierarchyGroups: [ // UserDataHierarchyGroups
      "STRING_VALUE",
    ],
  },
  NextToken: "STRING_VALUE",
  MaxResults: Number("int"),
};
const command = new GetCurrentUserDataCommand(input);
const response = await client.send(command);
// { // GetCurrentUserDataResponse
//   NextToken: "STRING_VALUE",
//   UserDataList: [ // UserDataList
//     { // UserData
//       User: { // UserReference
//         Id: "STRING_VALUE",
//         Arn: "STRING_VALUE",
//       },
//       RoutingProfile: { // RoutingProfileReference
//         Id: "STRING_VALUE",
//         Arn: "STRING_VALUE",
//       },
//       HierarchyPath: { // HierarchyPathReference
//         LevelOne: { // HierarchyGroupSummaryReference
//           Id: "STRING_VALUE",
//           Arn: "STRING_VALUE",
//         },
//         LevelTwo: {
//           Id: "STRING_VALUE",
//           Arn: "STRING_VALUE",
//         },
//         LevelThree: {
//           Id: "STRING_VALUE",
//           Arn: "STRING_VALUE",
//         },
//         LevelFour: {
//           Id: "STRING_VALUE",
//           Arn: "STRING_VALUE",
//         },
//         LevelFive: {
//           Id: "STRING_VALUE",
//           Arn: "STRING_VALUE",
//         },
//       },
//       Status: { // AgentStatusReference
//         StatusStartTimestamp: new Date("TIMESTAMP"),
//         StatusArn: "STRING_VALUE",
//         StatusName: "STRING_VALUE",
//       },
//       AvailableSlotsByChannel: { // ChannelToCountMap
//         "<keys>": Number("int"),
//       },
//       MaxSlotsByChannel: {
//         "<keys>": Number("int"),
//       },
//       ActiveSlotsByChannel: {
//         "<keys>": Number("int"),
//       },
//       Contacts: [ // AgentContactReferenceList
//         { // AgentContactReference
//           ContactId: "STRING_VALUE",
//           Channel: "VOICE" || "CHAT" || "TASK" || "EMAIL",
//           InitiationMethod: "INBOUND" || "OUTBOUND" || "TRANSFER" || "QUEUE_TRANSFER" || "CALLBACK" || "API" || "DISCONNECT" || "MONITOR" || "EXTERNAL_OUTBOUND" || "WEBRTC_API" || "AGENT_REPLY" || "FLOW",
//           AgentContactState: "INCOMING" || "PENDING" || "CONNECTING" || "CONNECTED" || "CONNECTED_ONHOLD" || "MISSED" || "ERROR" || "ENDED" || "REJECTED",
//           StateStartTimestamp: new Date("TIMESTAMP"),
//           ConnectedToAgentTimestamp: new Date("TIMESTAMP"),
//           Queue: { // QueueReference
//             Id: "STRING_VALUE",
//             Arn: "STRING_VALUE",
//           },
//         },
//       ],
//       NextStatus: "STRING_VALUE",
//     },
//   ],
//   ApproximateTotalCount: Number("long"),
// };

GetCurrentUserDataCommand Input

See GetCurrentUserDataCommandInput for more details

Parameter
Type
Description
Filters
Required
UserDataFilters | undefined

The filters to apply to returned user data. You can filter up to the following limits:

  • Queues: 100

  • Routing profiles: 100

  • Agents: 100

  • Contact states: 9

  • User hierarchy groups: 1

The user data is retrieved for only the specified values/resources in the filter. A maximum of one filter can be passed from queues, routing profiles, agents, and user hierarchy groups.

Currently tagging is only supported on the resources that are passed in the filter.

InstanceId
Required
string | undefined

The identifier of the Amazon Connect instance. You can find the instance ID  in the Amazon Resource Name (ARN) of the instance.

MaxResults
number | undefined

The maximum number of results to return per page.

NextToken
string | undefined

The token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results.

GetCurrentUserDataCommand Output

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.
ApproximateTotalCount
number | undefined

The total count of the result, regardless of the current page size.

NextToken
string | undefined

If there are additional results, this is the token for the next set of results.

UserDataList
UserData[] | undefined

A list of the user data that is returned.

Throws

Name
Fault
Details
InternalServiceException
server

Request processing failed because of an error or failure with the service.

InvalidParameterException
client

One or more of the specified parameters are not valid.

InvalidRequestException
client

The request is not valid.

ResourceNotFoundException
client

The specified resource was not found.

ThrottlingException
client

The throttling limit has been exceeded.

ConnectServiceException
Base exception class for all service exceptions from Connect service.