Event Channels

An EventChannel is a named grouping of EventSubscriptions.

List Event Channels

Endpoint

GET/event_channels

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.

Additional Arguments

Example Request

curl https://app.files.com/api/rest/v1/event_channels.json \
  -H 'X-FilesAPI-Key: YOUR_API_KEY'

Example Response

[
  {
    "id": 1,
    "name": "example",
    "workspace_id": 1,
    "description": "example",
    "enabled": true,
    "default_channel": true,
    "created_at": "2000-01-01T01:00:00Z",
    "updated_at": "2000-01-01T01:00:00Z"
  }
]

Show Event Channel

Endpoint

GET/event_channels/{id}

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.

Request Parameters

ParameterDescription
id
int64
Required
Event Channel ID.

Example Request

curl https://app.files.com/api/rest/v1/event_channels/{id}.json \
  -H 'X-FilesAPI-Key: YOUR_API_KEY'

Example Response

{
  "id": 1,
  "name": "example",
  "workspace_id": 1,
  "description": "example",
  "enabled": true,
  "default_channel": true,
  "created_at": "2000-01-01T01:00:00Z",
  "updated_at": "2000-01-01T01:00:00Z"
}

Create Event Channel

Endpoint

POST/event_channels

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.

Request Parameters

ParameterDefaultDescription
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

curl https://app.files.com/api/rest/v1/event_channels.json \
  -X POST \
  -H 'Content-Type: application/json' \
  -d '{"name":"example","workspace_id":1,"description":"example","enabled":true,"default_channel":true}' \
  -H 'X-FilesAPI-Key: YOUR_API_KEY'

Example Response

{
  "id": 1,
  "name": "example",
  "workspace_id": 1,
  "description": "example",
  "enabled": true,
  "default_channel": true,
  "created_at": "2000-01-01T01:00:00Z",
  "updated_at": "2000-01-01T01:00:00Z"
}

Update Event Channel

Endpoint

PATCH/event_channels/{id}

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.

Request Parameters

ParameterDescription
id
int64
Required
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.

Example Request

curl https://app.files.com/api/rest/v1/event_channels/{id}.json \
  -X PATCH \
  -H 'Content-Type: application/json' \
  -d '{"name":"example","workspace_id":1,"description":"example","enabled":true,"default_channel":true}' \
  -H 'X-FilesAPI-Key: YOUR_API_KEY'

Example Response

{
  "id": 1,
  "name": "example",
  "workspace_id": 1,
  "description": "example",
  "enabled": true,
  "default_channel": true,
  "created_at": "2000-01-01T01:00:00Z",
  "updated_at": "2000-01-01T01:00:00Z"
}

Delete Event Channel

Endpoint

DELETE/event_channels/{id}

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.

Request Parameters

ParameterDescription
id
int64
Required
Event Channel ID.

Example Request

curl https://app.files.com/api/rest/v1/event_channels/{id}.json \
  -X DELETE \
  -H 'X-FilesAPI-Key: YOUR_API_KEY'

The EventChannel Object

Some of the endpoints 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.

Example EventChannel Object

{
  "id": 1,
  "name": "example",
  "workspace_id": 1,
  "description": "example",
  "enabled": true,
  "default_channel": true,
  "created_at": "2000-01-01T01:00:00Z",
  "updated_at": "2000-01-01T01:00:00Z"
}