listIntentPaths method
Retrieves summary statistics for a path of intents that users take over sessions with your bot. The following fields are required:
-
startDateTimeandendDateTime– 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 theintentPathfield with/BookCar/BookHotelto see details about how many times users invoked theBookCarandBookHotelintents in that order.
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);
}