Event Channels

An EventChannel is a named grouping of EventSubscriptions.

List Event Channels

SDK Function

EventChannel.list()

Return Object

ListIterator<EventChannel>

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

try {
  HashMap<String, Object> parameters = new HashMap<>();
  ListIterator<EventChannel> eventChannels = EventChannel.list(parameters);
  for (EventChannel eventChannel : eventChannels.listAutoPaging()) {
    // Operate on eventChannel
  }
} 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 Channel

SDK Function

EventChannel.find()

Return Object

EventChannel

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 Channel ID.

Example Request

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

try {
  HashMap<String, Object> parameters = new HashMap<>();
  EventChannel eventChannel = EventChannel.find(id, parameters);
  // Operate on eventChannel
} 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 Channel

SDK Function

EventChannel.create()

Return Object

EventChannel

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 Channel name.
workspace_id
int64
0Workspace ID. 0 means the default workspace.
description
string
Event Channel description.
enabled
boolean
trueWhether this Event Channel can dispatch events.
default_channel
boolean
falseWhether this Event Channel is the default destination for newly published events.

Example Request

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

try {
  HashMap<String, Object> parameters = new HashMap<>();
  parameters.put("name", "example");
  
  EventChannel eventChannel = EventChannel.create(parameters);
  // Operate on eventChannel
} 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 Channel

SDK Function

eventChannel.update();

Return Object

EventChannel

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 Channel name.
setWorkspaceId
int64
Workspace ID. 0 means the default workspace.
setDescription
string
Event Channel description.
setEnabled
boolean
Whether this Event Channel can dispatch events.
setDefaultChannel
boolean
Whether this Event Channel is the default destination for newly published events.

Example Request

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

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

SDK Function

eventChannel.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.EventChannel;

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

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

AttributeDescription
id
int64
Event Channel ID
name
string
Event Channel name.
workspace_id
int64
Workspace ID. 0 means the default workspace.
description
string
Event Channel description.
enabled
boolean
Whether this Event Channel can dispatch events.
default_channel
boolean
Whether this Event Channel is the default destination for newly published events.
created_at
date-time
Event Channel create date/time.
updated_at
date-time
Event Channel update date/time.