Enables scripted content fragments to use Comments
Methods
AllowsComments
Checks if comment on the content
Usage
#set($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 |
Return Type
bool
CanCreateComment
Checks if the user can create a comment on the content
Usage
#set($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 |
Return Type
bool
CanCreateComment
Checks if the user can create a comment on external content
Usage
#set($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 |
Return Type
bool
CanDeleteComment
Checks if the user can delete a comment
Usage
#set($booleanResponse = $core_v2_comments.CanDeleteComment($commentId))
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
commentId | Guid | Comment Id | Required |
Return Type
bool
CanModifyComment
Checks if the user can modify a comment
Usage
#set($booleanResponse = $core_v2_comments.CanModifyComment($commentId))
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
commentId | Guid | Comment Id | Required |
Return Type
bool
Create
Create a comment on a piece of content
Usage
#set($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 | bool | Is Approved | Optional | True | |
ParentCommentId | Guid | Parent Comment Id | Optional | ||
SortOrder | int | Sort Order | Optional | ||
Url | string | Url | Optional |
Return Type
Create
Create a comment on external content
Usage
#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}"))
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 | bool | Is Approved | Optional | True | |
ParentCommentId | Guid | Parent Comment Id | Optional | ||
SortOrder | int | Sort Order | Optional | ||
Url | string | Url | Optional |
Return Type
Delete
Deletes a comment
Usage
#set($additionalInfoResponse = $core_v2_comments.Delete($commentId))
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
commentId | Guid | Comment Id | Required |
Return Type
Delete
Deletes a comment
Usage
#set($additionalInfoResponse = $core_v2_comments.Delete($commentId, "%{DeleteChildren = $deleteChildrenArg}"))
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
commentId | Guid | Comment Id | Required | ||
DeleteChildren | bool | Delete Children | Optional |
Return Type
Get
Gets a single comment
Usage
#set($commentResponse = $core_v2_comments.Get($commentId))
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
commentId | Guid | Comment Id | Required |
Return Type
GetAncestors
Gets the hierarchy ancestors for a threaded comment.
Usage
#set($apiListResponse = $core_v2_comments.GetAncestors($commentId, $depth))
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
commentId | Guid | Id of the comment | Required | ||
depth | int? | 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 |
Return Type
List
Lists comments
Usage
#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}"))
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 | bool | Include Children | Optional | ||
IncludeSubContainers | bool | Include sub containers | Optional | ||
IsApproved | bool | Is Approved | Optional | ||
IsFeatured | bool | Is Featured | Optional | ||
PageIndex | int | Specify the page number of paged results to return. Zero-based index. | Optional | 0 | |
PageSize | int | 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 | int | User Id | Optional |
Return Type
ListThreaded
Lists threaded comments
Usage
#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}"))
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
ChildPageSize | int | 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 | int | 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 | int | 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 |
Return Type
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.
Usage
#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}"))
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 | int | 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 | int | 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 |
Return Type
SupportsComments
Checks if comments are supported for the content type
Usage
#set($booleanResponse = $core_v2_comments.SupportsComments($contentTypeId))
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
contentTypeId | Guid | Content Type Id | Required |
Return Type
bool
Update
Update an existing comment
Usage
#set($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 | bool | Is Approved | Optional | ||
IsFeatured | bool | Is Featured | Optional | ||
SortOrder | int | Sort Order | Optional |