External Events

An ExternalEvent is a log that is sent to the cloud from a client application such as the Files.com CLI.

List External Events

SDK Method

ExternalEvent.list()

Return Object

ExternalEvent[]

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 ExternalEvent from 'files.com/lib/models/ExternalEvent';
import * as FilesErrors from 'files.com/lib/Errors';

try {
  const externalEvents = await ExternalEvent.list();
  for (const externalEvent of externalEvents) {
    // Operate on externalEvent
  }
} catch (err) {
  if (err instanceof FilesErrors.NotAuthenticatedError) {
    console.error(`Authentication Error Occurred (${err.constructor.name}): ${err.error}`);
  } else if (err instanceof FilesErrors.FilesError) {
    console.error(`Unknown Error Occurred (${err.constructor.name}): ${err.error}`);
  } else {
    throw err;
  }
}

Show External Event

SDK Method

ExternalEvent.find()

Return Object

ExternalEvent

Authorization Requirement

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

Method Arguments

ArgumentDescription
id
int64
Required
External Event ID.

Example Request

import ExternalEvent from 'files.com/lib/models/ExternalEvent';
import * as FilesErrors from 'files.com/lib/Errors';

try {
  const externalEvent = await ExternalEvent.find(id);
  // Operate on externalEvent
} catch (err) {
  if (err instanceof FilesErrors.NotAuthenticatedError) {
    console.error(`Authentication Error Occurred (${err.constructor.name}): ${err.error}`);
  } else if (err instanceof FilesErrors.FilesError) {
    console.error(`Unknown Error Occurred (${err.constructor.name}): ${err.error}`);
  } else {
    throw err;
  }
}

Create External Event

SDK Method

ExternalEvent.create()

Return Object

ExternalEvent

Authorization Requirement

Available to all authenticated keys or sessions.

Method Arguments

ArgumentDescription
status
string
Required
Status of event.
Possible values: success, failure, partial_failure, in_progress, skipped
body
string
Required
Event body

Example Request

import ExternalEvent from 'files.com/lib/models/ExternalEvent';
import * as FilesErrors from 'files.com/lib/Errors';

try {
  const externalEvent = await ExternalEvent.create({
    status: "example",
    body: "example",
  });
  // Operate on externalEvent
} catch (err) {
  if (err instanceof FilesErrors.NotAuthenticatedError) {
    console.error(`Authentication Error Occurred (${err.constructor.name}): ${err.error}`);
  } else if (err instanceof FilesErrors.FilesError) {
    console.error(`Unknown Error Occurred (${err.constructor.name}): ${err.error}`);
  } else {
    throw err;
  }
}

The ExternalEvent Object

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

AttributeDescription
id
int64
Event ID
event_type
string
Type of event being recorded.
Possible values: ldap_sync, remote_server_sync, lockout, ldap_login, saml_login, client_log, pending_work, siem_http_destination
status
string
Status of event.
Possible values: success, failure, partial_failure, in_progress, skipped
body
string
Event body
created_at
date-time
External event create date/time
body_url
string
Link to log file.