Enables scripted content fragments to use Comments
- Properties
- AllowsComments
- CanCreateComment
- CanDeleteComment
- CanModifyComment
- Create
- Delete
- Get
- GetAncestors
- List
- ListThreaded
- ListThreadedForComment
- SupportsComments
- Update
Methods
AllowsComments
Checks if comment on the content
Velocity
#set($booleanResponse = $core_v2_comments.AllowsComments($contentId, $contentTypeId))
JavaScript
var booleanResponse = core_v2_comments.AllowsComments(contentId, contentTypeId);
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
contentId | Guid | Content Id | Required | ||
contentTypeId | Guid | Content Type Id | Required |
Returns
Boolean
CanCreateComment
CanCreateComment Overload 1
Checks if the user can create a comment on the content
Velocity
#set($booleanResponse = $core_v2_comments.CanCreateComment($contentId, $contentTypeId))
JavaScript
var booleanResponse = core_v2_comments.CanCreateComment(contentId, contentTypeId);
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
contentId | Guid | Content Id | Required | ||
contentTypeId | Guid | Content Type Id | Required |
CanCreateComment Overload 2
Checks if the user can create a comment on external content
Velocity
#set($booleanResponse = $core_v2_comments.CanCreateComment($contentUrl, $oauthClientId))
JavaScript
var booleanResponse = core_v2_comments.CanCreateComment(contentUrl, oauthClientId);
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
contentUrl | String | The URL at which this content can be accessed. | Required | ||
oauthClientId | Guid | OAuth client ID containing this external content. | Required |
Returns
Boolean
CanDeleteComment
Checks if the user can delete a comment
Velocity
#set($booleanResponse = $core_v2_comments.CanDeleteComment($commentId))
JavaScript
var booleanResponse = core_v2_comments.CanDeleteComment(commentId);
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
commentId | Guid | Comment Id | Required |
Returns
Boolean
CanModifyComment
Checks if the user can modify a comment
Velocity
#set($booleanResponse = $core_v2_comments.CanModifyComment($commentId))
JavaScript
var booleanResponse = core_v2_comments.CanModifyComment(commentId);
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
commentId | Guid | Comment Id | Required |
Returns
Boolean
Create
Create Overload 1
Create a comment on a piece of content
Velocity
#set($commentResponse = $core_v2_comments.Create($contentId, $contentTypeId, $comment, "%{ CommentType = $commentTypeArg, CreatedDate = $createdDateArg, IPAddress = $iPAddressArg, IsApproved = $isApprovedArg, ParentCommentId = $parentCommentIdArg, SortOrder = $sortOrderArg, Url = $urlArg }"))
JavaScript
var commentResponse = core_v2_comments.Create(contentId, contentTypeId, comment, { CommentType: commentTypeArg, CreatedDate: createdDateArg, IPAddress: iPAddressArg, IsApproved: isApprovedArg, ParentCommentId: parentCommentIdArg, SortOrder: sortOrderArg, Url: urlArg });
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
contentId | Guid | Content Id | Required | ||
contentTypeId | Guid | Content Type Id | Required | ||
comment | String | Comment | Required | ||
CommentType | Guid | Comment Type | Optional | ||
CreatedDate | DateTime | Created Date | Optional | Current Date/Time | |
IPAddress | String | I P Address | Optional | ||
IsApproved | Boolean | Is Approved | Optional | True | |
ParentCommentId | Guid | Parent Comment Id | Optional | ||
SortOrder | Int32 | Sort Order | Optional | ||
Url | String | Url | Optional |
Create Overload 2
Create a comment on external content
Velocity
#set($commentResponse = $core_v2_comments.Create($contentUrl, $oauthClientId, $comment, "%{ CommentType = $commentTypeArg, CreatedDate = $createdDateArg, ExtendedAttributes = $extendedAttributesArg, IPAddress = $iPAddressArg, IsApproved = $isApprovedArg, ParentCommentId = $parentCommentIdArg, SortOrder = $sortOrderArg, Url = $urlArg }"))
JavaScript
var commentResponse = core_v2_comments.Create(contentUrl, oauthClientId, comment, { CommentType: commentTypeArg, CreatedDate: createdDateArg, ExtendedAttributes: extendedAttributesArg, IPAddress: iPAddressArg, IsApproved: isApprovedArg, ParentCommentId: parentCommentIdArg, SortOrder: sortOrderArg, Url: urlArg });
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
contentUrl | String | The URL at which this content can be accessed. | Required | ||
oauthClientId | Guid | OAuth client ID containing this external content. | Required | ||
comment | String | Comment | Required | ||
CommentType | Guid | Comment Type | Optional | ||
CreatedDate | DateTime | Created Date | Optional | Current Date/Time | |
ExtendedAttributes | String | Extended attributes are key-value pairs set using the syntax _ExtendedAttributes_key=value. i.e. _ExtendedAttributes_MyKey=MyValue sets ExtendedAttributes["MyKey"] to "MyValue". | Optional | ||
IPAddress | String | I P Address | Optional | ||
IsApproved | Boolean | Is Approved | Optional | True | |
ParentCommentId | Guid | Parent Comment Id | Optional | ||
SortOrder | Int32 | Sort Order | Optional | ||
Url | String | Url | Optional |
Returns
Delete
Delete Overload 1
Deletes a comment
Velocity
#set($additionalInfoResponse = $core_v2_comments.Delete($commentId))
JavaScript
var additionalInfoResponse = core_v2_comments.Delete(commentId);
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
commentId | Guid | Comment Id | Required |
Delete Overload 2
Deletes a comment
Velocity
#set($additionalInfoResponse = $core_v2_comments.Delete($commentId, "%{ DeleteChildren = $deleteChildrenArg }"))
JavaScript
var additionalInfoResponse = core_v2_comments.Delete(commentId, { DeleteChildren: deleteChildrenArg });
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
commentId | Guid | Comment Id | Required | ||
DeleteChildren | Boolean | Delete Children | Optional |
Returns
Get
Gets a single comment
Velocity
#set($commentResponse = $core_v2_comments.Get($commentId))
JavaScript
var commentResponse = core_v2_comments.Get(commentId);
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
commentId | Guid | Comment Id | Required |
Returns
GetAncestors
Gets the hierarchy ancestors for a threaded comment.
Velocity
#set($apiListResponse = $core_v2_comments.GetAncestors($commentId, $depth))
JavaScript
var apiListResponse = core_v2_comments.GetAncestors(commentId, depth);
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
commentId | Guid | Id of the comment | Required | ||
depth | Nullable of Int32 | Level of ancestors to return from the root comment down. Zero based with a max of 9. If 0 is specified, only the root comment id is returned. If the comment is the root comment, ApiList will have no records. | Required |
Returns
List
Lists comments
Velocity
#set($pagedListResponse = $core_v2_comments.List("%{ ApplicationId = $applicationIdArg, CommentIds = $commentIdsArg, CommentType = $commentTypeArg, ContainerId = $containerIdArg, ContentId = $contentIdArg, ContentTypeId = $contentTypeIdArg, ContentUrl = $contentUrlArg, IncludeChildren = $includeChildrenArg, IncludeSubContainers = $includeSubContainersArg, IsApproved = $isApprovedArg, IsFeatured = $isFeaturedArg, PageIndex = $pageIndexArg, PageSize = $pageSizeArg, ParentCommentId = $parentCommentIdArg, SortBy = $sortByArg, SortOrder = $sortOrderArg, UserId = $userIdArg }"))
JavaScript
var pagedListResponse = core_v2_comments.List({ ApplicationId: applicationIdArg, CommentIds: commentIdsArg, CommentType: commentTypeArg, ContainerId: containerIdArg, ContentId: contentIdArg, ContentTypeId: contentTypeIdArg, ContentUrl: contentUrlArg, IncludeChildren: includeChildrenArg, IncludeSubContainers: includeSubContainersArg, IsApproved: isApprovedArg, IsFeatured: isFeaturedArg, PageIndex: pageIndexArg, PageSize: pageSizeArg, ParentCommentId: parentCommentIdArg, SortBy: sortByArg, SortOrder: sortOrderArg, UserId: userIdArg });
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
ApplicationId | Guid | Application Id | Optional | ||
CommentIds | String | Comma separated list of Comment Ids. Used to filter comments and sort order if SoryBy is set to CommentIdsOrder | Optional | ||
CommentType | Guid | Comment Type | Optional | ||
ContainerId | Guid | Container Id | Optional | ||
ContentId | Guid | Content Id | Optional | ||
ContentTypeId | Guid | Content Type Id | Optional | ||
ContentUrl | String | Content Url | Optional | ||
IncludeChildren | Boolean | Include Children | Optional | ||
IncludeSubContainers | Boolean | Include sub containers | Optional | ||
IsApproved | Boolean | Is Approved | Optional | ||
IsFeatured | Boolean | Is Featured | Optional | ||
PageIndex | Int32 | Specify the page number of paged results to return. Zero-based index. | Optional | 0 | |
PageSize | Int32 | Specify the number of results to return per page. | Optional | 20 | |
ParentCommentId | Guid | Parent Comment Id | Optional | ||
SortBy | String | Sort By | Optional | ApplicationId, Body, CommentId, CommentIdsOrder, CommentTypeId, ContainerId, ContentId, ContentTypeId, CreatedUserId, CreatedUtcDate, FormattedBody, IpAddress, IsApproved, IsFeatured, IsIndexed, LastUpdatedUserId, LastUpdatedUtcDate, NodeId, ParentCommentId, Score:SCORE_ID, SortOrder | |
SortOrder | String | Sort Order | Optional | Ascending | Ascending, Descending |
UserId | Int32 | User Id | Optional |
Returns
ListThreaded
Lists threaded comments
Velocity
#set($apiListResponse = $core_v2_comments.ListThreaded("%{ ChildPageSize = $childPageSizeArg, CommentTypeId = $commentTypeIdArg, ContentId = $contentIdArg, ContentTypeId = $contentTypeIdArg, ContentUrl = $contentUrlArg, CreatedEndDate = $createdEndDateArg, CreatedStartDate = $createdStartDateArg, EndCommentId = $endCommentIdArg, FlattenedDepth = $flattenedDepthArg, FlattenedSortBy = $flattenedSortByArg, FlattenedSortOrder = $flattenedSortOrderArg, ParentCommentId = $parentCommentIdArg, RootPageSize = $rootPageSizeArg, StartCommentId = $startCommentIdArg, ThreadedSortBy = $threadedSortByArg, ThreadedSortOrder = $threadedSortOrderArg }"))
JavaScript
var apiListResponse = core_v2_comments.ListThreaded({ ChildPageSize: childPageSizeArg, CommentTypeId: commentTypeIdArg, ContentId: contentIdArg, ContentTypeId: contentTypeIdArg, ContentUrl: contentUrlArg, CreatedEndDate: createdEndDateArg, CreatedStartDate: createdStartDateArg, EndCommentId: endCommentIdArg, FlattenedDepth: flattenedDepthArg, FlattenedSortBy: flattenedSortByArg, FlattenedSortOrder: flattenedSortOrderArg, ParentCommentId: parentCommentIdArg, RootPageSize: rootPageSizeArg, StartCommentId: startCommentIdArg, ThreadedSortBy: threadedSortByArg, ThreadedSortOrder: threadedSortOrderArg });
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
ChildPageSize | Int32 | Specifies the number of child records to return per first level comment. Max of 50. | Optional | 10 | |
CommentTypeId | Guid | Comment type Id | Optional | ||
ContentId | Guid | Content Id | Optional | ||
ContentTypeId | Guid | Content type Id | Optional | ||
ContentUrl | String | The URL at which the content can be accessed. Either ContentUrl or ContentId and ContentTypeId are required. | Optional | ||
CreatedEndDate | DateTime | Created end date. Only filters first level of comments returned. | Optional | ||
CreatedStartDate | DateTime | Created start date. Only filters first level of comments returned. | Optional | ||
EndCommentId | Guid | Ending root level comment Id | Optional | ||
FlattenedDepth | Int32 | Specify the depth at which all child comments will be wrapped under the last level of threaded comments. Zero-based index. Max of 9. | Optional | 3 | |
FlattenedSortBy | String | Sort of flattened comments. | Optional | CreatedDate, Votes | |
FlattenedSortOrder | String | Flattened Sort Order | Optional | Ascending | Ascending, Descending |
ParentCommentId | Guid | Parent Comment Id | Optional | ||
RootPageSize | Int32 | Number of first level comments to return. Max of 100. | Optional | 20 | |
StartCommentId | Guid | Starting root level comment Id | Optional | ||
ThreadedSortBy | String | Sort threaded comments by | Optional | CreatedDate, Votes | |
ThreadedSortOrder | String | Threaded Sort Order | Optional | Ascending | Ascending, Descending |
Returns
ListThreadedForComment
Lists threaded commentes for a content record on a specific comment. Will return all direct anscetors including the comment up until the PageSize is reached. May not return the top level comments if the specified comment is too deap.
Velocity
#set($apiListResponse = $core_v2_comments.ListThreadedForComment("%{ CommentId = $commentIdArg, CommentTypeId = $commentTypeIdArg, ContentId = $contentIdArg, ContentTypeId = $contentTypeIdArg, ContentUrl = $contentUrlArg, Direction = $directionArg, FlattenedDepth = $flattenedDepthArg, FlattenedSortBy = $flattenedSortByArg, FlattenedSortOrder = $flattenedSortOrderArg, PageSize = $pageSizeArg, ThreadedSortBy = $threadedSortByArg, ThreadedSortOrder = $threadedSortOrderArg }"))
JavaScript
var apiListResponse = core_v2_comments.ListThreadedForComment({ CommentId: commentIdArg, CommentTypeId: commentTypeIdArg, ContentId: contentIdArg, ContentTypeId: contentTypeIdArg, ContentUrl: contentUrlArg, Direction: directionArg, FlattenedDepth: flattenedDepthArg, FlattenedSortBy: flattenedSortByArg, FlattenedSortOrder: flattenedSortOrderArg, PageSize: pageSizeArg, ThreadedSortBy: threadedSortByArg, ThreadedSortOrder: threadedSortOrderArg });
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
CommentId | Guid | Comment Id | Optional | ||
CommentTypeId | Guid | Comment type Id | Optional | ||
ContentId | Guid | Content Id | Optional | ||
ContentTypeId | Guid | Content type Id | Optional | ||
ContentUrl | String | The URL at which the content can be accessed. Either ContentUrl or ContentId and ContentTypeId are required. | Optional | ||
Direction | String | Specifies the direction paging occurs, either up from the CommentId passed in to the root comment, or down from the root comment for the CommentId passed in. | Optional | FromComment, FromRootComment | |
FlattenedDepth | Int32 | Specify the depth at which all child comments will be wrapped under the last level of threaded comments. Zero-based index. Max of 9. | Optional | 3 | |
FlattenedSortBy | String | Sort of flattened comments. | Optional | CreatedDate, Votes | |
FlattenedSortOrder | String | Flattened Sort Order | Optional | Ascending | Ascending, Descending |
PageSize | Int32 | Number of comments to return. Max of 100. | Optional | 20 | |
ThreadedSortBy | String | Sort threaded comments by | Optional | CreatedDate, Votes | |
ThreadedSortOrder | String | Threaded Sort Order | Optional | Ascending | Ascending, Descending |
Returns
SupportsComments
Checks if comments are supported for the content type
Velocity
#set($booleanResponse = $core_v2_comments.SupportsComments($contentTypeId))
JavaScript
var booleanResponse = core_v2_comments.SupportsComments(contentTypeId);
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
contentTypeId | Guid | Content Type Id | Required |
Returns
Boolean
Update
Update an existing comment
Velocity
#set($commentResponse = $core_v2_comments.Update($commentId, $comment, "%{ CommentType = $commentTypeArg, CreatedDate = $createdDateArg, ExtendedAttributes = $extendedAttributesArg, IsApproved = $isApprovedArg, IsFeatured = $isFeaturedArg, SortOrder = $sortOrderArg }"))
JavaScript
var commentResponse = core_v2_comments.Update(commentId, comment, { CommentType: commentTypeArg, CreatedDate: createdDateArg, ExtendedAttributes: extendedAttributesArg, IsApproved: isApprovedArg, IsFeatured: isFeaturedArg, SortOrder: sortOrderArg });
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
commentId | Guid | Comment Id | Required | ||
comment | String | Comment | Required | ||
CommentType | Guid | Comment Type | Optional | ||
CreatedDate | DateTime | Created Date | Optional | ||
ExtendedAttributes | String | Extended attributes are key-value pairs set using the syntax _ExtendedAttributes_key=value. i.e. _ExtendedAttributes_MyKey=MyValue sets ExtendedAttributes["MyKey"] to "MyValue". | Optional | ||
IsApproved | Boolean | Is Approved | Optional | ||
IsFeatured | Boolean | Is Featured | Optional | ||
SortOrder | Int32 | Sort Order | Optional |