Enables scripted content fragments to use Comments
Properties
| Name | Access | Type | Description |
|---|---|---|---|
| ContentTypeId | Read | Guid | Comments content type identifier |
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
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
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
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
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 | ||
| options | Options | Set of optional parameters including: | 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 | Number | 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 | ||
| options | Options | Set of optional parameters including: | 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 | Number | 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 | ||
| options | Options | Set of optional parameters including: | 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 Number | 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, ApplicationIds = $applicationIdsArg, CommentIds = $commentIdsArg, CommentType = $commentTypeArg, ContainerId = $containerIdArg, ContainerIds = $containerIdsArg, ContentId = $contentIdArg, ContentIds = $contentIdsArg, ContentTypeId = $contentTypeIdArg, ContentUrl = $contentUrlArg, IncludeAllTypeIds = $includeAllTypeIdsArg, 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, ApplicationIds: applicationIdsArg, CommentIds: commentIdsArg, CommentType: commentTypeArg, ContainerId: containerIdArg, ContainerIds: containerIdsArg, ContentId: contentIdArg, ContentIds: contentIdsArg, ContentTypeId: contentTypeIdArg, ContentUrl: contentUrlArg, IncludeAllTypeIds: includeAllTypeIdsArg, 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 |
|---|---|---|---|---|---|
| options | Options | Set of optional parameters including: | Required | ||
| ApplicationId | Guid | Application Id. Filtering by ApplicationId will ignore ApplicationIds and ContainerIds. | Optional | ||
| ApplicationIds | String | Comma separated list of ApplicationIds. Used to limit to a specific set of comments. Filtering by ApplicationIds will ignore ContainerId and ContainerIds. | Optional | ||
| CommentIds | String | Comma separated list of CommentIds. Used to limit to a specific set of comments and sort order if SortBy is set to CommentIdsOrder. Filtering by CommentIds will ignore ContentId, ContentUrl, ApplicationId, ContainerId, ContentTypeId, ContentIds, ApplicationIds and ContainerIds. | Optional | ||
| CommentType | Guid | Comment Type | Optional | ||
| ContainerId | Guid | Container Id. Filtering by ContainerId will ignore ContainerIds. | Optional | ||
| ContainerIds | String | Comma separated list of ContainerIds. Used to limit to a specific set of comments. | Optional | ||
| ContentId | Guid | Content Id. Filtering by ContentId will ignore ContentUrl, ApplicationId, ContainerId, ContentIds, ApplicationIds and ContainerIds. | Optional | ||
| ContentIds | String | Comma separated list of ContentIds. Used to limit to a specific set of comments. Filtering by ContentIds will ignore ApplicationId, ContainerId, ContentTypeId, ApplicationIds and ContainerIds. | Optional | ||
| ContentTypeId | Guid | Content Type Id | Optional | ||
| ContentUrl | String | The URL at which this content can be accessed. Filtering by ContentUrl will ignore ApplicationId, ContainerId, ContentIds, ApplicationIds and ContainerIds. | Optional | ||
| IncludeAllTypeIds | Guid | Option to include all Comment Type's. If CommentType is passed in, will be ignored. | Optional | False | |
| IncludeChildren | Boolean | Include Children | Optional | ||
| IncludeSubContainers | Boolean | Include comments in sub-containers. Only used if ContainerId is specified. | Optional | ||
| IsApproved | Boolean | Is Approved | Optional | ||
| IsFeatured | Boolean | Is Featured | Optional | ||
| PageIndex | Number | Specify the page number of paged results to return. Zero-based index. | Optional | 0 | |
| PageSize | Number | Specify the number of results to return per page. | Optional | 20 | |
| ParentCommentId | Guid | Parent comment Id. Filtering by ParentCommentId will ignore ContentId, ContentUrl, ApplicationId, ContainerId, CommentIds, ContentIds, ApplicationIds and ContainerIds. | 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 | Number | 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 |
|---|---|---|---|---|---|
| options | Options | Set of optional parameters including: | Required | ||
| ChildPageSize | Number | 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 | Number | 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 | Number | 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 |
|---|---|---|---|---|---|
| options | Options | Set of optional parameters including: | Required | ||
| 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 | Number | 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 | Number | 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
ToString
Velocity
#set($stringResponse = $core_v2_comments.ToString())
JavaScript
var stringResponse = core_v2_comments.ToString();
Returns
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 | ||
| options | Options | Set of optional parameters including: | 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 | Number | Sort Order | Optional |