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.

FileCommentReactionCreateParams Fields

FieldDescription
UserId
int64
User ID. Provide a value of 0 to operate the current session's user.
FileCommentId
int64
Required
ID of file comment to attach reaction to.
Emoji
string
Required
Emoji to react with.

Example Request

import (
    "fmt"
    "errors"

    files_sdk "github.com/Files-com/files-sdk-go/v3"
    file_comment_reaction "github.com/Files-com/files-sdk-go/v3/filecommentreaction"
)

fileCommentReaction, err := file_comment_reaction.Create(files_sdk.FileCommentReactionCreateParams{
  FileCommentId: 1,
  Emoji: "emoji"
})
if err != nil {
    var respErr files_sdk.ResponseError
    if errors.As(err, &respErr) {
        fmt.Println("Response Error Occurred (" + respErr.Type + "): " + respErr.ErrorMessage)
    } else {
        fmt.Printf("Unexpected Error: %s\n", err.Error())
    }
}

Delete File Comment Reaction

SDK Method

filecommentreaction.Delete()

Return Object

No return value.

Authorization Requirement

Available to all authenticated keys or sessions.

FileCommentReactionDeleteParams Fields

FieldDescription
Id
int64
Required
File Comment Reaction ID.

Example Request

import (
    "fmt"
    "errors"

    files_sdk "github.com/Files-com/files-sdk-go/v3"
    file_comment_reaction "github.com/Files-com/files-sdk-go/v3/filecommentreaction"
)

err := file_comment_reaction.Delete(files_sdk.FileCommentReactionDeleteParams{Id: 1})
if err != nil {
    var respErr files_sdk.ResponseError
    if errors.As(err, &respErr) {
        fmt.Println("Response Error Occurred (" + respErr.Type + "): " + respErr.ErrorMessage)
    } else {
        fmt.Printf("Unexpected Error: %s\n", err.Error())
    }
}

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.