CommentsModule

public class CommentsModule

Provides Comment management

  • Get information about a comment.

    Declaration

    Swift

    public func get(
        commentId: String,
        fields: [String]? = nil,
        completion: @escaping Callback<Comment>
    )

    Parameters

    commentId

    The ID of the comment on which to retrieve information.

    fields

    String array of fields to include in the response. Any attribute in the full comment objects can be passed in the fields parameter to get specific attributes.

    completion

    Returns a Comment response object if successful otherwise a BoxSDKError.

  • Updates the message for a comment.

    Declaration

    Swift

    public func update(
        commentId: String,
        message: String,
        fields: [String]? = nil,
        completion: @escaping Callback<Comment>
    )

    Parameters

    commentId

    The ID of the comment to update info on,

    fields

    String array of fields to include in the response. Any attribute in the full comment objects can be passed in the fields parameter to get specific attributes.

    completion

    Returns a Comment response object if successful otherwise a BoxSDKError.

  • Creates a comment on an item.

    Declaration

    Swift

    public func create(
        itemId: String,
        itemType: String,
        message: String,
        fields: [String]? = nil,
        completion: @escaping Callback<Comment>
    )

    Parameters

    itemId

    The ID of the item to create a comment on.

    itemType

    The type of the item to create a comment on. Can be “file” or “comment”.

    fields

    String array of fields to include in the response. Any attributes in the full comment objects can be passed in the fields parameter to get specific attributes.

    completion

    Returns a Comment response object if successful otherwise a BoxSDKError.

  • Deletes the comment.

    Declaration

    Swift

    public func delete(
        commentId: String,
        completion: @escaping Callback<Void>
    )

    Parameters

    commentId

    The ID of the comment to delete.

    completion

    Returns Void if the comment is deleted.