Event Targets

An EventTarget is a delivery destination for EventRecords.

List Event Targets

SDK Function

EventTarget.list()

Return Object

ListIterator<EventTarget>

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.EventTarget;

try {
  HashMap<String, Object> parameters = new HashMap<>();
  ListIterator<EventTarget> eventTargets = EventTarget.list(parameters);
  for (EventTarget eventTarget : eventTargets.listAutoPaging()) {
    // Operate on eventTarget
  }
} 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 Event Target

SDK Function

EventTarget.find()

Return Object

EventTarget

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
Event Target ID.

Example Request

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

try {
  HashMap<String, Object> parameters = new HashMap<>();
  EventTarget eventTarget = EventTarget.find(id, parameters);
  // Operate on eventTarget
} 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 Event Target

SDK Function

EventTarget.create()

Return Object

EventTarget

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
Event Target name.
workspace_id
int64
0Workspace ID. 0 means the default workspace or site-wide.
apply_to_all_workspaces
boolean
falseIf true, this default-workspace target can receive events from all workspaces.
enabled
boolean
trueWhether this Event Target can receive events.
config
object
Required
Event Target configuration. Folder targets accept path and format (json or csv).
delivery_policy
object
Event Target delivery policy. Email and folder targets support batch_interval in seconds, between 600 and 86400.
target_type
string
Required
Event Target type.
Possible values: email, webhook, slack_webhook, teams_webhook, amazon_sns, google_pubsub, folder

Example Request

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

try {
  HashMap<String, Object> parameters = new HashMap<>();
  parameters.put("name", "example");
  parameters.put("config", example);
  parameters.put("target_type", "example");
  
  EventTarget eventTarget = EventTarget.create(parameters);
  // Operate on eventTarget
} 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 Event Target

SDK Function

eventTarget.update();

Return Object

EventTarget

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
Event Target name.
setWorkspaceId
int64
Workspace ID. 0 means the default workspace or site-wide.
setApplyToAllWorkspaces
boolean
If true, this default-workspace target can receive events from all workspaces.
setEnabled
boolean
Whether this Event Target can receive events.
setConfig
object
Event Target configuration. Folder targets accept path and format (json or csv).
setDeliveryPolicy
object
Event Target delivery policy. Email and folder targets support batch_interval in seconds, between 600 and 86400.

Example Request

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

try {
  // Find the eventTarget object by its id.
  EventTarget eventTarget = EventTarget.find(id, null);
  HashMap<String, Object> parameters = new HashMap<>();
  parameters.put("name", "example");
  eventTarget.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 Event Target

SDK Function

eventTarget.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.EventTarget;

try {
  // Find the eventTarget object by its id.
  EventTarget eventTarget = EventTarget.find(id, null);
  eventTarget.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 EventTarget Object

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

AttributeDescription
id
int64
Event Target ID
name
string
Event Target name.
target_type
string
Event Target type.
Possible values: email, webhook, slack_webhook, teams_webhook, amazon_sns, google_pubsub, folder
workspace_id
int64
Workspace ID. 0 means the default workspace or site-wide.
apply_to_all_workspaces
boolean
If true, this default-workspace target can receive events from all workspaces.
enabled
boolean
Whether this Event Target can receive events.
config
object
Event Target configuration. Folder targets accept path and format (json or csv).
delivery_policy
object
Event Target delivery policy. Email and folder targets support batch_interval in seconds, between 600 and 86400.
created_at
date-time
Event Target create date/time.
updated_at
date-time
Event Target update date/time.