Exposes the article category api to widgets,themes and automation.
Properties
| Name | Access | Type | Description |
|---|---|---|---|
| Current | Read | Category | Current |
Methods
Create
Create Overload 1
Velocity
#set($categoryResponse = $articles_v1_categories.Create($collectionId, $name))
JavaScript
var categoryResponse = articles_v1_categories.Create(collectionId, name);
Parameters
| Name | Type | Description | Required | Default | Options |
|---|---|---|---|---|---|
| collectionId | Guid | Id of the collection where the category is to be created. | Required | ||
| name | String | Name of the category. | Required |
Create Overload 2
Velocity
#set($categoryResponse = $articles_v1_categories.Create($collectionId, $name, "%{ DefaultArticleId = $defaultArticleIdArg, Description = $descriptionArg, ImageFileName = $imageFileNameArg, ImageFileUploadContext = $imageFileUploadContextArg, ParentId = $parentIdArg, SortOrder = $sortOrderArg }"))JavaScript
var categoryResponse = articles_v1_categories.Create(collectionId, name, { DefaultArticleId: defaultArticleIdArg, Description: descriptionArg, ImageFileName: imageFileNameArg, ImageFileUploadContext: imageFileUploadContextArg, ParentId: parentIdArg, SortOrder: sortOrderArg });Parameters
| Name | Type | Description | Required | Default | Options |
|---|---|---|---|---|---|
| collectionId | Guid | Id of the collection where the category is to be created. | Required | ||
| name | String | Name of the category. | Required | ||
| options | Options | Set of optional parameters including: | Required | ||
| DefaultArticleId | Guid | Id of the article that is the default for the category. | Optional | ||
| Description | String | A description of the article category and/or it's contents. | Optional | ||
| ImageFileName | String | File Name. Required when updating featured item using FileUploadContext. Optional parameter | Optional | ||
| ImageFileUploadContext | String | File Upload Context. When adding an image either FileData or FileUploadContext is required. Optional parameter | Optional | ||
| ParentId | Int32 | The parent category of the category being created. | Optional | ||
| SortOrder | Int32 | Used to determine the order in which the category is displayed alongside other categories. | Optional |
Returns
Delete
Delete Overload 1
Velocity
#set($additionalInfoResponse = $articles_v1_categories.Delete($id))
JavaScript
var additionalInfoResponse = articles_v1_categories.Delete(id);
Parameters
| Name | Type | Description | Required | Default | Options |
|---|---|---|---|---|---|
| Id | Int32 | Id of the category to be deleted. | Required |
Delete Overload 2
Velocity
#set($additionalInfoResponse = $articles_v1_categories.Delete($id, "%{ ReassignToCategoryId = $reassignToCategoryIdArg }"))JavaScript
var additionalInfoResponse = articles_v1_categories.Delete(id, { ReassignToCategoryId: reassignToCategoryIdArg });Parameters
| Name | Type | Description | Required | Default | Options |
|---|---|---|---|---|---|
| Id | Int32 | Id of the category to be deleted. | Required | ||
| options | Options | Set of optional parameters including: | Required | ||
| ReassignToCategoryId | Int32 | The category id to assign the articles and child categories to after deletion. | Optional |
Returns
Get
Velocity
#set($categoryResponse = $articles_v1_categories.Get("%{ ArticleCollectionId = $articleCollectionIdArg, Id = $idArg, UrlKey = $urlKeyArg }"))JavaScript
var categoryResponse = articles_v1_categories.Get({ ArticleCollectionId: articleCollectionIdArg, Id: idArg, UrlKey: urlKeyArg });Parameters
| Name | Type | Description | Required | Default | Options |
|---|---|---|---|---|---|
| options | Options | Set of optional parameters including: | Required | ||
| ArticleCollectionId | Guid | Used when passing a UrlKey. ArticleCollectionId and UrlKey are used to find the specific category. | Optional | ||
| Id | Int32 | Id of the category to return. When passed, ArticleCollectionId, and UrlKey are ignored. | Optional | ||
| UrlKey | String | Used when passing an ArticleCollectionId. ArticleCollectionId and UrlKey are used to find the specific category. | Optional |
Returns
List
List Overload 1
Velocity
#set($apiListResponse = $articles_v1_categories.List($collectionId))
JavaScript
var apiListResponse = articles_v1_categories.List(collectionId);
Parameters
| Name | Type | Description | Required | Default | Options |
|---|---|---|---|---|---|
| collectionId | Guid | Id of the collection to filter categories by | Required |
List Overload 2
Velocity
#set($apiListResponse = $articles_v1_categories.List($collectionId, "%{ ArticleId = $articleIdArg, CategoryOrChildrenHaveArticles = $categoryOrChildrenHaveArticlesArg, DefaultArticleId = $defaultArticleIdArg, IsDeleted = $isDeletedArg, ParentId = $parentIdArg, RootLevelOnly = $rootLevelOnlyArg }"))JavaScript
var apiListResponse = articles_v1_categories.List(collectionId, { ArticleId: articleIdArg, CategoryOrChildrenHaveArticles: categoryOrChildrenHaveArticlesArg, DefaultArticleId: defaultArticleIdArg, IsDeleted: isDeletedArg, ParentId: parentIdArg, RootLevelOnly: rootLevelOnlyArg });Parameters
| Name | Type | Description | Required | Default | Options |
|---|---|---|---|---|---|
| collectionId | Guid | Id of the collection to filter categories by | Required | ||
| options | Options | Set of optional parameters including: | Required | ||
| ArticleId | Guid | Id of the article. Filter categores to a specific article. | Optional | ||
| CategoryOrChildrenHaveArticles | Boolean | Only returns categories that have published articles, or direct children have published articles. Cannot be used if filtering by ArticleId. | Optional | ||
| DefaultArticleId | Guid | Id of the article. Filter categories to ones that use the provided article as their default. | Optional | ||
| IsDeleted | Boolean | Filters categories that have been deleted. | Optional | ||
| ParentId | Int32 | Id of the parent category to filter by. | Optional | ||
| RootLevelOnly | Boolean | Only returns the root level categories. When true, parent id is ignored. | Optional |
Returns
Lookup
Lookup Overload 1
Velocity
#set($apiListResponse = $articles_v1_categories.Lookup($query))
JavaScript
var apiListResponse = articles_v1_categories.Lookup(query);
Parameters
| Name | Type | Description | Required | Default | Options |
|---|---|---|---|---|---|
| query | String | Query | Required |
Lookup Overload 2
Velocity
#set($apiListResponse = $articles_v1_categories.Lookup($query, "%{ ArticleCollectionId = $articleCollectionIdArg }"))JavaScript
var apiListResponse = articles_v1_categories.Lookup(query, { ArticleCollectionId: articleCollectionIdArg });Parameters
| Name | Type | Description | Required | Default | Options |
|---|---|---|---|---|---|
| query | String | Query | Required | ||
| options | Options | Set of optional parameters including: | Required | ||
| ArticleCollectionId | Guid | The ID of the ArticleCollection to search for articles. When not specified, categories can only be found by ID or URL. | Optional |
Returns
Undelete
Velocity
#set($categoryResponse = $articles_v1_categories.Undelete($id))
JavaScript
var categoryResponse = articles_v1_categories.Undelete(id);
Parameters
| Name | Type | Description | Required | Default | Options |
|---|---|---|---|---|---|
| Id | Int32 | Id of the category to undelete. | Required |
Returns
Update
Velocity
#set($categoryResponse = $articles_v1_categories.Update($id, "%{ DefaultArticleId = $defaultArticleIdArg, Description = $descriptionArg, ImageFileName = $imageFileNameArg, ImageFileUploadContext = $imageFileUploadContextArg, Name = $nameArg, ParentId = $parentIdArg, RemoveDefaultArticleId = $removeDefaultArticleIdArg, RemoveImage = $removeImageArg, RemoveParentId = $removeParentIdArg, RemoveSortOrder = $removeSortOrderArg, SortOrder = $sortOrderArg }"))JavaScript
var categoryResponse = articles_v1_categories.Update(id, { DefaultArticleId: defaultArticleIdArg, Description: descriptionArg, ImageFileName: imageFileNameArg, ImageFileUploadContext: imageFileUploadContextArg, Name: nameArg, ParentId: parentIdArg, RemoveDefaultArticleId: removeDefaultArticleIdArg, RemoveImage: removeImageArg, RemoveParentId: removeParentIdArg, RemoveSortOrder: removeSortOrderArg, SortOrder: sortOrderArg });Parameters
| Name | Type | Description | Required | Default | Options |
|---|---|---|---|---|---|
| Id | Int32 | Id of the category to be updated. | Required | ||
| options | Options | Set of optional parameters including: | Required | ||
| DefaultArticleId | Guid | Id of the article that is the default for the category. | Optional | ||
| Description | String | A description of the article category and/or it's contents. | Optional | ||
| ImageFileName | String | File Name. Required when updating featured item using FileUploadContext. Optional parameter | Optional | ||
| ImageFileUploadContext | String | File Upload Context. When adding an image either FileData or FileUploadContext is required. Optional parameter | Optional | ||
| Name | String | Name of the category. | Optional | ||
| ParentId | Int32 | The parent category of the category being updated. | Optional | ||
| RemoveDefaultArticleId | Boolean | Allows removing a categories default article. | Optional | ||
| RemoveImage | Boolean | Allows removing a categories image. | Optional | ||
| RemoveParentId | Boolean | Allows removing a categories parent, moving the category to the root level. | Optional | ||
| RemoveSortOrder | Boolean | Allows resetting a categories sort order. | Optional | ||
| SortOrder | Int32 | Used to determine the order in which the category is displayed alongside other categories. | Optional |