File Comment Reactions

A FileCommentReaction is a reaction that is attached to a comment on a file.

Create File Comment Reaction

SDK Method

FileCommentReaction.create()

Return Object

FileCommentReaction

Authorization Requirement

Available to all authenticated keys or sessions.

Method Arguments

ArgumentDescription
user_id
int64
User ID. Provide a value of 0 to operate the current session's user.
file_comment_id
int64
Required
ID of file comment to attach reaction to.
emoji
string
Required
Emoji to react with.

Example Request

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

try {
  const fileCommentReaction = await FileCommentReaction.create({
    file_comment_id: 1,
    emoji: "emoji",
  });
  // Operate on fileCommentReaction
} 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;
  }
}

Delete File Comment Reaction

SDK Method

fileCommentReaction.delete()

Return Object

No return value.

Authorization Requirement

Available to all authenticated keys or sessions.

Example Request

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

try {
  const fileCommentReaction = new FileCommentReaction();
  await fileCommentReaction.delete();
} 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 FileCommentReaction Object

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

AttributeDescription
id
int64
Reaction ID
emoji
string
Emoji used in the reaction.