getCurrentUserData method

Future<GetCurrentUserDataResponse> getCurrentUserData({
  1. required UserDataFilters filters,
  2. required String instanceId,
  3. int? maxResults,
  4. String? nextToken,
})

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

May throw InternalServiceException. May throw InvalidParameterException. May throw InvalidRequestException. May throw ResourceNotFoundException. May throw ThrottlingException.

Parameter filters : 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.

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

Parameter maxResults : The maximum number of results to return per page.

Parameter nextToken : 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.

Implementation

Future<GetCurrentUserDataResponse> getCurrentUserData({
  required UserDataFilters filters,
  required String instanceId,
  int? maxResults,
  String? nextToken,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    100,
  );
  final $payload = <String, dynamic>{
    'Filters': filters,
    if (maxResults != null) 'MaxResults': maxResults,
    if (nextToken != null) 'NextToken': nextToken,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/metrics/userdata/${Uri.encodeComponent(instanceId)}',
    exceptionFnMap: _exceptionFns,
  );
  return GetCurrentUserDataResponse.fromJson(response);
}