Usage Daily Snapshots

A UsageDailySnapshot is a detailed site-wide usage report for the day. Includes information about users, API, and storage.

List Usage Daily Snapshots

SDK Method

usagedailysnapshot.List()

Return Object

[]*UsageDailySnapshot

Authorization Requirement

Requires either a Site-Wide API key or User API key or session from a User with Site Admin permissions.

Additional Arguments

Example Request

import (
    "fmt"
    "errors"

    files_sdk "github.com/Files-com/files-sdk-go/v3"
    usage_daily_snapshot "github.com/Files-com/files-sdk-go/v3/usagedailysnapshot"
)

usageDailySnapshotIterator, err := usage_daily_snapshot.List(files_sdk.UsageDailySnapshotListParams{})
if err != nil {
    var respErr files_sdk.ResponseError
    if errors.As(err, &respErr) {
        fmt.Println("Response Error Occurred (" + respErr.Type + "): " + respErr.ErrorMessage)
    } else {
        fmt.Printf("Unexpected Error: %s\n", err.Error())
    }
}

for usageDailySnapshotIterator.Next() {
    usageDailySnapshot := usageDailySnapshotIterator.usageDailySnapshot()
}
err = usageDailySnapshotIterator.Err()
if err != nil {
    var respErr files_sdk.ResponseError
    if errors.As(err, &respErr) {
        fmt.Println("Response Error Occurred (" + respErr.Type + "): " + respErr.ErrorMessage)
    } else {
        fmt.Printf("Unexpected Error: %s\n", err.Error())
    }
}

The UsageDailySnapshot Object

Some of the methods above return a UsageDailySnapshot object. The attributes of this object are listed below.

AttributeDescription
Id
int64
ID of the usage record
Date
date
The date of this usage record
ApiUsageAvailable
boolean
True if the API usage fields read_api_usage and write_api_usage can be relied upon. If this is false, we suggest hiding that value from any UI.
ReadApiUsage
int64
Read API Calls used on this day. Note: only updated for days before the current day.
WriteApiUsage
int64
Write API Calls used on this day. Note: only updated for days before the current day.
TransformationCreditsUsage
int64
Transformation and AI credits used on this day. Note: only updated for days before the current day.
UserCount
int64
Number of billable users as of this day.
CurrentStorage
int64
GB of Files Native Storage used on this day.
DeletedFilesStorage
int64
GB of Files Native Storage used on this day for files that have been deleted and are stored as backups.
DeletedFilesCountedInMinimum
int64
GB of Files Native Storage used on this day for files that have been permanently deleted but were uploaded less than 30 days ago, and are still billable.
RootStorage
int64
GB of Files Native Storage used for the root folder. Included here because this value will not be part of usage_by_top_level_dir
UsageByTopLevelDir
array(object)
Usage broken down by each top-level folder