Notifications

A Notification is our feature that sends E-Mails when specific actions occur in the folder.

Emails are sent in batches, with email frequency options of every 5 minutes, every 15 minutes, hourly, or daily. They will include a list of the matching actions within the configured notification period, limited to the first 100.

List Notifications

SDK Method

Notification.List();

Return Object

FilesList<Notification>

Authorization Requirement

Available to all authenticated keys or sessions.

Method Arguments

ArgumentDescription
path
string
Show notifications for this Path.
include_ancestors
boolean
If include_ancestors is true and path is specified, include notifications for any parent paths. Ignored if path is not specified.
group_id
string

Additional Arguments

Example Request

using FilesCom.Models;

var parameters = new Dictionary<string, object>();
parameters.Add("include_ancestors", false);

try
{
    var notificationIterator = Notification.List(parameters);
    await foreach (Notification notification in notificationIterator.ListAutoPagingAsync()) {
        // Operate on notification
    }
}
catch (FilesCom.NotAuthenticatedException e)
{
    Console.WriteLine($"Authentication Error Occurred ({e.GetType().Name}): " + e.Message);
}
catch (FilesCom.SdkException e)
{
    Console.WriteLine($"Unknown Error Occurred ({e.GetType().Name}): " + e.Message);
}

Show Notification

SDK Method

Notification.Find();

Return Object

Notification

Authorization Requirement

Available to all authenticated keys or sessions.

Method Arguments

ArgumentDescription
id
int64
Required
Notification ID.

Example Request

using FilesCom.Models;

try
{
    var notification = await Notification.Find(1L);
    // Operate on notification
}
catch (FilesCom.NotAuthenticatedException e)
{
    Console.WriteLine($"Authentication Error Occurred ({e.GetType().Name}): " + e.Message);
}
catch (FilesCom.SdkException e)
{
    Console.WriteLine($"Unknown Error Occurred ({e.GetType().Name}): " + e.Message);
}

Create Notification

SDK Method

Notification.Create();

Return Object

Notification

Authorization Requirement

Available to all authenticated keys or sessions.

Method Arguments

ArgumentDefaultDescription
user_id
int64
The id of the user to notify. Provide user_id, username or group_id.
notify_on_copy
boolean
If true, copying or moving resources into this path will trigger a notification, in addition to just uploads.
notify_on_delete
boolean
falseTrigger on files deleted in this path?
notify_on_download
boolean
falseTrigger on files downloaded in this path?
notify_on_move
boolean
falseTrigger on files moved to this path?
notify_on_upload
boolean
trueTrigger on files created/uploaded/updated/changed in this path?
notify_user_actions
boolean
If true actions initiated by the user will still result in a notification
recursive
boolean
If true, enable notifications for each subfolder in this path
send_interval
string
The time interval that notifications are aggregated by. Can be five_minutes, fifteen_minutes, hourly, or daily.
subject
string
Custom subject line to use for notification emails
message
string
Custom message to include in notification emails
triggering_filenames
array(string)
Array of filenames (possibly with wildcards) to scope trigger
triggering_group_ids
array(int64)
If set, will only notify on actions made by a member of one of the specified groups
triggering_user_ids
array(int64)
If set, will only notify on actions made one of the specified users
trigger_by_share_recipients
boolean
falseNotify when actions are performed by a share recipient?
workspace_id
int64
0Workspace ID. 0 means the default workspace.
group_id
int64
The ID of the group to notify. Provide user_id, username or group_id.
group_ids
string
Group IDs when the notification requires multiple groups. If sent as a string, it should be comma-delimited.
path
string
Path
username
string
The username of the user to notify. Provide user_id, username or group_id.

Example Request

using FilesCom.Models;

var parameters = new Dictionary<string, object>();
parameters.Add("user_id", 1L);

try
{
    var notification = await Notification.Create(parameters);
    // Operate on notification
}
catch (FilesCom.NotAuthenticatedException e)
{
    Console.WriteLine($"Authentication Error Occurred ({e.GetType().Name}): " + e.Message);
}
catch (FilesCom.SdkException e)
{
    Console.WriteLine($"Unknown Error Occurred ({e.GetType().Name}): " + e.Message);
}

Update Notification

SDK Method

notification.Update();

Return Object

Notification

Authorization Requirement

Available to all authenticated keys or sessions.

Method Arguments

ArgumentDescription
notify_on_copy
boolean
If true, copying or moving resources into this path will trigger a notification, in addition to just uploads.
notify_on_delete
boolean
Trigger on files deleted in this path?
notify_on_download
boolean
Trigger on files downloaded in this path?
notify_on_move
boolean
Trigger on files moved to this path?
notify_on_upload
boolean
Trigger on files created/uploaded/updated/changed in this path?
notify_user_actions
boolean
If true actions initiated by the user will still result in a notification
recursive
boolean
If true, enable notifications for each subfolder in this path
send_interval
string
The time interval that notifications are aggregated by. Can be five_minutes, fifteen_minutes, hourly, or daily.
subject
string
Custom subject line to use for notification emails
message
string
Custom message to include in notification emails
triggering_filenames
array(string)
Array of filenames (possibly with wildcards) to scope trigger
triggering_group_ids
array(int64)
If set, will only notify on actions made by a member of one of the specified groups
triggering_user_ids
array(int64)
If set, will only notify on actions made one of the specified users
trigger_by_share_recipients
boolean
Notify when actions are performed by a share recipient?
workspace_id
int64
Workspace ID. 0 means the default workspace.

Example Request

using FilesCom.Models;

var parameters = new Dictionary<string, object>();
parameters.Add("notify_on_copy", false);

try
{
    // Find the notification object by its id.
    var notification = await Notification.Find(1L);
    await notification.Update(parameters);
}
catch (FilesCom.NotAuthenticatedException e)
{
    Console.WriteLine($"Authentication Error Occurred ({e.GetType().Name}): " + e.Message);
}
catch (FilesCom.SdkException e)
{
    Console.WriteLine($"Unknown Error Occurred ({e.GetType().Name}): " + e.Message);
}

Delete Notification

SDK Method

notification.Delete();

Return Object

No return value.

Authorization Requirement

Available to all authenticated keys or sessions.

Example Request

using FilesCom.Models;

var parameters = new Dictionary<string, object>();

try
{
    // Find the notification object by its id.
    var notification = await Notification.Find(1L);
    await notification.Delete(parameters);
}
catch (FilesCom.NotAuthenticatedException e)
{
    Console.WriteLine($"Authentication Error Occurred ({e.GetType().Name}): " + e.Message);
}
catch (FilesCom.SdkException e)
{
    Console.WriteLine($"Unknown Error Occurred ({e.GetType().Name}): " + e.Message);
}

The Notification Object

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

AttributeDescription
id
int64
Notification ID
path
string
Folder path to notify on. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters.
group_id
int64
ID of Group to receive notifications
group_name
string
Group name, if a Group ID is set
group_ids
array(int64)
Group IDs when the notification requires multiple groups
group_names
array(string)
Group names when the notification requires multiple groups
triggering_group_ids
array(int64)
If set, will only notify on actions made by a member of one of the specified groups
triggering_user_ids
array(int64)
If set, will only notify on actions made one of the specified users
trigger_by_share_recipients
boolean
Notify when actions are performed by a share recipient?
notify_user_actions
boolean
If true, will send notifications about a user's own activity to that user. If false, only activity performed by other users (or anonymous users) will be sent in notifications.
notify_on_copy
boolean
Trigger on files copied to this path?
notify_on_delete
boolean
Trigger on files deleted in this path?
notify_on_download
boolean
Trigger on files downloaded in this path?
notify_on_move
boolean
Trigger on files moved to this path?
notify_on_upload
boolean
Trigger on files created/uploaded/updated/changed in this path?
recursive
boolean
Apply notification recursively? This will enable notifications for each subfolder.
send_interval
string
The time interval that notifications are aggregated to
Possible values: five_minutes, fifteen_minutes, hourly, daily
subject
string
Custom subject line to use for notification emails
message
string
Custom message to include in notification emails
triggering_filenames
array(string)
Array of filenames (possibly with wildcards) to scope trigger
workspace_id
int64
Workspace ID. 0 means the default workspace.
unsubscribed
boolean
Is the user unsubscribed from this notification?
unsubscribed_reason
string
The reason that the user unsubscribed
Possible values: none, unsubscribe_link_clicked, mail_bounced, mail_marked_as_spam
user_id
int64
Notification user ID
username
string
Notification username
suppressed_email
boolean
If true, it means that the recipient at this user's email address has manually unsubscribed from all emails, or had their email "hard bounce", which means that we are unable to send mail to this user's current email address. Notifications will resume if the user changes their email address.