Constructor
new Comments(client) → {void}
Parameters:
| Name | Type | Description | 
|---|---|---|
client | 
            
            BoxClient | The Box API Client that is responsible for making calls to the API | 
- Source:
 
Returns:
- Type
 - void
 
Methods
create(fileID, commentBody, callbackopt) → {Promise.<Object>}
    Posts a new comment on a file.
API Endpoint: '/comments
Method: POST
    Parameters:
| Name | Type | Attributes | Description | 
|---|---|---|---|
fileID | 
            
            string | Box file id of the file to comment on | |
commentBody | 
            
            string | text of the comment | |
callback | 
            
            function | 
                
                    <optional> | 
            
            
            passed the new comment data if it was posted successfully | 
- Source:
 
Returns:
    A promise resolving to the new comment object
- Type
 - Promise.<Object>
 
create(fileID, commentBody, callbackopt) → {Promise.<Object>}
    Posts a new comment on a file.
API Endpoint: '/comments
Method: POST
    Parameters:
| Name | Type | Attributes | Description | 
|---|---|---|---|
fileID | 
            
            string | Box file id of the file to comment on | |
commentBody | 
            
            string | text of the comment | |
callback | 
            
            function | 
                
                    <optional> | 
            
            
            passed the new comment data if it was posted successfully | 
- Source:
 
Returns:
    A promise resolving to the new comment object
- Type
 - Promise.<Object>
 
createTaggedComment(fileID, commentBody, callbackopt) → {Promise.<Object>}
    Posts a new tagged comment on a file.
API Endpoint: '/comments
Method: POST
    Parameters:
| Name | Type | Attributes | Description | 
|---|---|---|---|
fileID | 
            
            string | Box file id of the file to comment on | |
commentBody | 
            
            string | text of the tagged comment | |
callback | 
            
            function | 
                
                    <optional> | 
            
            
            passed the new tagged comment data if it was posted successfully | 
- Source:
 
Returns:
    A promise resolving to the new comment object
- Type
 - Promise.<Object>
 
createTaggedComment(fileID, commentBody, callbackopt) → {Promise.<Object>}
    Posts a new tagged comment on a file.
API Endpoint: '/comments
Method: POST
    Parameters:
| Name | Type | Attributes | Description | 
|---|---|---|---|
fileID | 
            
            string | Box file id of the file to comment on | |
commentBody | 
            
            string | text of the tagged comment | |
callback | 
            
            function | 
                
                    <optional> | 
            
            
            passed the new tagged comment data if it was posted successfully | 
- Source:
 
Returns:
    A promise resolving to the new comment object
- Type
 - Promise.<Object>
 
createTaggedReply(commentID, commentBody, callbackopt) → {Promise.<Object>}
    Posts a new tagged comment as a reply to another comment.
API Endpoint: '/comments
Method: POST
    Parameters:
| Name | Type | Attributes | Description | 
|---|---|---|---|
commentID | 
            
            string | Comment ID of the comment to reply to | |
commentBody | 
            
            string | text of the tagged comment | |
callback | 
            
            function | 
                
                    <optional> | 
            
            
            passed the new tagged comment data if it was posted successfully | 
- Source:
 
Returns:
    A promise resolving to the new comment object
- Type
 - Promise.<Object>
 
createTaggedReply(commentID, commentBody, callbackopt) → {Promise.<Object>}
    Posts a new tagged comment as a reply to another comment.
API Endpoint: '/comments
Method: POST
    Parameters:
| Name | Type | Attributes | Description | 
|---|---|---|---|
commentID | 
            
            string | Comment ID of the comment to reply to | |
commentBody | 
            
            string | text of the tagged comment | |
callback | 
            
            function | 
                
                    <optional> | 
            
            
            passed the new tagged comment data if it was posted successfully | 
- Source:
 
Returns:
    A promise resolving to the new comment object
- Type
 - Promise.<Object>
 
delete(commentID, callbackopt) → {Promise.<void>}
    Delete a given comment.
API Endpoint: '/comments/:commentID'
Method: DELETE
    Parameters:
| Name | Type | Attributes | Description | 
|---|---|---|---|
commentID | 
            
            string | Box ID of the comment being requested | |
callback | 
            
            function | 
                
                    <optional> | 
            
            
            Empty response body passed if successful. | 
- Source:
 
Returns:
    A promise resolving to nothing
- Type
 - Promise.<void>
 
delete(commentID, callbackopt) → {Promise.<void>}
    Delete a given comment.
API Endpoint: '/comments/:commentID'
Method: DELETE
    Parameters:
| Name | Type | Attributes | Description | 
|---|---|---|---|
commentID | 
            
            string | Box ID of the comment being requested | |
callback | 
            
            function | 
                
                    <optional> | 
            
            
            Empty response body passed if successful. | 
- Source:
 
Returns:
    A promise resolving to nothing
- Type
 - Promise.<void>
 
get(commentID, optionsopt, callbackopt) → {Promise.<Object>}
    Requests a comment object with the given ID.
API Endpoint: '/comments/:commentID'
Method: GET
    Parameters:
| Name | Type | Attributes | Description | 
|---|---|---|---|
commentID | 
            
            string | Box ID of the comment being requested | |
options | 
            
            Object | 
                
                    <optional> | 
            
            
            Additional options for the request. Can be left null in most cases. | 
callback | 
            
            function | 
                
                    <optional> | 
            
            
            Passed the comment information if it was acquired successfully | 
- Source:
 
Returns:
    A promise resolving to the comment object
- Type
 - Promise.<Object>
 
get(commentID, optionsopt, callbackopt) → {Promise.<Object>}
    Requests a comment object with the given ID.
API Endpoint: '/comments/:commentID'
Method: GET
    Parameters:
| Name | Type | Attributes | Description | 
|---|---|---|---|
commentID | 
            
            string | Box ID of the comment being requested | |
options | 
            
            Object | 
                
                    <optional> | 
            
            
            Additional options for the request. Can be left null in most cases. | 
callback | 
            
            function | 
                
                    <optional> | 
            
            
            Passed the comment information if it was acquired successfully | 
- Source:
 
Returns:
    A promise resolving to the comment object
- Type
 - Promise.<Object>
 
reply(commentID, commentBody, callbackopt) → {Promise.<Object>}
    Posts a new comment as a reply to another comment.
API Endpoint: '/comments
Method: POST
    Parameters:
| Name | Type | Attributes | Description | 
|---|---|---|---|
commentID | 
            
            string | Comment ID of the comment to reply to | |
commentBody | 
            
            string | text of the comment | |
callback | 
            
            function | 
                
                    <optional> | 
            
            
            passed the new comment data if it was posted successfully | 
- Source:
 
Returns:
    A promise resolving to the new comment object
- Type
 - Promise.<Object>
 
reply(commentID, commentBody, callbackopt) → {Promise.<Object>}
    Posts a new comment as a reply to another comment.
API Endpoint: '/comments
Method: POST
    Parameters:
| Name | Type | Attributes | Description | 
|---|---|---|---|
commentID | 
            
            string | Comment ID of the comment to reply to | |
commentBody | 
            
            string | text of the comment | |
callback | 
            
            function | 
                
                    <optional> | 
            
            
            passed the new comment data if it was posted successfully | 
- Source:
 
Returns:
    A promise resolving to the new comment object
- Type
 - Promise.<Object>
 
update(commentID, updates, callbackopt) → {Promise.<Object>}
    Update some information about a given comment.
API Endpoint: '/comments/:commentID'
Method: PUT
    Parameters:
| Name | Type | Attributes | Description | 
|---|---|---|---|
commentID | 
            
            string | Box ID of the comment being requested | |
updates | 
            
            Object | Fields to update on the comment | |
callback | 
            
            function | 
                
                    <optional> | 
            
            
            Passed the updated comment information if it was acquired successfully | 
- Source:
 
Returns:
    A promise resolving to the updated comment object
- Type
 - Promise.<Object>
 
update(commentID, updates, callbackopt) → {Promise.<Object>}
    Update some information about a given comment.
API Endpoint: '/comments/:commentID'
Method: PUT
    Parameters:
| Name | Type | Attributes | Description | 
|---|---|---|---|
commentID | 
            
            string | Box ID of the comment being requested | |
updates | 
            
            Object | Fields to update on the comment | |
callback | 
            
            function | 
                
                    <optional> | 
            
            
            Passed the updated comment information if it was acquired successfully | 
- Source:
 
Returns:
    A promise resolving to the updated comment object
- Type
 - Promise.<Object>