User SFTP Client Uses

A UserSftpClientUse is a way to see the exact set of SFTP clients used by a given user.

List User SFTP Client Uses

SDK Method

UserSftpClientUse.list()

Return Object

UserSftpClientUse[]

Authorization Requirement

Not available to user API keys or sessions from users that are marked as Shared/Bot users.

Method Arguments

ArgumentDescription
user_id
int64
User ID. If provided, will return uses for this user.

Additional Arguments

Example Request

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

try {
  const userSftpClientUses = await UserSftpClientUse.list({
    user_id: 1,
  });
  for (const userSftpClientUse of userSftpClientUses) {
    // Operate on userSftpClientUse
  }
} 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 UserSftpClientUse Object

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

AttributeDescription
id
int64
UserSftpClientUse ID
sftp_client
string
The SFTP client used
created_at
date-time
The earliest recorded use of this SFTP client (for this user)
updated_at
date-time
The most recent use of this SFTP client (for this user)
user_id
int64
ID of the user who performed this access