Scheduled Exports

A Scheduled Export defines a recurring schedule for generating one of the built-in CSV exports and e-mailing it to a Site Admin recipient.

List Scheduled Exports

SDK Function

ScheduledExport.list()

Return Object

ListIterator<ScheduledExport>

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 com.files.ListIterator;
import com.files.exceptions.*;
import com.files.exceptions.ApiErrorException.*;
import com.files.models.ScheduledExport;

try {
  HashMap<String, Object> parameters = new HashMap<>();
  ListIterator<ScheduledExport> scheduledExports = ScheduledExport.list(parameters);
  for (ScheduledExport scheduledExport : scheduledExports.listAutoPaging()) {
    // Operate on scheduledExport
  }
} catch (NotAuthenticatedException e) {
  System.out.println("Authentication Error Occurred (" + e.getClass().getName() + "): " + e.getMessage());
} catch (SdkException e) {
  System.out.println("Unknown Error Occurred (" + e.getClass().getName() + "): " + e.getMessage());
}

Show Scheduled Export

SDK Function

ScheduledExport.find()

Return Object

ScheduledExport

Authorization Requirement

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

Function Arguments

ArgumentDescription
id
int64
Required
Scheduled Export ID.

Example Request

import com.files.exceptions.*;
import com.files.exceptions.ApiErrorException.*;
import com.files.models.ScheduledExport;

try {
  HashMap<String, Object> parameters = new HashMap<>();
  ScheduledExport scheduledExport = ScheduledExport.find(id, parameters);
  // Operate on scheduledExport
} catch (NotAuthenticatedException e) {
  System.out.println("Authentication Error Occurred (" + e.getClass().getName() + "): " + e.getMessage());
} catch (SdkException e) {
  System.out.println("Unknown Error Occurred (" + e.getClass().getName() + "): " + e.getMessage());
}

Create Scheduled Export

SDK Function

ScheduledExport.create()

Return Object

ScheduledExport

Authorization Requirement

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

Function Arguments

ArgumentDefaultDescription
name
string
Required
Name for this scheduled export.
export_type
string
Required
Export report type. Valid values: folder_size_audit, group_membership_audit, permission_audit, share_link_audit
export_options
object
Report-specific options. permission_audit supports group_by with user or path.
user_id
int64
Site Admin user who receives the completed export e-mail.
disabled
boolean
falseIf true, this scheduled export will not run.
trigger
string
"daily"Schedule trigger type: daily or custom_schedule.
Possible values: daily, custom_schedule
interval
string
If trigger is daily, this specifies how often to run the scheduled export.
recurring_day
int64
If trigger is daily, this selects the day number inside the chosen interval.
recurring_days
array(int64)
If trigger is daily, this selects one or more day numbers inside a week, month, quarter, or year interval.
schedule_id
int64
If trigger is custom_schedule, the reusable Schedule used instead of the scheduled export's schedule fields.
schedule_days_of_week
array(int64)
If trigger is custom_schedule, the 0-based weekdays used by the schedule.
schedule_times_of_day
array(string)
Times of day in HH:MM format for the scheduled export schedule.
schedule_time_zone
string
Time zone used by the scheduled export schedule.
holiday_region
string
Optional holiday region used by the scheduled export schedule.

Example Request

import com.files.exceptions.*;
import com.files.exceptions.ApiErrorException.*;
import com.files.models.ScheduledExport;

try {
  HashMap<String, Object> parameters = new HashMap<>();
  parameters.put("name", "Monthly access review");
  parameters.put("export_type", "permission_audit");
  
  ScheduledExport scheduledExport = ScheduledExport.create(parameters);
  // Operate on scheduledExport
} catch (NotAuthenticatedException e) {
  System.out.println("Authentication Error Occurred (" + e.getClass().getName() + "): " + e.getMessage());
} catch (SdkException e) {
  System.out.println("Unknown Error Occurred (" + e.getClass().getName() + "): " + e.getMessage());
}

Update Scheduled Export

SDK Function

scheduledExport.update();

Return Object

ScheduledExport

Authorization Requirement

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

Attribute Setters

SetterDescription
setName
string
Name for this scheduled export.
setExportType
string
Export report type. Valid values: folder_size_audit, group_membership_audit, permission_audit, share_link_audit
setExportOptions
object
Report-specific options. permission_audit supports group_by with user or path.
setUserId
int64
Site Admin user who receives the completed export e-mail.
setDisabled
boolean
If true, this scheduled export will not run.
setTrigger
string
Schedule trigger type: daily or custom_schedule.
Possible values: daily, custom_schedule
setInterval
string
If trigger is daily, this specifies how often to run the scheduled export.
setRecurringDay
int64
If trigger is daily, this selects the day number inside the chosen interval.
setRecurringDays
array(int64)
If trigger is daily, this selects one or more day numbers inside a week, month, quarter, or year interval.
setScheduleId
int64
If trigger is custom_schedule, the reusable Schedule used instead of the scheduled export's schedule fields.
setScheduleDaysOfWeek
array(int64)
If trigger is custom_schedule, the 0-based weekdays used by the schedule.
setScheduleTimesOfDay
array(string)
Times of day in HH:MM format for the scheduled export schedule.
setScheduleTimeZone
string
Time zone used by the scheduled export schedule.
setHolidayRegion
string
Optional holiday region used by the scheduled export schedule.

Example Request

import com.files.exceptions.*;
import com.files.exceptions.ApiErrorException.*;
import com.files.models.ScheduledExport;

try {
  // Find the scheduledExport object by its id.
  ScheduledExport scheduledExport = ScheduledExport.find(id, null);
  HashMap<String, Object> parameters = new HashMap<>();
  parameters.put("name", "Monthly access review");
  scheduledExport.update(parameters);
} catch (NotAuthenticatedException e) {
  System.out.println("Authentication Error Occurred (" + e.getClass().getName() + "): " + e.getMessage());
} catch (SdkException e) {
  System.out.println("Unknown Error Occurred (" + e.getClass().getName() + "): " + e.getMessage());
}

Delete Scheduled Export

SDK Function

scheduledExport.delete();

Return Object

No return value.

Authorization Requirement

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

Example Request

import com.files.exceptions.*;
import com.files.exceptions.ApiErrorException.*;
import com.files.models.ScheduledExport;

try {
  // Find the scheduledExport object by its id.
  ScheduledExport scheduledExport = ScheduledExport.find(id, null);
  scheduledExport.delete(null);
} catch (NotAuthenticatedException e) {
  System.out.println("Authentication Error Occurred (" + e.getClass().getName() + "): " + e.getMessage());
} catch (SdkException e) {
  System.out.println("Unknown Error Occurred (" + e.getClass().getName() + "): " + e.getMessage());
}

The ScheduledExport Object

Some of the functions above return a ScheduledExport object. The attributes of this object are listed below.

AttributeDescription
id
int64
Scheduled Export ID
name
string
Name for this scheduled export.
export_type
string
Export report type. Valid values: folder_size_audit, group_membership_audit, permission_audit, share_link_audit
report_name
string
Human-readable report name.
export_options
object
Report-specific options. permission_audit supports group_by with user or path.
user_id
int64
Site Admin user who receives the completed export e-mail.
disabled
boolean
If true, this scheduled export will not run.
trigger
string
Schedule trigger type: daily or custom_schedule.
Possible values: daily, custom_schedule
interval
string
If trigger is daily, this specifies how often to run the scheduled export.
recurring_day
int64
If trigger is daily, this selects the day number inside the chosen interval.
recurring_days
array(int64)
If trigger is daily, this selects one or more day numbers inside a week, month, quarter, or year interval.
schedule_id
int64
If trigger is custom_schedule, the reusable Schedule used instead of the scheduled export's schedule fields.
schedule_days_of_week
array(int64)
If trigger is custom_schedule, the 0-based weekdays used by the schedule.
schedule_times_of_day
array(string)
Times of day in HH:MM format for the scheduled export schedule.
schedule_time_zone
string
Time zone used by the scheduled export schedule.
holiday_region
string
Optional holiday region used by the scheduled export schedule.
human_readable_schedule
string
Human-readable schedule description.
last_run_at
date-time
Most recent scheduled run time.
last_export_id
int64
Most recent Export ID created by this schedule.
created_at
date-time
Creation time.
updated_at
date-time
Last update time.