Table of Contents

Class StatsClient

Namespace
Auth0.ManagementApi.Clients
Assembly
Auth0.ManagementApi.dll

Contains methods to access the /stats endpoints.

public class StatsClient : BaseClient, IStatsClient
Inheritance
StatsClient
Implements
Inherited Members

Constructors

StatsClient(IManagementConnection, Uri, IDictionary<string, string>)

Initializes a new instance of StatsClient.

public StatsClient(IManagementConnection connection, Uri baseUri, IDictionary<string, string> defaultHeaders)

Parameters

connection IManagementConnection

IManagementConnection used to make all API calls.

baseUri Uri

Uri of the endpoint to use in making API calls.

defaultHeaders IDictionary<string, string>

Dictionary containing default headers included with every request this client makes.

Methods

GetActiveUsersAsync(CancellationToken)

Gets the active users count (logged in during the last 30 days).

public Task<long> GetActiveUsersAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

The cancellation token to cancel operation.

Returns

Task<long>

The number of users that have logged in during the last 30 days.

GetDailyStatsAsync(DateTime, DateTime, CancellationToken)

Gets the daily stats for a particular period.

public Task<IList<DailyStatistics>> GetDailyStatsAsync(DateTime from, DateTime to, CancellationToken cancellationToken = default)

Parameters

from DateTime

The first day of the period (inclusive).

to DateTime

The last day of the period (inclusive).

cancellationToken CancellationToken

The cancellation token to cancel operation.

Returns

Task<IList<DailyStatistics>>

A list of DailyStatistics containing the statistics for each day in the period.