listIntentPaths method

Future<ListIntentPathsResponse> listIntentPaths({
  1. required String botId,
  2. required DateTime endDateTime,
  3. required String intentPath,
  4. required DateTime startDateTime,
  5. List<AnalyticsPathFilter>? filters,
})

Retrieves summary statistics for a path of intents that users take over sessions with your bot. The following fields are required:

  • startDateTime and endDateTime – Define a time range for which you want to retrieve results.
  • intentPath – Define an order of intents for which you want to retrieve metrics. Separate intents in the path with a forward slash. For example, populate the intentPath field with /BookCar/BookHotel to see details about how many times users invoked the BookCar and BookHotel intents in that order.
Use the optional filters field to filter the results.

May throw InternalServerException. May throw PreconditionFailedException. May throw ServiceQuotaExceededException. May throw ThrottlingException. May throw ValidationException.

Parameter botId : The identifier for the bot for which you want to retrieve intent path metrics.

Parameter endDateTime : The date and time that marks the end of the range of time for which you want to see intent path metrics.

Parameter intentPath : The intent path for which you want to retrieve metrics. Use a forward slash to separate intents in the path. For example:

  • /BookCar
  • /BookCar/BookHotel
  • /BookHotel/BookCar

Parameter startDateTime : The date and time that marks the beginning of the range of time for which you want to see intent path metrics.

Parameter filters : A list of objects, each describes a condition by which you want to filter the results.

Implementation

Future<ListIntentPathsResponse> listIntentPaths({
  required String botId,
  required DateTime endDateTime,
  required String intentPath,
  required DateTime startDateTime,
  List<AnalyticsPathFilter>? filters,
}) async {
  final $payload = <String, dynamic>{
    'endDateTime': unixTimestampToJson(endDateTime),
    'intentPath': intentPath,
    'startDateTime': unixTimestampToJson(startDateTime),
    if (filters != null) 'filters': filters,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/bots/${Uri.encodeComponent(botId)}/analytics/intentpaths',
    exceptionFnMap: _exceptionFns,
  );
  return ListIntentPathsResponse.fromJson(response);
}