File Comment Reactions

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

Create File Comment Reaction

SDK Method

file_comment_reaction.Create()

Return Values

Returns a files_sdk.FileCommentReaction value and an error.

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.Printf("API error (%s): %s\n", respErr.Type, respErr.ErrorMessage)
    } else {
        fmt.Printf("Request failed: %v\n", err)
    }
    return
}
fmt.Println(fileCommentReaction)

Delete File Comment Reaction

SDK Method

file_comment_reaction.Delete()

Return Values

Returns an error, or nil on success.

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.Printf("API error (%s): %s\n", respErr.Type, respErr.ErrorMessage)
    } else {
        fmt.Printf("Request failed: %v\n", err)
    }
    return
}

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.