Skip to content

Web api for developers (v1.x)

Lukas Gerbenis edited this page Dec 14, 2015 · 4 revisions

Table Of Contents

Introduction

This document is addressed to communicate a Better CMS API protocol. There are two options to access the Better CMS API:

  1. With HTTP Request
  2. Direct C# method call (a BetterCms.Module.Api assembly must be referenced).

Request

To get a list, a default request data should be provided:
Field Name Type Description
filter DataFilter Data filter object with filter options list and inner filters list.
order DataOrder The list with order options.
take int The maximum count of returning items.
skip int The number of items to skip.

DataFilter object:

Field Name Type Description
connector string The connector of filter items. Possible values:
  • and (default, optional)
  • or
where* List<DataFilterItem> The list of filter options.
inner List<DataFilter> The list of inner filters.

DataFilterItem object:

Field Name Type Description
field* string The field name of the model, which is returned in the response.
operation string Filtering operation. Possible values:
  • Equal (default, optional)
  • NotEqual
  • Less
  • LessOrEqual
  • Greater
  • GreaterOrEqual
  • Contains
  • NotContains
  • StartsWith
  • EndsWith
value string Filtering value.

* (asterisk) - a required field.

DataOrder object:

Field Name Type Description
by* List<DataOrderItem> The list of order options.

DataOrderItem object:

Field Name Type Description
field* string The field name of the model, which is returned in the response.
direction string The direction of sorting items. Possible values:
  • asc (default, optional)
  • desc

* (asterisk) - a required field.

User identity

In some cases, the "User Identity" object may be passed for filtering (e.g. for filtering out pages / media / blog posts for user "user1" with roles "role1" and "role2").
This can be done by passing "User Object" within request

Field Name Type Description
name* string User identity name (e.g. "admin", "[email protected]", etc.).
roles List<string> List of user role names (e.g. "role1", "BcmsEditContent", etc.).

Success response

HTTP: always returns a HTTP CODE 200.

Generally Better CMS always returns result in format:

Field Name Type Description
data* object See concrete API methods for the data object specification.

Default response.data object when getting a list using default response:

Field Name Type Description
items* List<TModel> A list of Model object (where TModel is type of retrieving item).
totalCount* int A total count of found items.

* (asterisk) - a required/always transmitted field.

Error response

HTTP: always returns a HTTP CODE 500 and response object:

Field Name Type Description
responseStatus* ResponseStatus An error object.

ResponseStatus object:

Field Name Type Description
errorCode* string The name of the Exception type.
message string A human friendly error message.
stackTrace string A error stack trace.
errors List<ResponseError> For multiple detailed validation errors. Used for returning multiple field validation errors.

ResponseError object:

Field Name Type Description
errorCode* string The name of the Exception type.
fieldName string A human friendly error message.
message string A error stack trace.

C#: always throws XException (TBD.)

TODO: add exception handling example.


All available methods

NOTE: Save (POST / PUT / DELETE) methods were implemented in version 1.7.0

By default, Better CMS API uses RESTful API model with these REST methods (there are few exceptions):

Resource GET PUT POST DELETE
Collection URI, such as /bcms-api/tags Returns a collection of (lightweight) objects Not used Creates a new entry in the collection. Not used
Element URI, such as /bcms-api/tags/{TagId} Returns one object, usually with more details that collection Replaces an entry in the collection. If entry doesn't exist, creates it Not used Deletes an entry from the collection.

All available URIs and methods:

<tbody>
URL Description Provided methods
/bcms-api/authors Blog post authors GET POST
/bcms-api/authors/{AuthorId} Blog post author GET PUT DELETE
/bcms-api/blog-post-properties/ Blog post properties (only create method) POST
/bcms-api/blog-post-properties/{BlogPostId} Blog post properties GET PUT DELETE
/bcms-api/blog-posts Blog posts GET
/bcms-api/blog-posts/{BlogPostId} Blog post GET
/bcms-api/blog-posts/content/{ContentId} Blog post content GET
/bcms-api/blog-settings Blog post settings (default blog post template / master page) GET PUT
/bcms-api/categorytrees Categories trees GET POST
/bcms-api/categorytrees/{CategoryTreeId} Category tree GET DELETE PUT
/bcms-api/categorizable-items Categorizable items GET
/bcms-api/categorytrees/{CategoryTreeId}/nodes/{CategoryTreeNodeId} Category node GET DELETE PUT
/bcms-api/categorytrees/nodes All categories nodes GET
/bcms-api/categorytrees/{CategoryTreeId}/nodes Category nodes POST GET
/bcms-api/contents/{ContentId}/draft The method to destory draft version of already published content DELETE
/bcms-api/contents/{ContentId}/history Content's historical versions GET
/bcms-api/contents/html HTML content (only create) POST
/bcms-api/contents/html/{ContentId} HTML content GET PUT DELETE
/bcms-api/current-version Version of installed Better CMS GET
/bcms-api/files Media files GET POST
/bcms-api/files/{FileId} Media file GET PUT DELETE
/bcms-api/folders Media folders GET POST
/bcms-api/folders/{FolderId} Media folder GET PUT DELETE
/bcms-api/images Media images GET POST
/bcms-api/images/{ImageId} Media image GET PUT DELETE
/bcms-api/languages languages GET POST
/bcms-api/languages/{LanguageId} Language GET PUT DELETE
/bcms-api/languages/by-code/{Language Code} Language by language code GET
/bcms-api/layouts Page layouts (templates) GET POST
/bcms-api/layouts/{LayoutId} Page layout (template) GET PUT DELETE
/bcms-api/layouts/{LayoutId}/options Page layout (template) options GET
/bcms-api/layouts/{LayoutId}/regions Page layout (template) regions GET
/bcms-api/media-tree Media tree GET
/bcms-api/page-exists/{PageUrl*} Method for checking if page exists (by provided page URL) GET
/bcms-api/page-properties/ Page properties (only create) POST
/bcms-api/page-properties/{PageId} Page properties GET PUT DELETE
/bcms-api/page-properties/by-url/{PageUrl*} Page properties by page URL GET
/bcms-api/pages Pages GET
/bcms-api/pages/{PageId} Page GET
/bcms-api/pages/{PageId}/contents Page contents GET POST
/bcms-api/pages/{PageId}/contents/{PageContentId} Page content by specified page and page content id GET PUT DELETE
/bcms-api/pages/by-url/{PageUrl*} Page by URL GET
/bcms-api/pages/contents/{PageContentId}/options Page content's options GET
/bcms-api/pages/search/{SearchString*} Search result by the provided search query GET
/bcms-api/pages/translations/by-url/{PageUrl} Page translations by provided page URL GET
/bcms-api/pages/{PageId}/translations Page translations GET
/bcms-api/redirects Redirects GET POST
/bcms-api/redirects/{RedirectId} Redirect GET PUT DELETE
/bcms-api/roles User roles GET POST
/bcms-api/roles/{RoleId} User role GET PUT DELETE
/bcms-api/roles/by-name/{RoleName} User role by role name GET
/bcms-api/sitemap-node/{NodeId} Sitemap node GET
/bcms-api/sitemap-nodes/{SitemapId} Sitemap nodes GET
/bcms-api/sitemaps Sitemaps GET POST
/bcms-api/sitemaps/{SitemapId} Sitemap GET PUT DELETE
/bcms-api/sitemaps/{SitemapId}/nodes/ Sitemap nodes GET POST
/bcms-api/sitemaps/{SitemapId}/nodes/{NodeId} Sitemap node by sitemap id and node id GET PUT DELETE
/bcms-api/sitemaps/{SitemapId}/tree/ Sitemaps tree GET
/bcms-api/sitemap-tree/{SitemapId} Sitemaps tree GET
/bcms-api/sitemap-trees Sitemaps tree list GET
/bcms-api/tags Tags GET POST
/bcms-api/tags/{TagId} Tag GET PUT DELETE
/bcms-api/tags/by-name/{Tag Name} Tag by name GET
/bcms-api/users Users GET POST
/bcms-api/users/{UserId} User by id GET PUT DELETE
/bcms-api/users/by-username/{UserName} User by username GET
/bcms-api/users/validate User's username and password validation GET
/bcms-api/widgets Widgets GET
/bcms-api/widgets/html-content/ HTML content widget (create only) POST
/bcms-api/widgets/html-content/{WidgetId} HTML content widget GET PUT DELETE
/bcms-api/widgets/html-content/{WidgetId}/options HTML content widget options GET
/bcms-api/widgets/server-control/ Server control widget (create only) POST
/bcms-api/widgets/server-control/{WidgetId} Server control widget GET PUT DELETE
/bcms-api/widgets/server-control/{WidgetId}/options Server control widget options GET

The list request/response example

There are the examples of request with filters, inner filters, order and paging in JSON format:

<h3>URL query filtering:</h3>
<ul>
   <li><strong>Filter</strong> (<i>WHERE Name Contains "test"</i>): <code>?data={filter:{where:[{field:Name,operation:contains,value:test}]}}</code></li>
   <li><strong>Order</strong> (<i>ORDER BY categoryName DESC, CreatedOn ASC</i>): <code>?data={order:{by:[{field:CategoryName, direction:desc},{field:CreatedOn}]}}</code></li>
   <li><strong>Paging</strong> (<i>TAKE 5 SKIP 3</i>): <code>?data={take:5,skip:3}</code></li>
   <li><strong>Filter, order, paging</strong> (<i>WHERE Name StartsWith "A" ORDER BY CategoryName DESC TAKE 3 SKIP 5</i>): <code>?data={filter:{where:

[{field:Name,operation:startsWith,value:A}]},take:3,skip:5,order:{by:[{field:CategoryName, direction:desc}]}}

  • Filter with inner filter (WHERE Name Contains "test" AND (Name EndsWith "Z" OR Name EndsWith "S")): ?data={filter:{where:[{field:Name,operation:contains,value:test}],inner:{connector:or,where:[{field:Name,operation:endsWith,value:Z},{field:Name,operation:endsWith,value:S}]}}}
  • List filtering with filtering by user identity (UserName = "admin"): ?data={filter:{where:[{field:Title,operation:startsWith,value:test}]}}&user={name:admin,roles:[role1,role2]}
  • Filter, sorting and paging with filtering by user identity with roles (UserName = "admin" AND user is in roles: "role1", "role2"):?data={filter:{where:[{field:Title,operation:startsWith,value:test}]}}&user={name:admin,roles:[role1,role2]}
  • JSON filtering:

    data = {
        filter: {
            connector: 'and',
            where: [
                { field: 'CreatedOn', value: '\/Date(1224043200000)\/', operation: 'Greater' },
                { field: 'Title', value: 'Africa', operation: 'NotEqual' }
            ],
            inner: [
                {
                    connector: 'or',
                    where: [
                        { field: 'Title', value: 'It', operation: 'StartsWith' },
                        { field: 'Title', value: 'Af', operation: 'StartsWith' },
                        { field: 'Title', value: 'na', operation: 'EndsWith' }
                    ]
                }
            ]
        },
        order: {
            by: [
                { field: 'CreatedOn' },
                { field: 'Title', direction: 'desc' }
            ],
        },
        skip: 3,
        take: 5
    }
    

    Code API example

    This is an example of a list request with filter, inner filters, sorting and paging. Usually, for the list/item, Get() method should be called (for example, getting the list of widgets, Pages.Widgets.Get() should be called).

    Note: Do not forget to dispose the API instance after using (best way to accomplish this is to wrap all the API code within using):

            using (var api = ApiFactory.Create())
            {
                var requestModel = new GetWidgetsModel();
                requestModel.Take = 5; // Retrieves 5 items
                requestModel.Skip = 3; // Skips 3 items
    
                requestModel.Order.Add("Name"); // Sorts by name ascending
                requestModel.Order.Add("CreatedOn", OrderDirection.Desc); // Then sorts by date descending
    
                requestModel.Filter.Connector = FilterConnector.And; // Filtering connector (optional, default value = FilterConnector.And)
                requestModel.Filter.Add("Name", "A", FilterOperation.StartsWith); // Filters by name: item should start with "A"
                requestModel.Filter.Add("Name", "B", FilterOperation.EndsWith); // Filters by name: item should start with "B"
    
                var innerFilter = new DataFilter(FilterConnector.Or); // Create inner filter
                innerFilter.Add("CreatedBy", "Name.Surname.1");
                innerFilter.Add("CreatedBy", "Name.Surname.2");
                requestModel.Filter.Inner.Add(innerFilter); // Add inner filter to filters list
    
                var request = new GetWidgetsRequest { Data = requestModel }; // Create request
    
                var widgets = api.Pages.Widgets.Get(request); // Execute query
            }
    

    Root

    Version

    Get current version number

    HTTP GET: /bcms-api/current-version/

    C#: api.Root.Version.Get()

    No request model needed.

    A success response.data object format:

    Field Name Type Description
    version* string An underlying Better CMS version.

    Layouts

    Get a list of layouts

    HTTP GET: /bcms-api/layouts/

    C#: api.Root.Layouts.Get()

    Retrieves the list of all available layouts.

    Use default list filtering, sorting and paging options.

    A success response.data object format:

    Field Name Type Description
    items List<Layout> A list of Layout objects.
    totalCount int A total count of found layouts.

    Layout object format:

    Field Name Type Description
    id* Guid Layout id.
    name* string(200) Layout name.
    layoutPath* string(850) Layout path (server URL).
    previewUrl string(850) Layout image preview URL.
    createdOn* DateTime The date of layout creation.
    createdBy* string(200) User name of layout creator.
    lastModifiedOn* DateTime The date of layout last modification.
    lastModifiedBy* string(200) User name of layout last modificator.
    version* int A record version number.

    Get layout by ID

    HTTP GET: /bcms-api/layouts/{id}

    C#: api.Root.Layout.Get()

    Returns layout, identified by ID.

    A success response.data object format:

    Field Name Type Description
    id* Guid Layout id.
    name* string(200) Layout name.
    layoutPath* string(850) Layout path (server URL).
    previewUrl string(850) Layout image preview URL.
    createdOn* DateTime The date of layout creation.
    createdBy* string(200) User name of layout creator.
    lastModifiedOn* DateTime The date of layout last modification.
    lastModifiedBy* string(200) User name of layout last modificator.
    version* int A record version number.

    For code API, use these request properties:

    Field Name Type Description
    LayoutId Guid Layout id.

    Get layout regions by layout ID

    HTTP GET: /bcms-api/layouts/{layoutId}/regions/

    C#: api.Root.Layout.Regions.Get()

    Returns the list and total count of specified layout regions.

    Use default list filtering, sorting and paging options.

    A success response.data object format:

    Field Name Type Description
    items List<Region> A list of Region objects.
    totalCount int Total count of found regions.

    Region object format:

    Field Name Type Description
    id* Guid A region id.
    regionIdentifier* string(200) Region identifier.
    description string(200) Layout region description.
    createdOn* DateTime The date of region creation.
    createdBy* string(200) User name of region creator.
    lastModifiedOn* DateTime The date of region last modification.
    lastModifiedBy* string(200) User name of last region modificator.
    version* int A record version number.

    Request parameters for code API:

    Field Name Type Description
    layoutId* Guid A layout id.

    Get layout options by layout ID

    HTTP GET: /bcms-api/layouts/{LayoutId}/options

    C#: api.Root.Layout.Regions.Get()

    Returns the list and total count of layout option objects, identified by layout ID.

    Use default request for getting a list.

    For code API use these request parameters:

    Field Name Type Description
    LayoutId* Guid Page content id.

    A success response.data object format:

    Field Name Type Description
    items List<Option> A list of Option objects.
    totalCount int Total count of found layout options.

    Option object format:

    Field Name Type Description
    key* string(200) Option key.
    defaultValue string Default option value.
    type* string Layout option type:
    • Text
    • Integer
    • Float
    • Boolean
    • DateTime

    Categories

    Get a list of categories trees

    Categories structure explanation

    BetterCMS has hierarchy based categorie structure, so each category node can have it's child category nodes, this allows for example to have countries category, inside country have cities ect. It helps to manage categories and search for items.

    HTTP GET: /bcms-api/categorytrees/

    C#: api.Root.Categories.Get()

    Returns object GetCategoryTreesResponse with property Data (type of CategoryTreesModel) containing list of and total count available categories trees.

    Use default list filtering, sorting and paging options.

    CategoryTreesModel object structure:

    Field Name Type Description
    Items List<CategoryTreeModel> A list of CategoryTreeModel objects.
    TotalCount int Total count of category trees.

    List<CategoryTreeModel> list item structure:

    Field Name Type Description
    Id Guid Tree model id.
    CreatedOn DateTime Created on.
    CreatedBy string Username who created this item.
    LastModifiedOn DateTime Last modified on.
    LastModifiedBy string Username who last modified this item.
    Version int Item version number.
    Name string Category name.
    Macro string Macro command.
    AvailableFor List<Guid> Assingnable item types ids for category (for example: Widgets, Pages, Images ect) types found in table CategorizableItems.

    Put new category tree

    HTTP POST: /bcms-api/categorytrees/

    C#: api.Root.Categories.Post()

    Allows to create new category tree, takes one requred parameter, parameter type is PostCategoryTreeRequest.

    Returns object type of PostCategoryTreeResponse with property Data type of Guid?.

    PostCategoryTreeRequest object structure:

    Field Name Type Description
    Data SaveCategoryTreeModel Save category tree model to save category tree.
    User ApiIdentity Identity, user who created category tree.

    SaveCategoryTreeModel object structure:

    Field Name Type Description
    Name string Category tree name.
    Nodes List<SaveCategoryTreeNodeModel> If you want to create category tree with categories provide list of categories nodes.
    UseForCategorizableItems List<Guid> List of categorizable items, it describes for what type of items categories will be used (for example: images, widgets, files ect).

    SaveCategoryTreeNodeModel object structure:

    Field Name Type Description
    Id Guid? Category tree node id.
    Name string Category tree node name.
    DisplayOrder int In lists items are ordered by this property in ascending order.
    Macro string Category tree node macro.
    Nodes List<SaveCategoryTreeNodeModel> List of categorizable items, it describes for what type of items categories will be used (for example: images, widgets, files ect).
    Version int Version of record (needed for updating and removing, do not change it, it is changed and updated automaticly).

    Get a category tree

    HTTP GET: /bcms-api/categorytrees/CATEGORY_TREE_ID

    C#: api.Root.Category.Get()

    Takes one parameter type of GetCategoryTreeRequest:

    Returns object GetCategoryTreeResponse with property Data (type of CategoryTreesModel) and Nodes (type of List<CategoryNodeModel>) containing list of and total count available categories trees.

    GetCategoryTreeRequest structure:

    Field Name Type Description
    CategoryTreeId* Guid Category tree id.
    Data GetCategoryTreeModel Aditional get options.

    *Field is required.

    GetCategoryTreeModel structure:

    Field Name Type Description
    IncludeNodes bool Default false.

    CategoryNodeModel structure:

    Field Name Type Description
    Id Guid Category node id.
    Name string Category node name.
    ParentId Guid? Nullable value, parent id.
    CategoryTreeId Guid Category tree id.
    Macro string Category node macro.
    DisplayOrder int In lists items are ordered by this property in ascending order.
    CreatedBy string Username by who it was created.
    CreatedOn DateTime Date and time when this record was created.
    LastModifiedBy string Username by who it was modified last.
    LastModifiedOn DateTime Date and time when this record was last modified.
    Version int Version of record (needed for updating and removing, do not change it, it is changed and updated automaticly).

    Delete category

    HTTP DELETE: /bcms-api/categorytrees/CATEGORY_TREE_ID

    C#: api.Root.Category.Delete()

    Takes one parameter type of DeleteCategoryTreeRequest (note: this method deletes only one record you should take care of it's children).

    Returns object DeleteCategoryTreeResponse with property Data type of bool, value is true if record deleted.

    DeleteCategoryTreeRequest structure:

    Field Name Type Description
    Data RequestDeleteModel Aditional version information for removing record.
    Id Guid Category tree id.
    User ApiIdentity Used to set who deleted, changed record.

    RequestDeleteModel structure:

    Field Name Type Description
    Version int Version of record (needed for updating and removing, do not change it manualy, it is changed and updated automaticly).

    Put category tree

    HTTP PUT: /bcms-api/categorytrees/CATEGORY_TREE_ID

    C#: api.Root.Category.Put()

    Takes one parameter type of PutCategoryTreeRequest.

    Returns PutCategoryTreeResponse with property Data type of Guid?, on success it will be id of new created/updated category tree.

    PutCategoryTreeRequest structure:

    Field Name Type Description
    Data SaveCategoryTreeModel Save category tree model to save category tree (Note: CategoryTreeId is requred).
    Id Guid? Category tree id for update scenario.
    User ApiIdentity Used to set who created, updated record.

    Get categorizable items

    HTTP GET: /bcms-api/categorizable-items

    C#: api.Root.Category.CategorizableItems.Get()

    Takes one parameter type of GetCategorizableItemsRequest with property Data use default list filtering.

    Returns GetCategorizableItemsResponse with property Data, type of DataListResponse.

    PutCategoryTreeRequest structure:

    Field Name Type Description
    Data SaveCategoryTreeModel Save category tree model to save category tree.
    Id Guid? Category tree id.
    User ApiIdentity Used to set who created, updated record.

    DataListResponse structure:

    Field Name Type Description
    Items List<CategorizableItemModel> A list of CategorizableItemModel objects.
    TotalCount int Total count of categorizable items.

    CategorizableItemModel structure:

    Field Name Type Description
    Id Guid Categorizable item id.
    Name string Categorizable item name.
    CreatedBy string Username by who it was created.
    CreatedOn DateTime Date and time when this record was created.
    LastModifiedBy string Username by who it was modified last.
    LastModifiedOn DateTime Date and time when this record was last modified.
    Version int Version of record (needed for updating and removing, do not change it, it is changed and updated automaticly).

    Get category node

    HTTP GET: /bcms-api/categorytrees/CATEGORY_TREE_ID/nodes/CATEGORY_NODE_ID

    C#: api.Root.Category.Node.Get()

    Takes one parameter type of GetNodeRequest.

    Returns GetNodeResponse with property Data, type of NodeModel.

    GetNodeRequest structure:

    Field Name Type Description
    CategoryTreeId* Guid Category tree id.
    NodeId* Guid Node id.

    *Field is required.

    NodeModel structure:

    Field Name Type Description
    Id Guid Categorizable item id.
    Name string Categorizable item name.
    ParentId Guid? Parent id.
    DisplayOrder int In lists items are ordered by this property in ascending order.
    Macro string Node macro command.
    CategoryTreeId Guid Category id.
    CreatedBy string Username by who it was created.
    CreatedOn DateTime Date and time when this record was created.
    LastModifiedBy string Username by who it was modified last.
    LastModifiedOn DateTime Date and time when this record was last modified.
    Version int Version of record (needed for updating and removing, do not change it, it is changed and updated automaticly).

    Delete category node

    HTTP DELETE: /bcms-api/categorytrees/CATEGORY_TREE_ID/nodes/CATEGORY_NODE_ID

    C#: api.Root.Category.Node.Delete()

    Takes one parameter type of DeleteNodeRequest.

    Returns DeleteNodeResponse with property Data, type of bool, on success value will be true.

    DeleteNodeRequest structure:

    Field Name Type Description
    CategoryTreeId* Guid Category tree id.
    Id* Guid Node id.

    *Field is required.

    Put create/update category node

    HTTP PUT: /bcms-api/categorytrees/CATEGORY_TREE_ID/nodes/CATEGORY_NODE_ID

    C#: api.Root.Category.Node.Put()

    Takes one parameter type of PutNodeRequest.

    Returns PutNodeResponse with property Data, type of Guid?, on success value will be node id.

    PutNodeRequest structure:

    Field Name Type Description
    CategoryTreeId* Guid Category id to who node will be added.
    Id Guid? If it will gona have value, API will try to update entity else create new.
    Data SaveNodeModel Category node data.
    User ApiIdentity User who created this record.

    SaveNodeModel structure:

    Field Name Type Description
    Name string Node name.
    ParentId Guid? Parent category node id.
    DisplayOrder int In lists items are ordered by this property in ascending order.
    Macro string Node macro command.
    Version int Version of record (needed for updating and removing, do not change it, it is changed and updated automaticly).

    Get category nodes

    HTTP GET: /bcms-api/categorytrees/CATEGORY_TREE_ID/nodes/CATEGORY_NODE_ID
    or
    HTTP GET: /bcms-api/categorytrees/nodes/

    C#: api.Root.Category.Nodes.Get()

    Takes one parameter type of GetCategoryNodesRequest.

    Returns GetCategoryNodesResponse with property Data, containing properties TotalCount type of int and Items type of List<CategoryNodeModel>.

    GetCategoryNodesRequest structure:

    Field Name Type Description
    CategoryTreeId* Guid Category tree id.
    Data DataOptions Use default list filtering.

    *Field is required.

    Post new category node

    HTTP POST: /bcms-api/categorytrees/CATEGORY_TREE_ID/nodes

    C#: api.Root.Category.Nodes.Post()

    Takes one parameter type of PostCategoryNodeRequest.

    Returns PostCategoryNodeResponse with property Data, type of Guid?, who is id of new category node.

    PostCategoryNodeRequest structure:

    Field Name Type Description
    CategoryTreeId* Guid Category tree id.
    Data SaveNodeModel Data of new node.
    User ApiIdentity By who this entity was modified.

    *Field is required.

    Get category tree nodes

    HTTP GET: /bcms-api/categorytrees/CATEGORY_TREE_ID/nodes

    C#: api.Root.Category.Tree.Get()

    Takes one parameter type of GetNodesTreeRequest.

    Returns object type of GetNodesTreeResponse with property Data, type of List<NodesTreeNodeModel>.

    GetNodesTreeRequest structure:

    Field Name Type Description
    CategoryTreeId Guid Category tree id.
    Data SaveNodeModel Data of new node.

    NodesTreeNodeModel structure:

    Field Name Type Description
    Id Guid Node id.
    Name string Node name.
    ParentId Guid? Parent id.
    DisplayOrder int In lists items are ordered by this property in ascending order.
    Macro string Node macro command.
    ChildrenNodes List<NodesTreeNodeModel> Children nodes.
    CreatedBy string Username by who it was created.
    CreatedOn DateTime Date and time when this record was created.
    LastModifiedBy string Username by who it was modified last.
    LastModifiedOn DateTime Date and time when this record was last modified.
    Version int Version of record (needed for updating and removing, do not change it, it is changed and updated automaticly).

    Tags

    Get a list of tags

    HTTP GET: /bcms-api/tags/

    C#: api.Root.Tags.Get()

    Returns the list and total count of all available tags.

    Use default list filtering, sorting and paging options.

    A success response.data object format:

    Field Name Type Description
    items List<Tag> A list of Tag objects.
    totalCount int Total count of found tags.

    Tag object format:

    Field Name Type Description
    id* Guid A tag id.
    name* string(200) Tag name.
    createdOn* DateTime The date of tag creation.
    createdBy* string(200) User name of tag creator.
    lastModifiedOn* DateTime The date of tag last modification.
    lastModifiedBy* string(200) User name of tag last modificator.
    version* int A record version number.

    Get a tag by ID or name

    HTTP GET: /bcms-api/tags/{id} - get tag by ID.

    HTTP GET: /bcms-api/tags/by-name/{name}/ - get tag by name

    C#: api.Root.Tag.Get()

    Returns tag object, identified by ID or name.

    Successful response.data object format:

    Field Name Type Description
    id* Guid The tag id.
    name* string(200) The tag name.
    createdOn* DateTime The date of tag creation.
    createdBy* string(200) User name of tag creator.
    lastModifiedOn* DateTime The date of tag last modification.
    lastModifiedBy* string(200) User name of tag last modificator.
    version* int A record version number.

    For code API, use these request properties:

    Field Name Type Description
    TagId Guid Tag id. Cannot be specified, if TagName is specified.
    TagName string Tag name. Cannot be specified, if TagId is specified.

    Languages

    Get a list of languages

    HTTP GET: /bcms-api/languages/

    C#: api.Root.Languages.Get()

    Returns the list and total count of all available languages.

    Use default list filtering, sorting and paging options.

    A success response.data object format:

    Field Name Type Description
    items List<Language> A list of Language objects.
    totalCount int Total count of found languages.

    Language object format:

    Field Name Type Description
    id* Guid A language id.
    name* string(200) Language name.
    code* string(200) Language code (.NET CultureInfo Name).
    createdOn* DateTime The date of language creation.
    createdBy* string(200) User name of language creator.
    lastModifiedOn* DateTime The date of language last modification.
    lastModifiedBy* string(200) User name of language last modificator.
    version* int A record version number.

    Get a language by ID or code

    HTTP GET: /bcms-api/languages/{id} - get language by ID.

    HTTP GET: /bcms-api/languages/by-code/{name}/ - get language by code

    C#: api.Root.Language.Get()

    Returns language object, identified by ID or code.

    Successful response.data object format:

    Field Name Type Description
    id* Guid The language id.
    name* string(200) The language name.
    code* string(200) The language code (.NET CultureInfo Name).
    createdOn* DateTime The date of language creation.
    createdBy* string(200) User name of language creator.
    lastModifiedOn* DateTime The date of language last modification.
    lastModifiedBy* string(200) User name of language last modificator.
    version* int A record version number.

    For code API, use the following request properties:

    Field Name Type Description
    LanguageId Guid Language id. Cannot be specified, if LanguageCode is specified.
    LanguageCode string(200) Language code (.NET CultureInfo Name). Cannot be specified, if LanguageId is specified.

    Pages

    Pages

    Get a list of pages

    HTTP GET: /bcms-api/pages/

    C#: api.Pages.Pages.Get()

    Returns a list and total count of all available pages.

    Use default request for getting a list with extender properties.

    Field Name Type Description
    user UserIdentity User identity object (optional).
    Used for filtering secured pages by access rules.
    Empty user is passed by default (filtering by user is disabled).
    includeArchived bool Indicates if archived pages should be returned.
    Default = false.
    includeUnpublished bool Indicates if unpublished pages should be returned.
    Default = false.
    includePageOptions bool Indicates if page options lists should be returned with each page model.
    Default = false.
    includeTags bool Indicates if tags list should be returned within each page model.
    Default = false.
    includeAccessRules bool Indicates if the list of access rules objects should be retrieved.
    Default = false.
    includeMasterPages bool Indicates if master pages should be returned.
    Default = false.
    filterByTags List<string> List of tags, filtered using tags connector (by default, connector value = 'and').
    filterByTagsConnector string Tags filtering connector. Possible values:
    • and (default). Blog post should contain all the tags, specified in filterByTags.
    • or. Blog post should contain any of tags, specified in filterByTags.
    includeCategories bool Indicates if the list of categories should be retrieved.
    Default value =false.
    filterByCategories List<Guid> List of category ids, filtered using categories connector (by default, connector value = 'and').
    filterByCategoriesNames List<string> List of category names, filtered using categories connector (by default, connector value = 'and').
    filterByCategoriesConnector string Categories filtering connector. Possible values:
    • and (default). Pages should contain all the categories, specified in filterByCategories and filterByCategoriesNames.
    • or. Pages should contain any of categories, specified in filterByCategories and filterByCategoriesNames.

    A success response.data object format:

    Field Name Type Description
    items List<Page> A list of Page objects.
    totalCount int Total count of found pages.

    Page object format:

    Field Name Type Description
    id* Guid A page id.
    pageUrl* string(850) A page URL.
    title* string(200) The page title.
    description string Page description.
    isPublished* bool The page status.
    publishedOn datetime The page published date.
    layoutId Guid The page layout ID (is set only if masterPageId is not set).
    masterPageId Guid The master page ID (is set only if layoutId is not set).
    categoryId Guid The page category id.
    categoryName string(200) The page category name.
    mainImageId Guid Main image id.
    mainImageUrl string(850) Main image URL.
    mainImageThumbnauilUrl string(850) Main image thumbnail URL. Obsolete. Use mainImageThumbnailUrl instead
    mainImageThumbnailUrl string(850) Main image thumbnail URL.
    mainImageCaption string(2000) Main image caption.
    featuredImageId Guid Featured image id.
    featuredImageUrl string(850) Featured image URL.
    featuredImageThumbnailUrl string(850) Featured image thumbnail URL.
    featuredImageCaption string(2000) Featured image caption.
    secondaryImageId Guid Secondary image id.
    secondaryImageUrl string(850) Secondary image URL.
    secondaryImageThumbnailUrl string(850) Secondary image thumbnail URL.
    secondaryImageCaption string(2000) Secondary image caption.
    isArchived* bool Indicates if page is marked as archived.
    isMasterPage* bool Indicates if page is a master page.
    languageId Guid Page language id.
    languageCode string(200) Page language code (.NET CultureInfo Name).
    languageGroupIdentifier Guid Language group identifier (all current page translations are grouped by this identifier).
    options List<Option> List of option models.
    Is retrieved only if request.includePageOptions is set to true.
    tags List<string> List of tags.
    Is retrieved only if request.includeTags is set to true.
    accessRules List<AccessRule> Access rules objects list.
    Is retrieved only if request.includeAccessRules is set to true.
    createdOn* DateTime The date of page creation.
    createdBy* string(200) The user created page.
    lastModifiedOn* DateTime The last modification date.
    lastModifiedBy* string(200) The last modification user.
    version* int A record version number.

    Option object format:

    Field Name Type Description
    key* string(200) Option key.
    value string Option value.
    defaultValue string Default option value.
    type* string Page content option type:
    • Text
    • Integer
    • Float
    • Boolean
    • DateTime

    AccessRule object format:

    Field Name Type Description
    identity string(200) Role name or user name.
    accessLevel string
    • Deny
    • Read
    • ReadWrite
    isForRole bool Determines, if identity is role name (true) or user name (false).

    Get a page by Id or by URL

    HTTP GET: /bcms-api/pages/{id}/ - gets a page by id

    HTTP GET: /bcms-api/pages/by-url/{url}/ - gets a page by url

    C#: api.Pages.Page.Get()

    Gets page object by specified ID or by URL.

    For code API, use these request properties:

    Field Name Type Description
    PageUrl* string(850) A page url. Cannot be specified, if request.pageId is specified.
    PageId* Guid A page id. Cannot be specified, if request.pageUrl is specified.

    A success response.data object format:

    Field Name Type Description
    id* Guid A page id.
    pageUrl* string(850) A page URL.
    title* string(200) The page title.
    description string Page description.
    isPublished* bool The page status.
    publishedOn datetime The page published date.
    layoutId Guid The page layout ID (is set only if masterPageId is not set).
    masterPageId Guid The master page ID (is set only if layoutId is not set).
    categoryId Guid The page category ID.
    categoryName string(200) The page category name.
    isArchived* bool Indicates if page is marked as archived.
    isMasterPage* bool Indicates if page is a master page.
    mainImageId Guid Main image ID.
    mainImageUrl string(850) Main image URL.
    mainImageThumbnauilUrl string(850) Main image thumbnail URL.
    mainImageCaption string(2000) Main image caption.
    languageId Guid Page language id.
    languageCode string(200) Page language code (.NET CultureInfo Name).
    languageGroupIdentifier Guid Language group identifier (all current page translations are grouped by this identifier).
    createdOn* DateTime The date of page creation.
    createdBy* string(200) The user-created page.
    lastModifiedOn* DateTime The last modification date.
    lastModifiedBy* string(200) The last modification user.
    version* int A record version number.

    Get page properties by ID or by URL

    HTTP GET: /bcms-api/page-properties/{id} - gets page properties by ID

    HTTP GET: /bcms-api/page-properties/by-url/{pageUrl} - gets page properties by page URL

    C#: api.Pages.Page.Properties.Get()

    Gets page properties by specified ID.

    The request properties for filtering and returning results:

    Field Name Type Description
    includeTags bool Indicates if a response.tags object should be retrieved. The default value is false.
    includeCategory bool Indicates if a response.category object should be retrieved.
    The default value is false.
    includeLayout bool Indicates if a response.layout object should be retrieved. The default value is false.
    includeImages bool Indicates if image objects should be returned.
    The default value is false.
    includeMetadata bool Indicates if a metadata object should be retrieved.
    The default value is false.
    includeAccessRules bool Indicates if the list of access rules objects should be retrieved.
    The default value is false.
    includePageContents bool Indicates if a list of page content objects should be retrieved.
    The default value is false.
    includePageOptions bool Indicates if list of page option objects should be retrieved.
    Default value is false.
    includeLanguage bool Indicates if page language object should be retrieved.
    The default value is false.
    includePageTranslations bool Indicates if a list of page translation objects should be retrieved.
    The default value is false.

    For code API, use these additional request properties:

    Field Name Type Description
    PageUrl* string(850) A page url. Cannot be specified, if request.pageId is specified.
    PageId* Guid A page id. Cannot be specified, if request.pageUrl is specified.

    A response.data object format:

    Field Name Type Description
    id* Guid A page id.
    pageUrl* string(850) A page URL.
    title* string(200) The page title.
    description string(2000) The page description.
    isPublished* bool The page status.
    publishedOn datetime The page published date.
    layoutId Guid The page layout ID (is set only if masterPageId is not set).
    masterPageId Guid The master page ID (is set only if layoutId is not set).
    categoryId Guid The page category ID.
    isArchived* bool Indicates if the page is marked as archived.
    isMasterPage* bool Indicates if the page is a master page.
    mainImageId Guid Main image ID.
    featuredImageId Guid Featured image ID.
    secondaryImageId Guid Secondary image ID.
    customCss string(max) Page custom CSS.
    customJavaScript string(max) Page custom JavaScript.
    useCanonicalUrl bool Flag, indicating whether a canonical URL should be used.
    useNoFollow bool Flag, indicating whether a noFollow meta tag should be used.
    useNoIndex bool Flag, indicating whether a noIndex meta tag should be used.
    languageId Guid Page language ID.
    languageGroupIdentifier Guid Language group identifier (all current page translations are grouped by this identifier).
    createdOn* DateTime The date of page creation.
    createdBy* string(200) The user-created page.
    lastModifiedOn* DateTime The last modification date.
    lastModifiedBy* string(200) The last modification user.
    version* int A record version number.

    Additionally a response returns children and referenced objects, if any of the request's include flags were selected. Additional response properties:

    Field Name Type Description
    Layout Layout Layout object.
    Only if request.includeLayout = true
    category Category Category object.
    Only if request.includeCategory = true
    tags List<Tag> List of Tag objects.
    Only if request.includeTags = true
    mainImage Image Main image object.
    Only if request.includeImages = true.
    featuredImage Image Featured image object.
    Only if request.includeImages = true.
    secondaryImage Image Secondary image object.
    Only if request.includeImages = true.
    metaData MetaData Metadata object.
    Only if request.includeMetaData = true.
    accessRules List<AccessRule> Access rules objects list.
    Only if request.includeAccessRules = true.
    pageContents List<PageContent> List of page content objects.
    Only if request.includePageContents = true
    pageOptions List<PageOption> List of page options objects.
    Only if request.includePageOptions = true
    language Language Language object.
    Only if request.includeLanguage = true
    pageTranslations List<PageTranslation> List of page translation objects.
    Only if request.includePageTranslations = true

    Layout object format:

    Field Name Type Description
    id* Guid Layout id.
    name* string(200) Layout name.
    layoutPath* string(850) Layout path (server URL).
    previewUrl string(850) Layout image preview URL.
    createdOn* DateTime The date of layout creation.
    createdBy* string(200) User name of layout creator.
    lastModifiedOn* DateTime The date of layout last modification.
    lastModifiedBy* string(200) User name of layout last modificator.
    version* int A record version number.

    Tag object format:

    Field Name Type Description
    id* Guid A tag id.
    name* string(200) Tag name.
    createdOn* DateTime The date of tag creation.
    createdBy* string(200) User name of tag creator.
    lastModifiedOn* DateTime The date of tag last modification.
    lastModifiedBy* string(200) User name of tag last modificator.
    version* int A record version number.

    Category object format:

    Field Name Type Description
    id* Guid A category id.
    name* string(200) Category name.
    createdOn* DateTime The date of category creation.
    createdBy* string(200) User name of category creator.
    lastModifiedOn* DateTime The date of category last modification.
    lastModifiedBy* string(200) User name of category last modificator.
    version* int A record version number.

    Image object format:

    Field Name Type Description
    id* Guid An image ID.
    title* string(200) Image title.
    caption string(2000) Image caption (tooltip).
    url* string(850) Image URL.
    thumbnailUrl* string(850) Image thumbnail URL.
    createdOn* DateTime The date of image creation.
    createdBy* string(200) User name of image creator.
    lastModifiedOn* DateTime The date of image last modification.
    lastModifiedBy* string(200) User name of image last modificator.
    version* int A record version number.

    Metadata object format:

    Field Name Type Description
    metaTitle string(200) Page meta title.
    metaKeywords string(2000) Page meta keywords.
    metaDescription string(2000) Page meta description.

    AccessRule object format:

    Field Name Type Description
    identity string(200) Role name or user name.
    accessLevel string
    • Deny
    • Read
    • ReadWrite
    isForRole bool Determines if identity is role name (true) or user name (false).

    PageContent object format:

    Field Name Type Description
    id* Guid Page content id.
    contentId* Guid Content ID (widget, html content and etc.).
    parentPageContentId Guid Parent Page Content ID if available.
    contentType* string Available values:
    • html-content
    • html-widget
    • server-widget
    • blog-post-content
    name* string(200) Content name.
    regionId* Guid Region id.
    regionIdentifier* string(200) Region unique identifier.
    order* int The order number of the content in the region.
    isPublished* bool The page content status.
    createdOn* DateTime The date of content creation.
    createdBy* string(200) User name of content creator.
    lastModifiedOn* DateTime The date of content last modification.
    lastModifiedBy* string(200) User name of content last modificator.
    version* int A record version number.

    PageOption object format:

    Field Name Type Description
    key* string(200) Option key.
    value string Option value.
    defaultValue string Default option value.
    type* string Page content option type:
    • Text
    • Integer
    • Float
    • Boolean
    • DateTime

    Language object format:

    Field Name Type Description
    id* Guid Page language id.
    name* string Language name (description).
    code* string Language code (.NET CultureInfo Name).
    createdOn* DateTime The date of language creation.
    createdBy* string(200) User name of language creator.
    lastModifiedOn* DateTime The date of language last modification.
    lastModifiedBy* string(200) User name of language last modificator.
    version* int A record version number.

    PageTranslation object format:

    Field Name Type Description
    id* Guid Page id.
    title* string(200) Page title.
    pageUrl* string(850) Page URL.
    languageId Guid Page language id.
    languageCode string(200) Page language code (.NET CultureInfo Name).

    Check if page exists and get page ID

    HTTP GET: /bcms-api/page-exists/{pageUrl}

    C#: api.Pages.Page.Exists()

    Checks if page exists and returns "Page" object.

    A success response.data object format:

    Field Name Type Description
    exists* bool true if page exists. false otherwise.
    pageId Guid A page ID if page was found.

    For code API, use these request properties:

    Field Name Type Description
    pageUrl* string(850) A page url.

    Searches within pages content

    HTTP GET: /bcms-api/pages/search/{searchString}

    C#: api.Pages.Pages.Search()

    Searches within page content and returns list with page models.

    For code API, use these request properties:

    Field Name Type Description
    SearchString* string(1000) Search string. Depending on search engine, wildcards can be applied.

    A success response.data object format:

    Field Name Type Description
    items List<SearchResultModel> A list of SearchResultModel objects.
    totalCount int A total count of found search results.

    SearchResultModel object format:

    Field Name Type Description
    title* string(200) Page title.
    link* string(850) Page URL.
    formattedUrl* string(850) Formatted page URL.
    snippet* string(300) Page content's snippet (usually containing search keyword).
    isDenied* boolean Returns false, if access is denied for current user.

    Translations

    Get page translations by page id or page url

    HTTP GET: /bcms-api/pages/{pageId}/translations/ - gets a page translations by page id

    HTTP GET: /bcms-api/pages/translations/by-url/{pageUrl}/ - gets a page translations by page url

    C#: api.Pages.Translations.Get()

    Gets page translations list by page id or page url

    For code API, use these request properties:

    Field Name Type Description
    PageUrl* string(850) A page url. Cannot be specified, if request.pageId is specified.
    PageId* Guid A page id. Cannot be specified, if request.pageUrl is specified.

    A success response.data object format:

    Field Name Type Description
    id* Guid Page id.
    title* string(200) Page title.
    pageUrl* string(850) Page URL.
    languageId Guid Page language id.
    languageCode string(200) Page language code (.NET CultureInfo Name).
    isPublished* bool Determines, if page is published
    publishedOn DateTime The date of page publishing (if page was published)

    Contents

    Get page contents by page id

    HTTP GET: /bcms-api/pages/{pageId}/contents/

    C#: api.Pages.Page.Contents.Get()

    Returns the list and total count of all specified page contents.

    Use default list request for getting a page contents list with ability to filter by region and other filter options:

    Field Name Type Description
    regionId Guid Region id (optional). Cannot be set if request.regionIdentifier is set.
    regionIdentifier string Region identifier (optional). Cannot be set if request.regionId is set.
    includeUnpublished bool Indicates, whether unpublished contents should be retrieved.
    Default value is false.

    For code API use these additional request parameters:

    Field Name Type Description
    PageId* Guid Page id.

    A success response.data object format:

    Field Name Type Description
    items List<PageContent> A list of PageContent objects.
    totalCount int Total count of found page contents.

    PageContent object format:

    Field Name Type Description
    id* Guid Page content ID.
    contentId* Guid Content ID (widget, html content and etc.).
    parentPageContentId Guid Parent Page Content ID if available.
    contentType* string This field is a dynamically calculated field. You can not sort or add filter by this field. Available values:
    • html-content
    • html-widget
    • server-widget
    • blog-post-content
    name* string(200) Content name.
    regionId* Guid Region id.
    regionIdentifier* string(200) Region unique identifier.
    order* int The order number of the content in the region.
    createdOn* DateTime The date of content creation.
    createdBy* string(200) User name of content creator.
    lastModifiedOn* DateTime The date of content last modification.
    lastModifiedBy* string(200) User name of content last modificator.
    version* int A record version number.

    Get a HTML content by id

    HTTP GET: /bcms-api/contents/html/{id}

    C#: api.Pages.Content.Html.Get()

    Gets HTML content object by specified content id.

    A success response.data object format:

    Field Name Type Description
    id* Guid Content id.
    name* string(200) Content name.
    activationDate* DateTime Content activation date.
    expirationDate DateTime Content expiration date. If null - content will never expire.
    html string(max) Content HTML.
    originalText string(max) The original text of content. If HTML property is null, Markdown and Simple Text is generated from this property.
    customCss string(max) Custom content CSS.
    useCustomCss* bool Indicates, if custom CSS must be used when rendering a content.
    customJavaScript string(max) Custom content JavaScript.
    useCustomCss* bool Indicates, if custom JavaScript must be used when rendering a content.
    isPublished* bool Indicates, if content is published (or has draft status).
    publishedOn DateTime Content publish date.
    publishedByUser string(200) User name of content publisher.
    contentTextMode string The type of the content's text. Available values:
    • Html
    • Markdown
    • SimpleText
    createdOn* DateTime The date of content creation.
    createdBy* string(200) User name of content creator.
    lastModifiedOn* DateTime The date of content last modification.
    lastModifiedBy* string(200) User name of content last modificator.
    version* int A record version number.

    For code API use these request parameters:

    Field Name Type Description
    ContentId* Guid Html content id.

    Get a list of historical contents by content id

    HTTP GET: /bcms-api/contents/{contentId}/history/

    C#: api.Pages.Content.History.Get()

    Returns the list of content historical contents.

    For code API use these request parameters:

    Field Name Type Description
    ContentId* Guid Content id.

    Response.data returns the list of ContentHistory objects. ContentHistory object format:

    Field Name Type Description
    id* Guid Historical record content id.
    contentType* string Available values:
    • html-content
    • html-widget
    • server-widget
    • blog-post-content
    originalContentId* Guid Original content id.
    publishedOn DateTime The date when content was published.
    publishedByUser string(200) Content publisher user name.
    archivedOn DateTime The date when content was archived.
    archivedByUser string(200) The name of user who archived the content.
    status* short Content history item status. Available values:
    • 2 - Draft
    • 3 - Published
    • 4 - Archived
    createdOn* DateTime The date of content history creation.
    createdBy* string(200) User name of content history creator.
    lastModifiedOn* DateTime The date of content history last modification.
    lastModifiedBy* string(200) User name of content history last modificator.
    version* int A record version number.

    Get page content options by page content id

    HTTP GET: /bcms-api/pages/contents/{PageContentId}/options

    C#: api.Page.Content.Options.Get()

    Returns the list and total count of page content option objects, identified by page content id.

    Use default request for getting a list.

    For code API use these request parameters:

    Field Name Type Description
    PageContentId* Guid Page content id.

    A success response.data object format:

    Field Name Type Description
    items List<Option> A list of Option objects.
    totalCount int Total count of found page content options.

    Options object format:

    Field Name Type Description
    key* string(200) Option key.
    defaultValue string Default option value.
    type* string Page content option type:
    • Text
    • Integer
    • Float
    • Boolean
    • DateTime
    • MultilineText
    • JavaScriptUrl
    • CssUrl
    • Custom
    customTypeIdentifier string(200) Custom type identifier.
    Translations List<OptionTranslation> List of option translation objects.

    OptionsTranslation object format:

    Field Name Type Description
    languageId* string(200) Language Id.
    value string Option translation value.

    Widgets

    Get a list of widgets

    HTTP GET: /bcms-api/widgets/

    C#: api.Pages.Widgets.Get()

    Returns the list and total count of all available widgets (html content widgets and server control widgets).

    Use default request for getting a list.

    A success response.data object format:

    Field Name Type Description
    items List<Widget> A list of Widget objects.
    totalCount int Total count of found widgets.

    Widget object format:

    Field Name Type Description
    id* Guid A widget id.
    widgetType* string This field is a dynamically-calculated field. You can not sort or add a filter by this field. Available values:
    • html-widget
    • server-widget
    name* string(200) Widget name.
    isPublished* bool Indicates if widget is published (or has draft status).
    publishedOn DateTime Widget publish date.
    publishedByUser string(200) User name of widget published.
    categoryId Guid Category ID.
    categoryName string(200) Category name.
    createdOn* DateTime The date of widget creation.
    createdBy* string(200) User name of widget creator.
    lastModifiedOn* DateTime The date of widget last modification.
    lastModifiedBy* string(200) User name of widget last modificator.
    version* int A record version number.

    Get a HTML content widget by ID

    HTTP GET: /bcms-api/widgets/html-content/{id}

    C#: api.Pages.Widget.HtmlContent.Get()

    Returns HTML content widget object, identified by ID.

    Additional filtering parameters could be passed:

    Field Name Type Description
    IncludeOptions bool Indicates, if widget options should be retrieved.
    Default value = false.
    IncludeChildContentOptions bool Indicates, if widget child content options should be retrieved.
    Default value = false.
    IncludeCategories bool Indicates, if widget categories should be retrieved.
    Default value = false.

    For code API use these request parameters:

    Field Name Type Description
    WidgetId* Guid Widget ID.

    A success response.data object format:

    Field Name Type Description
    id* Guid A widget ID.
    name* string(200) Widget name.
    isPublished* bool Indicates, if widget is published (or has draft status).
    publishedOn DateTime Widget publish date.
    publishedByUser string(200) User name of widget published.
    categoryId Guid Category ID.
    categoryName string(200) Category name.
    customCss string(max) Widget custom CSS.
    useCustomCss* bool Indicates if custom CSS should be rendered.
    html string(max) Widget HTML.
    useHtml* bool Indicates if HTML should be rendered.
    customJavaScript string(max) Widget custom JavaScript.
    useCustomJavaScript* bool Indicates if custom JavaScript should be rendered.
    createdOn* DateTime The date of widget creation.
    createdBy* string(200) User name of widget creator.
    lastModifiedOn* DateTime The date of widget last modification.
    lastModifiedBy* string(200) User name of widget last modificator.
    version* int A record version number.

    Additional response fields (if any of requests flags were selected):

    Field Name Type Description
    Options List<Options> Widget options.
    ChildContentOptionValues List<MultilingualChildContentOptionValues> Widget child content option values.
    Categories List<Category> Widget categories.

    Category object format:

    Field Name Type Description
    id* Guid A category id.
    name* string(200) Category name.
    createdOn* DateTime The date of category creation.
    createdBy* string(200) User name of category creator.
    lastModifiedOn* DateTime The date of category last modification.
    lastModifiedBy* string(200) User name of category last modificator.
    version* int A record version number.

    Options object format:

    Field Name Type Description
    key* string(200) Option key.
    defaultValue string Default option value.
    type* string Widget option type:
    • Text
    • Integer
    • Float
    • Boolean
    • DateTime
    • MultilineText
    • JavaScriptUrl
    • CssUrl
    • Custom
    customTypeIdentifier string(200) Custom type identifier.
    Translations List<OptionTranslation> List of option translation objects.

    MultilingualChildContentOptionValues object format:

    Field Name Type Description
    multilingualOptionValues List<MultilingualOptionValue> Language Id.
    optionValues List<OptionValue> Obsolete. Option values.

    MultilingualOptionValue object format:

    Field Name Type Description
    key* string(200) Option key.
    defaultValue string Default option value.
    type* string Widget option type:
    • Text
    • Integer
    • Float
    • Boolean
    • DateTime
    • MultilineText
    • JavaScriptUrl
    • CssUrl
    • Custom
    customTypeIdentifier string(200) Custom type identifier.
    Translations List<OptionTranslation> List of option translation objects.

    OptionsTranslation object format:

    Field Name Type Description
    languageId* string(200) Language Id.
    value string Option translation value.

    Get HTML content widget options by widget ID

    HTTP GET: /bcms-api/widgets/html-content/{WidgetId}/options

    C#: api.Pages.Widget.HtmlContent.Options.Get()

    Returns the list and total count of HTML content widget option objects, identified by widget ID.

    Use default request for getting a list.

    For code API use these request parameters:

    Field Name Type Description
    WidgetId* Guid Widget ID.

    A success response.data object format:

    Field Name Type Description
    items List<Option> A list of Option objects.
    totalCount int Total count of found widget options.

    Options object format:

    Field Name Type Description
    key* string(200) Option key.
    defaultValue string Default option value.
    type* string Widget option type:
    • Text
    • Integer
    • Float
    • Boolean
    • DateTime
    • MultilineText
    • JavaScriptUrl
    • CssUrl
    • Custom
    customTypeIdentifier string(200) Custom type identifier.
    Translations List<OptionTranslation> List of option translation objects.

    OptionsTranslation object format:

    Field Name Type Description
    languageId* string(200) Language Id.
    value string Option translation value.

    Get a server control widget by Id

    HTTP GET: /bcms-api/widgets/server-control/{id}

    C#: api.Pages.Widget.ServerControl.Get()

    Returns server widget object, identified by id.

    Additional filtering parameters could be passed:

    Field Name Type Description
    IncludeOptions bool Indicates, if widget options should be retrieved.
    Default value = false.
    IncludeCategories bool Indicates, if widget categories should be retrieved.
    Default value = false.

    For code API use these request parameters:

    Field Name Type Description
    WidgetId* Guid Widget id.

    A success response.data object format:

    Field Name Type Description
    id* Guid A widget id.
    name* string(200) Widget name.
    isPublished* bool Indicates, if widget is published (or has draft status).
    publishedOn DateTime Widget publish date.
    publishedByUser string(200) User name of widget publisher.
    categoryId Guid Category id.
    categoryName string(200) Category name.
    widgetUrl* string(850) Widget file URL (path in the server).
    previewUrl string(850) Widget preview image URL.
    createdOn* DateTime The date of widget creation.
    createdBy* string(200) User name of widget creator.
    lastModifiedOn* DateTime The date of widget last modification.
    lastModifiedBy* string(200) User name of widget last modificator.
    version* int A record version number.

    Additional response fields (if any of requests flags were selected):

    Field Name Type Description
    Options List<Options> Widget options.
    Categories List<Category> Widget categories.

    Category object format:

    Field Name Type Description
    id* Guid A category id.
    name* string(200) Category name.
    createdOn* DateTime The date of category creation.
    createdBy* string(200) User name of category creator.
    lastModifiedOn* DateTime The date of category last modification.
    lastModifiedBy* string(200) User name of category last modificator.
    version* int A record version number.

    Options object format:

    Field Name Type Description
    key* string(200) Option key.
    defaultValue string Default option value.
    type* string Widget option type:
    • Text
    • Integer
    • Float
    • Boolean
    • DateTime
    • MultilineText
    • JavaScriptUrl
    • CssUrl
    • Custom
    customTypeIdentifier string(200) Custom type identifier.
    Translations List<OptionTranslation> List of option translation objects.

    OptionsTranslation object format:

    Field Name Type Description
    languageId* string(200) Language Id.
    value string Option translation value.

    Get a server control widget options by widget Id

    HTTP GET: /bcms-api/widgets/server-control/{WidgetId}/options

    C#: api.Pages.Widget.ServerControl.Options.Get()

    Returns the list and total count of server widget option objects, identified by widget id.

    Use default request for getting a list.

    For code API use these request parameters:

    Field Name Type Description
    WidgetId* Guid Widget id.

    A success response.data object format:

    Field Name Type Description
    items List<Option> A list of Option objects.
    totalCount int Total count of found widget options.

    Option object format:

    Field Name Type Description
    key* string(200) Option key.
    defaultValue string Default option value.
    type* string Widget option type:
    • Text
    • Integer
    • Float
    • Boolean
    • DateTime
    • MultilineText
    • JavaScriptUrl
    • CssUrl
    • Custom
    customTypeIdentifier string(200) Custom type identifier.
    Translations List<OptionTranslation> List of option translation objects.

    OptionsTranslation object format:

    Field Name Type Description
    languageId* string(200) Language Id.
    value string Option translation value.

    Redirects

    Get a list of redirects

    HTTP GET: /bcms-api/redirects/

    C#: api.Pages.Redirects.Get()

    Returns the list and total count of all available redirects.

    Use default request for getting a list.

    A success response.data object format:

    Field Name Type Description
    items List<Redirect> A list of Redirect objects.
    totalCount int Total count of found redirects.

    Redirect object format:

    Field Name Type Description
    id* Guid A redirect id.
    pageUrl* string(850) Page URL.
    redirectUrl* string(850) Redirect URL.
    createdOn* DateTime The date of redirect creation.
    createdBy* string(200) User name of redirect creator.
    lastModifiedOn* DateTime The date of redirect last modification.
    lastModifiedBy* string(200) User name of redirect last modificator.
    version* int A record version number.

    Get a redirect by id

    HTTP GET: /bcms-api/redirects/{id}

    C#: api.Pages.Redirect.Get()

    Returns redirect object, identified by id.

    For code API use these request parameters:

    Field Name Type Description
    RedirectId* Guid Redirect id.

    A success response.data object format:

    Field Name Type Description
    id* Guid A redirect id.
    pageUrl* string(850) Page URL.
    redirectUrl* string(850) Redirect URL.
    createdOn* DateTime The date of redirect creation.
    createdBy* string(200) User name of redirect creator.
    lastModifiedOn* DateTime The date of redirect last modification.
    lastModifiedBy* string(200) User name of redirect last modificator.
    version* int A record version number.

    Sitemap

    Get a list of sitemaps

    HTTP GET: /bcms-api/sitemap-trees/

    C#: api.Pages.Sitemap.Get()

    Returns the list and total count of all available sitemaps.

    Use default request for getting a list with extender properties:

    Field Name Type Description
    filterByTags List<string> List of tags, filtered using tags connector (by default, connector value = 'and').
    filterByTagsConnector string Tags filtering connector. Possible values:
    • and (default). Sitemap should contain all the tags, specified in filterByTags.
    • or. Sitemap should contain any of tags, specified in filterByTags.

    A success response.data object format:

    Field Name Type Description
    items List<Sitemap> A list of Sitemap objects.
    totalCount int Total count of found sitemaps.

    Sitemap object format:

    Field Name Type Description
    id* Guid Sitemap id.
    title* string(200) Sitemap title.
    createdOn* DateTime The date of redirect creation.
    createdBy* string(200) User name of redirect creator.
    lastModifiedOn* DateTime The date of redirect last modification.
    lastModifiedBy* string(200) User name of redirect last modificator.
    version* int A record version number.

    Get a flat list of sitemap nodes

    HTTP GET: /bcms-api/sitemap-nodes/{sitemapId}

    C#: api.Pages.Sitemap.Nodes.Get()

    Returns the flat list and total count of all available sitemap nodes.

    For code API these request parameters must be specified:

    Field Name Type Description
    SitemapId* Guid Sitemap id

    A success response.data object format:

    Field Name Type Description
    items List<Node> A list of Node objects.
    totalCount int Total count of found nodes.

    Node object format:

    Field Name Type Description
    id* Guid Sitemap node id.
    parentId Guid Parent sitemap node id.
    title* string(200) Sitemap node title.
    url* string(850) Site map node URL.
    displayOrder* int Node display order.
    pageId Guid Id of the page linked to this node.
    pageLanguageId Guid Language Id of the page linked to this node.
    macro string(2000) Field dedicated to be used by application developers.
    createdOn* DateTime The date of redirect creation.
    createdBy* string(200) User name of redirect creator.
    lastModifiedOn* DateTime The date of redirect last modification.
    lastModifiedBy* string(200) User name of redirect last modificator.
    version* int A record version number.

    Get a sitemap nodes tree

    HTTP GET: /bcms-api/sitemap-tree/{sitemapId}

    C#: api.Pages.Sitemap.Tree.Get()

    Returns the specified sitemap tree starting from the specified root node.

    For code API use these request parameters:

    Field Name Type Description
    SitemapId* Guid Sitemap id.

    Additional request parameters can be passed:

    Field Name Type Description
    nodeId Guid Starting node id. If null, returns all children nodes from the root node.
    languageId Guid Language id get the nodes in specified language. If null, returns the nodes in default language.

    A success response.data object format:

    Field Name Type Description
    nodes List<Node> A list of specified sitemap node children Node objects with sub-children Node objects.

    Node object format:

    Field Name Type Description
    id* Guid Sitemap node id.
    parentId Guid Parent sitemap node id.
    title* string(200) Sitemap node title.
    url* string(850) Site map node URL.
    displayOrder* int Node display order.
    pageId Guid Id of the page linked to this node.
    pageLanguageId Guid Language Id of the page linked to this node.
    macro string(2000) Field dedicated to be used by application developers.
    nodes List<Node> Children nodes
    translations List<Translation> Node translations
    createdOn* DateTime The date of redirect creation.
    createdBy* string(200) User name of redirect creator.
    lastModifiedOn* DateTime The date of redirect last modification.
    lastModifiedBy* string(200) User name of redirect last modificator.
    version* int A record version number.

    Translation object format:

    Field Name Type Description
    languageId* Guid Translation language id.
    title* string(200) Sitemap node title.
    url* string(850) Site map node URL.
    macro string(2000) Field dedicated to be used by application developers.

    Get a sitemap node by id

    HTTP GET: /bcms-api/sitemap-node/{nodeId}

    C#: api.Pages.Sitemap.Node.Get()

    Returns sitemap node object by specified id.

    For code API these request parameters must be specified:

    Field Name Type Description
    nodeId* Guid Sitemap node id

    A success response.data object format:

    Field Name Type Description
    node Node Sitemap node object.

    Node object format:

    Field Name Type Description
    id* Guid Sitemap node id.
    parentId Guid Parent sitemap node id.
    title* string(200) Sitemap node title.
    url* string(850) Site map node URL.
    displayOrder* int Node display order.
    pageId Guid Id of the page linked to this node.
    pageLanguageId Guid Language Id of the page linked to this node.
    macro string(2000) Field dedicated to be used by application developers.
    createdOn* DateTime The date of redirect creation.
    createdBy* string(200) User name of redirect creator.
    lastModifiedOn* DateTime The date of redirect last modification.
    lastModifiedBy* string(200) User name of redirect last modificator.
    version* int A record version number.


    Blogs

    Authors

    Get a list of authors

    HTTP GET: /bcms-api/authors/

    C#: api.Blog.Authors.Get()

    Returns the list and total count of all available authors.

    Use default request for getting a list.

    A success response.data object format:

    Field Name Type Description
    items List<Author> A list of Author objects.
    totalCount int Total count of found authors.

    Author object format:

    Field Name Type Description
    id* Guid An author id.
    name* string(200) Author name.
    imageId Guid Author image id.
    imageUrl string(850) Author image URL.
    imageThumbnailUrl string(850) Author image thumbnail URL.
    imageCaption string(200) Author image caption.
    createdOn* DateTime The date of author creation.
    createdBy* string(200) User name of author creator.
    lastModifiedOn* DateTime The date of author last modification.
    lastModifiedBy* string(200) User name of author last modificator.
    version* int A record version number.

    Get an author by id

    HTTP GET: /bcms-api/authors/{id}

    C#: api.Blog.Author.Get()

    Returns an author object, identified by id.

    For code API these request parameters must be specified:

    Field Name Type Description
    authorId* Guid Author id.

    A success response.data object format:

    Field Name Type Description
    id* Guid An author id.
    name* string(200) Author name.
    imageId Guid Author image id.
    imageUrl string(850) Author image URL.
    imageThumbnailUrl string(850) Author image thumbnail URL.
    imageCaption string(200) Author image caption.
    createdOn* DateTime The date of author creation.
    createdBy* string(200) User name of author creator.
    lastModifiedOn* DateTime The date of author last modification.
    lastModifiedBy* string(200) User name of author last modificator.
    version* int A record version number.

    Blog posts

    Get a list of blog posts

    HTTP GET: /bcms-api/blog-posts/

    C#: api.Blog.BlogPosts.Get()

    Returns the list and total count of all available blog posts.

    Use default request for getting a list of blog posts with extended filtering options:

    Field Name Type Description
    user UserIdentity User identity object (optional).
    Used for filtering secured blog posts by access rules.
    Empty user is passed by default (filtering by user is disabled).
    includeUnpublished bool Indicates, whether unpublished blog posts should be returned.
    Default: false.
    includeArchived bool Indicates, whether archived blog posts should be returned.
    Default: false.
    includeTags bool Indicates, if tags list should be returned within each blog post model.
    Default = false.
    includeAccessRules bool Indicates if the list of access rules objects should be retrieved.
    Default value =false.
    filterByTags List<string> List of tags, filtered using tags connector (by default, connector value = 'and').
    filterByTagsConnector string Tags filtering connector. Possible values:
    • and (default). Blog post should contain all the tags, specified in filterByTags.
    • or. Blog post should contain any of tags, specified in filterByTags.
    includeCategories bool Indicates if the list of categories should be retrieved.
    Default value =false.
    filterByCategories List<Guid> List of category ids, filtered using categories connector (by default, connector value = 'and').
    filterByCategoriesNames List<string> List of category names, filtered using categories connector (by default, connector value = 'and').
    filterByCategoriesConnector string Categories filtering connector. Possible values:
    • and (default). Blog post should contain all the categories, specified in filterByCategories and filterByCategoriesNames.
    • or. Blog post should contain any of categories, specified in filterByCategories and filterByCategoriesNames.

    A success response.data object format:

    Field Name Type Description
    items List<BlogPost> A list of BlogPost objects.
    totalCount int Total count of found blog posts.

    BlogPost object format:

    Field Name Type Description
    id* Guid Blog post id.
    contentId Guid Blog post content id.
    blogPostUrl* string(850) Blog post URL.
    title* string(200) Blog post title.
    introText string(2000) Blog post intro text (short description).
    isPublished* bool Flag indicates, if blog post is published (or draft).
    publishedOn DateTime Blog post publish date.
    layoutId Guid The blog post layout id (is set only if masterPageId is not set).
    masterPageId Guid The blog post's master page id (is set only if layoutId is not set).
    categories List<Category> List of blog post categories.
    categoryName string(200) Blog post category name.
    authorId Guid Blog post author id.
    authorName string(200) Blog post author name.
    mainImageId Guid Blog post main image id.
    mainImageUrl string(850) Blog post main image URL.
    mainImageThumbnailUrl string(850) Blog post main image thumbnail URL.
    mainImageCaption string(2000) Blog post main image caption.
    featuredImageId Guid Blog post featured image id.
    featuredImageUrl string(850) Blog post featured image URL.
    featuredImageThumbnailUrl string(850) Blog post featured image thumbnail URL.
    featuredImageCaption string(2000) Blog post featured image caption.
    secondaryImageId Guid Blog post secondary image id.
    secondaryImageUrl string(850) Blog post secondary image URL.
    secondaryImageThumbnailUrl string(850) Blog post secondary image thumbnail URL.
    secondaryImageCaption string(2000) Blog post secondary image caption.
    activationDate* DateTime Blog post activation date.
    expirationDate DateTime Blog post expiration date.
    isArchived* bool Indicates, if blog post is marked as archived.
    languageId Guid Language Id.
    languageCode string(200) Language code.
    languageGroupIdentifier Guid Language group identifier.
    tags List<string> List of tags.
    Is retrieved only if request.includeTags is set to true.
    accessRules List<AccessRule> Access rules objects list.
    Only if request.includeAccessRules = true.
    createdOn* DateTime The date of blog post creation.
    createdBy* string(200) User name of blog post creator.
    lastModifiedOn* DateTime The date of blog post last modification.
    lastModifiedBy* string(200) User name of blog post last modificator.
    version* int A record version number.

    AccessRule object format:

    Field Name Type Description
    identity string(200) Role name or user name.
    accessLevel string
    • Deny
    • Read
    • ReadWrite
    isForRole bool Determines, if identity is role name (true) or user name (false).

    Category object format:

    Field Name Type Description
    id* Guid Category id.
    name string(200) Category name
    createdOn* DateTime The date of blog post creation.
    createdBy* string(200) User name of blog post creator.
    lastModifiedOn* DateTime The date of blog post last modification.
    lastModifiedBy* string(200) User name of blog post last modificator.
    version* int A record version number.

    Get a blog post by id

    HTTP GET: /bcms-api/blog-posts/{id}

    C#: api.Blog.BlogPost.Get()

    Returns blog post object, identified by id.

    For code API these request parameters must be specified:

    Field Name Type Description
    BlogPostId* Guid Blog post id.

    A success response.data object format:

    Field Name Type Description
    id* Guid Blog post id.
    contentId Guid Blog post content id.
    blogPostUrl* string(850) Blog post URL.
    title* string(200) Blog post title.
    introText string(2000) Blog post intro text (short description).
    isPublished* bool Flag indicates, if blog post is published (or draft).
    publishedOn DateTime Blog post publish date.
    layoutId Guid The blog post layout id (is set only if masterPageId is not set).
    masterPageId Guid The blog post's master page id (is set only if layoutId is not set).
    categories List<Category> List of blog post categories.
    categoryName string(200) Blog post category name.
    authorId Guid Blog post author id.
    authorName string(200) Blog post author name.
    mainImageId Guid Blog post main image id.
    mainImageUrl string(850) Blog post main image URL.
    mainImageThumbnailUrl string(850) Blog post main image thumbnail URL.
    mainImageCaption string(2000) Blog post main image caption.
    featuredImageId Guid Blog post featured image id.
    featuredImageUrl string(850) Blog post featured image URL.
    featuredImageThumbnailUrl string(850) Blog post featured image thumbnail URL.
    featuredImageCaption string(2000) Blog post featured image caption.
    secondaryImageId Guid Blog post secondary image id.
    secondaryImageUrl string(850) Blog post secondary image URL.
    secondaryImageThumbnailUrl string(850) Blog post secondary image thumbnail URL.
    secondaryImageCaption string(2000) Blog post secondary image caption.
    activationDate* DateTime Blog post activation date.
    expirationDate DateTime Blog post expiration date.
    isArchived* bool Indicates, if blog post is marked as archived.
    languageId Guid Language Id.
    languageCode string(200) Language code.
    languageGroupIdentifier Guid Language group identifier.
    tags List<string> List of tags.
    Is retrieved only if request.includeTags is set to true.
    accessRules List<AccessRule> Access rules objects list.
    Only if request.includeAccessRules = true.
    createdOn* DateTime The date of blog post creation.
    createdBy* string(200) User name of blog post creator.
    lastModifiedOn* DateTime The date of blog post last modification.
    lastModifiedBy* string(200) User name of blog post last modificator.
    version* int A record version number.

    Get a blog post content by ID

    HTTP GET: /bcms-api/blog-posts/content/{contentId}

    C#: api.Blog.BlogPost.Content.Get()

    Gets a blog post content object by specified content ID.

    A success response.data object format:

    Field Name Type Description
    id* Guid Content ID.
    name* string(200) Content name.
    html string(max) Content HTML.
    isPublished* bool Indicates if content is published (or has draft status).
    publishedOn DateTime Content publish date.
    publishedByUser string(200) User name of content publisher.
    createdOn* DateTime The date of content creation.
    createdBy* string(200) User name of content creator.
    lastModifiedOn* DateTime The date of content last modification.
    lastModifiedBy* string(200) User name of content last modificator.
    version* int A record version number.

    For code API use these request parameters:

    Field Name Type Description
    ContentId* Guid Blog post content id.

    Get blog post properties by ID

    HTTP GET: /bcms-api/blog-post-properties/{id}/

    C#: api.Blog.BlogPost.Properties.Get()

    Returns blog post properties object, child and referenced objects, identified by ID.

    A request object format:

    Field Name Type Description
    blogPostId* Guid Blog post ID.
    includeHtmlContent bool Indicates whether blog post HTML content should be loaded (optional, default = false).
    includeTags bool Indicates, whether tag objects list should be loaded (optional, default = false).
    includeCategories bool Indicates whether category objects list should be loaded (optional, default = false).
    includeLayout bool Indicates whether layout object should be loaded (optional, default = false).
    includeAuthor bool Indicates whether author object should be loaded (optional, default = false).
    includeImages bool Indicates whether main image, secondary image and featured image objects should be loaded (optional, default = false).
    includeMetadata bool Indicates whether metadata should be loaded (optional, default = false).
    includeAccessRules bool Indicates whether the list of access rules objects should be retrieved (optional, default = false).
    includeLanguage bool Indicates whether language data should be retrieved (optional, default = false).
    includeTechnicalInfo bool Indicates whether technical information (content, page content, region ids) should be retrieved (optional, default = false).
    includeChildContentOptions bool Indicates whether child content options should be retrieved (optional, default = false).

    A success response.data object format:

    Field Name Type Description
    id* Guid Blog post ID.
    blogPostUrl* string(850) Blog post URL.
    title* string(200) Blog post title.
    introText string(2000) Blog post intro text (short description).
    isPublished* bool Flag, indicates if blog post is published (or draft).
    publishedOn DateTime Blog post publish date.
    layoutId Guid The blog post layout ID (is set only if masterPageId is not set).
    masterPageId Guid The blog post's master page ID (is set only if layoutId is not set).
    categories List<Guid> List of Blog post category IDs.
    authorId Guid Blog post author id.
    activationDate* DateTime Blog post activation date.
    expirationDate DateTime Blog post expiration date.
    isArchived* bool Indicates if blog post is marked as archived.
    mainImageId Guid Blog post main image id.
    featuredImageId Guid Blog post featured image id.
    secondaryImageId Guid Blog post secondary image id.
    useCanonicalUrl bool Flag, indicating whether canonical URL should be used.
    useNoFollow bool Flag, indicating whether noFollow meta tag should be used.
    useNoIndex bool Flag, indicating whether noIndex meta tag should be used.
    createdOn* DateTime The date of blog post creation.
    createdBy* string(200) User name of blog post creator.
    lastModifiedOn* DateTime The date of blog post last modification.
    lastModifiedBy* string(200) User name of blog post last modificator.
    version* int A record version number.

    When response.success equal to "OK", additional response properties are returned (if any of requests flags were selected):


    Only if request.includeLanguage = true
    Field Name Type Description
    htmlContent string Blog post main HTML content.
    Only if request.includeHtmlContent = true.
    originalText string Original text of blog post content.
    Only if request.includeHtmlContent = true.
    contentTextMode string The type of the content's text. Available values:
    • Html
    • Markdown
    • SimpleText

    Only if request.includeHtmlContent = true.
    layout Layout Layout object.
    Only if request.includeLayout = true
    categories List<Category> List of Category objects.
    Only if request.includeCategories = true
    language Language Language object
    author Author Author object.
    Only if request.includeAuthor = true
    tags List<Tag> List of Tag objects.
    Only if request.includeTags = true
    mainImage Image Main image object.
    Only if request.includeImages = true.
    featuredImage Image Featured image object.
    Only if request.includeImages = true.
    secondaryImage Image Secondary image object.
    Only if request.includeImages = true.
    metaData MetaData Metadata object.
    Only if request.includeMetaData = true.
    technicalInfo TechnicalInfo TechnicalInfo object.
    Only if request.includeTechnicalInfo = true.
    accessRules List<AccessRule> Access rules objects list.
    Only if request.includeAccessRules = true.
    childContentsOptionValues List<ChildContentOptionValues> Child contents option values objects list.
    Only if request.includeChildContentsOptionValues = true.

    Layout object format:

    Field Name Type Description
    id* Guid Layout ID.
    name* string(200) Layout name.
    layoutPath* string(850) Layout path (server URL).
    previewUrl string(850) Layout image preview URL.
    createdOn* DateTime The date of layout creation.
    createdBy* string(200) User name of layout creator.
    lastModifiedOn* DateTime The date of layout last modification.
    lastModifiedBy* string(200) User name of layout last modificator.
    version* int A record version number.

    Author object format:

    Field Name Type Description
    id* Guid An author ID.
    name* string(200) Author name.
    imageId Guid Author image id.
    createdOn* DateTime The date of author creation.
    createdBy* string(200) User name of author creator.
    lastModifiedOn* DateTime The date of author last modification.
    lastModifiedBy* string(200) User name of author last modificator.
    version* int A record version number.

    Tag object format:

    Field Name Type Description
    id* Guid A tag id.
    name* string(200) Tag name.
    createdOn* DateTime The date of tag creation.
    createdBy* string(200) User name of tag creator.
    lastModifiedOn* DateTime The date of tag last modification.
    lastModifiedBy* string(200) User name of tag last modificator.
    version* int A record version number.

    Category object format:

    Field Name Type Description
    id* Guid A category id.
    name* string(200) Category name.
    createdOn* DateTime The date of category creation.
    createdBy* string(200) User name of category creator.
    lastModifiedOn* DateTime The date of category last modification.
    lastModifiedBy* string(200) User name of category last modificator.
    version* int A record version number.

    Language object format:

    Field Name Type Description
    id* Guid A language id.
    name* string(200) Language name.
    code* string(200) Language code (.NET CultureInfo Name).
    createdOn* DateTime The date of language creation.
    createdBy* string(200) User name of language creator.
    lastModifiedOn* DateTime The date of language last modification.
    lastModifiedBy* string(200) User name of language last modificator.
    version* int A record version number.

    Image object format:

    Field Name Type Description
    id* Guid An image id.
    title* string(200) Image title.
    caption string(2000) Image caption (tooltip).
    url* string(850) Image URL.
    thumbnailUrl* string(850) Image thumbnail URL.
    createdOn* DateTime The date of image creation.
    createdBy* string(200) User name of image creator.
    lastModifiedOn* DateTime The date of image last modification.
    lastModifiedBy* string(200) User name of image last modificator.
    version* int A record version number.

    Metadata object format:

    Field Name Type Description
    metaTitle string(200) Blog post meta title.
    metaKeywords string(2000) Blog post meta keywords.
    metaDescription string(2000) Blog post meta description.

    TechnicalInfo object format:

    Field Name Type Description
    blogPostContentId Guid Blog post content ID.
    pageContentId Guid Page content ID.
    RegionId Guid Blog post content region ID.

    AccessRule object format:

    Field Name Type Description
    identity string(200) Role name or user name.
    accessLevel string
    • Deny
    • Read
    • ReadWrite
    isForRole bool Determines if identity is role name (true) or user name (false).

    Media Manager

    Medias tree

    Get a tree with media folders and files

    HTTP GET: /bcms-api/media-tree/

    C#: api.Media.MediaTree.Get()

    Returns the response object with recursive images tree and recursive files tree

    Request parameters can be passed:

    Field Name Type Description
    user UserIdentity User identity object (optional).
    Used for filtering secured files by access rules.
    Empty user is passed by default (filtering by user is disabled).
    includeImagesTree bool Indicates if images and image folders tree should be returned.
    Default value = true.
    includeImages bool Indicates if image files should be returned. If set to false, only image folders tree will be returned.
    Default value = true.
    includeFilesTree bool Indicates if files and file folders tree should be returned.
    Default value = true.
    includeFiles bool Indicates if files should be returned. If set to false, only file folders tree will be returned.
    Default value = false.
    includeArchived bool Indicates if archived items should be returned.
    Default value = false.
    includeAccessRules bool Indicates if the list of access rules objects should be retrieved.
    Default = false.

    A success response.data object format:

    Field Name Type Description
    imagesTree List<Media> A recursive list of image Media objects (images and folders).
    filesTree List<Media> A recursive list of file Media objects (files and folders).

    Media object format:

    Field Name Type Description
    id* Guid Media id.
    parentFolderId Guid Parent folder id.
    Null value means root folder.
    title* string(200) Media title.
    description string(2000) Media description.
    mediaContentType* short Media content type:
    - 1 - File (Image/File)
    - 2 - Folder
    url* string(850) Media URL.
    Null for folder.
    isArchived* bool Indicates if media is archived.
    children List<Media> A list of media childrens.
    accessRules List<AccessRule> Access rules objects list.
    Is retrieved only if request.includeAccessRules is set to true.
    createdOn* DateTime The date of media creation.
    createdBy* string(200) User name of media creator.
    lastModifiedOn* DateTime The date of media last modification.
    lastModifiedBy* string(200) User name of media last modificator.
    version* int A record version number.

    AccessRule object format:

    Field Name Type Description
    identity string(200) Role name or user name.
    accessLevel string
    • Deny
    • Read
    • ReadWrite
    isForRole bool Determines if identity is role name (true) or user name (false).

    Images

    Get a list of images

    HTTP GET: /bcms-api/images/

    C#: api.Media.Images.Get()

    Returns the list and total count of images from the specified folder.

    Use default request for getting a list of specified folder images with extended properties:

    Field Name Type Description
    folderId Guid Current folder ID. If null is set, returns the images and sub-folders of the root folder.
    includeImages bool Determines, if image files list should be included to the results.
    Default: true.
    includeFolders bool Determines if sub-folders list should be included to the results.
    Default: true.
    includeArchived bool Determines if archived images/folders should be included to the results.
    Default: false.
    filterByTags List<string> List of tags, filtered using tags connector (by default, connector value = 'and').
    filterByTagsConnector string Tags filtering connector. Possible values:
    • and (default). Image should contain all the tags, specified in filterByTags.
    • or. Image should contain any of tags, specified in filterByTags.

    A success response.data object format:

    Field Name Type Description
    items List<Media> A list of Media objects (images and folders).
    totalCount int Total count of found medias (images and folders) depending on filtering criterias.

    Media object format:

    Field Name Type Description
    id* Guid Image / folder id.
    title* string(200) Image / folder title.
    description string(2000) Image description.
    caption string(2000) Image caption.
    Null for folders.
    mediaContentType* short Media content type:
    - 1 - Image
    - 2 - Folder
    fileExtension string(200) Image file extension.
    Null for folder.
    fileSize long Image file size in bytes.
    Null for folder.
    imageUrl string(850) Image URL.
    Null for folder.
    thumbnailUrl string(850) Image thumbnail URL.
    Null for folder.
    isArchived* bool Indicates if image / folder is archived.
    createdOn* DateTime The date of media creation.
    createdBy* string(200) User name of media creator.
    lastModifiedOn* DateTime The date of media last modification.
    lastModifiedBy* string(200) User name of media last modificator.
    version* int A record version number.

    Get an image by ID

    HTTP GET: /bcms-api/images/{id}/

    C#: api.Media.Image.Get()

    Returns image object, identified by ID.

    Additional request parameters could be passed for retrieving results:

    Field Name Type Description
    includeAccessRules bool Indicates if the list of access rules objects should be retrieved.
    Default value is false.

    For code API, use these request properties:

    Field Name Type Description
    ImageId* Guid Image id.

    A success response.data object format:

    Field Name Type Description
    id* Guid Image id.
    title* string(200) Image title.
    description string(2000) Image description.
    caption string(2000) Image caption.
    fileExtension* string(200) Image file extension.
    fileSize* long Image file size in bytes.
    imageUrl* string(850) Image URL.
    width* int Image width in pixels.
    height* int Image height in pixels.
    thumbnailUrl* string(850) Image thumbnail URL.
    thumbnailWidth* int Image thumbnail width in pixels.
    thumbnailHeight* int Image thumbnail height in pixels.
    thumbnailSize* long Image thumbnail size in bytes.
    isArchived* bool Indicates if image is archived.
    folderId Guid Image folder ID. Null if folder is root folder.
    folderName string(200) Image folder name. Null for root folder.
    publishedOn* DateTime Date when the image version was created.
    originalFileName* string(200) The file name of an original image.
    originalFileExtension* string(200) The file extension of an original image.
    originalWidth* int Original image width in pixels.
    originalHeight* int Original image height in pixels.
    originalSize* long Original image size in bytes..
    originalUrl* string(850) Original image URL.
    createdOn* DateTime The date of image creation.
    createdBy* string(200) User name of image creator.
    lastModifiedOn* DateTime The date of image last modification.
    lastModifiedBy* string(200) User name of image last modificator.
    version* int A record version number.

    Additional properties returned with response:

    Field Name Type Description
    tags List<Tag> List of image Tag objects.
    Only if request.includeTags = true.

    Tag object format:

    Field Name Type Description
    id* Guid A tag id.
    name* string(200) Tag name.
    createdOn* DateTime The date of tag creation.
    createdBy* string(200) User name of tag creator.
    lastModifiedOn* DateTime The date of tag last modification.
    lastModifiedBy* string(200) User name of tag last modificator.
    version* int A record version number.

    Files

    Get a list of files

    HTTP GET: /bcms-api/files/

    C#: api.Media.Files.Get()

    Returns the list and total count of files from specified folder.

    Use default request for getting a list of specified folder files with extended properties:

    Field Name Type Description
    user UserIdentity User identity object (optional).
    Used for filtering secured pages by access rules.
    Empty user is passed by default (filtering by user is disabled).
    folderId Guid Current folder ID. If null is set, returning the files and sub-folders of the root folder.
    includeFiles bool Determines if files list should be included to the results.
    Default: true.
    includeFolders bool Determines if sub-folders list should be included to the results.
    Default: true.
    includeArchived bool Determines if archived files / folders should be included to the results.
    Default: false.
    filterByTags List<string> List of tags, filtered using tags connector (by default, connector value = 'and').
    filterByTagsConnector string Tags filtering connector. Possible values:
    • and (default). File should contain all the tags, specified in filterByTags.
    • or. File should contain any of tags, specified in filterByTags.
    includeAccessRules bool Determines, if the list of access rules objects should be retrieved.
    Default: false.

    A success response.data object format:

    Field Name Type Description
    items List<Media> A list of Media objects (files and folders).
    totalCount int Total count of found medias (files and folders), depending on filtering criterias.

    Media object format:

    Field Name Type Description
    id* Guid File / folder id.
    title* string(200) File / folder title.
    description string(2000) File description.
    mediaContentType* short Media content type:
    - 1 - File
    - 2 - Folder
    fileExtension* string(200) File extension.
    Null for folder.
    fileSize* long File size in bytes..
    Null for folder.
    fileUrl* string(850) File URL.
    Null for folder.
    thumbnailUrl* string(850) Thumbnail URL.
    Null for folder.
    isArchived* bool Indicates if file / folder is archived.
    accessRules List<AccessRule> Access rules objects list.
    Is retrieved only if request.includeAccessRules is set to true.
    createdOn* DateTime The date of media creation.
    createdBy* string(200) User name of media creator.
    lastModifiedOn* DateTime The date of media last modification.
    lastModifiedBy* string(200) User name of media last modificator.
    version* int A record version number.

    AccessRule object format:

    Field Name Type Description
    identity string(200) Role name or user name.
    accessLevel string
    • Deny
    • Read
    • ReadWrite
    isForRole bool Determines if identity is role name (true) or user name (false).

    Get a file by id

    HTTP GET: /bcms-api/files/{id}/

    C#: api.Media.File.Get()

    Returns file object, identified by id.

    Additional request parameters could be passed for retrieving results:

    Field Name Type Description
    includeTags bool Indicates whether list of Tag objects should be returned with response.
    Default value is false.
    includeAccessRules bool Indicates if the list of access rules objects should be retrieved.
    Default = false.

    For code API, use the following request properties:

    Field Name Type Description
    FileId* Guid File id.

    A success response.data object format:

    Field Name Type Description
    id* Guid File id.
    title* string(200) File title.
    description string(2000) File description.
    fileExtension* string(200) File extension.
    fileSize* long File size in bytes..
    fileUrl* string(850) File URL.
    isArchived* bool Indicates, if file is archived.
    folderId Guid File folder id. Null if folder is root folder.
    folderName string(200) File folder name. Null for root folder.
    publishedOn* DateTime Date, when file version was created.
    createdOn* DateTime The date of file creation.
    createdBy* string(200) User name of file creator.
    lastModifiedOn* DateTime The date of file last modification.
    lastModifiedBy* string(200) User name of file last modificator.
    version* int A record version number.

    Additional properties returned with response:

    Field Name Type Description
    tags List<Tag> List of file Tag objects.
    Only if request.includeTags = true.
    accessRules List<AccessRule> Access rules objects list.
    Only if request.includeAccessRules = true.

    Tag object format:

    Field Name Type Description
    id* Guid A tag id.
    name* string(200) Tag name.
    createdOn* DateTime The date of tag creation.
    createdBy* string(200) User name of tag creator.
    lastModifiedOn* DateTime The date of tag last modification.
    lastModifiedBy* string(200) User name of tag last modificator.
    version* int A record version number.

    AccessRule object format:

    Field Name Type Description
    identity string(200) Role name or user name.
    accessLevel string
    • Deny
    • Read
    • ReadWrite
    isForRole bool Determines, if identity is role name (true) or user name (false).

    Upload a file

    HTTP: not available

    C#: api.Media.File.Upload.Post()

    Returns file id.

    Request parameters:

    Field Name Type Description
    folderId Guid Folder ID.
    title* string(200) Title of the uploading file entity
    description string(2000) File description.
    fileName* string(200) Original file name.
    fileStream* Stream File Stream.
    waitForUploadResult bool Indicates if the upload process should be synchronous(response is delivered after file is uploaded) or asynchronous(response is delivered immediately, leaving the file upload in the background)
    Default = false.
    accessRules List Access rules object list

    AccessRule object format:

    Field Name Type Description
    identity string(200) Role name or user name.
    accessLevel string
    • Deny
    • Read
    • ReadWrite
    isForRole bool Determines, if identity is role name (true) or user name (false).

    Users

    Users

    Get a list of users

    HTTP GET: /bcms-api/users/

    C#: api.Users.Users.Get()

    Returns the list and total count of users.

    Use default request for getting a list of users with additional filtering by user roles:

    Field Name Type Description
    filterByRoles List<string> List of role names, for filtering using roles connector (by default, connector value = 'and').
    filterByRolesConnector string Roles filtering connector. Possible values:
    • and (default). User should contain all the roles, specified in filterByRoles.
    • or. User should contain any of roles, specified in filterByRoles.

    A success response.data object format:

    Field Name Type Description
    items List<User> A list of User objects.
    totalCount int Total count of found users, depending on filtering criterias.

    User object format:

    Field Name Type Description
    id* Guid User id.
    userName* string(401) User name.
    firstName* string(200) User first name.
    lastName* string(200) User last name.
    email* string(400) User email.
    imageId Guid User image id.
    imageUrl string(850) User image URL.
    imageThumbnailUrl string(850) User image thumbnail URL.
    imageCaption string(2000) User image id.
    createdOn* DateTime The date of user creation.
    createdBy* string(200) User name of user creator.
    lastModifiedOn* DateTime The date of user last modification.
    lastModifiedBy* string(200) User name of user last modificator.
    version* int A record version number.

    Get a user by id or name

    HTTP GET: /bcms-api/users/{id} - get user by id.

    HTTP GET: /bcms-api/users/by-username/{username} - get user by username.

    C#: api.Users.User.Get()

    Returns user object, identified by id or name.

    Additional request parameters:

    Field Name Type Description
    includeRoles bool Indicates if user roles should be returned.
    The default value is false.

    For code API, use these request properties:

    Field Name Type Description
    UserId Guid User id. Cannot be specified, if UserName is specified.
    UserName string User name. Cannot be specified, if UserId is specified.

    Successful response.data object format:

    Field Name Type Description
    id* Guid User id.
    userName* string(401) User name.
    firstName* string(200) User first name.
    lastName* string(200) User last name.
    email* string(400) User email.
    imageId Guid User image id.
    imageUrl string(850) User image URL.
    imageThumbnailUrl string(850) User image thumbnail URL.
    imageCaption string(2000) User image id.
    createdOn* DateTime The date of user creation.
    createdBy* string(200) User name of user creator.
    lastModifiedOn* DateTime The date of user last modification.
    lastModifiedBy* string(200) User name of user last modificator.
    version* int A record version number.

    Additionally a response returns list of roles:

    Field Name Type Description
    roles List<Role> List of role objects.
    Only if request.includeRoles = true.

    Role object format:

    Field Name Type Description
    id* Guid Role id.
    name* string(401) Role name.
    isSystematic* bool Determines, if role is systematic (cannot be edited / deleted).
    createdOn* DateTime The date of role creation.
    createdBy* string(200) User name of role creator.
    lastModifiedOn* DateTime The date of role last modification.
    lastModifiedBy* string(200) User name of role last modificator.
    version* int A record version number.

    Validate user by username and password

    HTTP GET: /bcms-api/users/validate

    C#: api.Users.User.Validate()

    Checks if user name and password are correct and returns result and user id.

    Request parameters:

    Field Name Type Description
    userName* string(200) User name.
    password* string(255) Password.

    A success response.data object format:

    Field Name Type Description
    valid* bool true if user name and password are valid. false otherwise.
    userId Guid A user id (only if user name and password are valid).

    Roles

    Get a list of roles

    HTTP GET: /bcms-api/roles/

    C#: api.Users.Roles.Get()

    Returns the list and total count of roles.

    Use default request for getting a list of roles.

    A success response.data object format:

    Field Name Type Description
    items List<Role> A list of Role objects.
    totalCount int Total count of found roles, depending on filtering criterias.

    Role object format:

    Field Name Type Description
    id* Guid Role id.
    name* string(401) Role name.
    isSystematic* bool Determines, if role is systematic (cannot be edited / deleted).
    createdOn* DateTime The date of role creation.
    createdBy* string(200) User name of role creator.
    lastModifiedOn* DateTime The date of role last modification.
    lastModifiedBy* string(200) User name of role last modificator.
    version* int A record version number.

    Get a role by id or name

    HTTP GET: /bcms-api/roles/{id} - get role by id.

    HTTP GET: /bcms-api/roles/by-name/{name} - get role by name.

    C#: api.Users.Role.Get()

    Returns role object, identified by id or name.

    For code API, use these request properties:

    Field Name Type Description
    RoleId Guid Role id. Cannot be specified, if RoleName is specified.
    RoleName string Role name. Cannot be specified, if RoleId is specified.

    Successful response.data object format:

    Field Name Type Description
    id* Guid Role id.
    name* string(401) Role name.
    isSystematic* bool Determines, if role is systematic (cannot be edited / deleted).
    createdOn* DateTime The date of role creation.
    createdBy* string(200) User name of role creator.
    lastModifiedOn* DateTime The date of role last modification.
    lastModifiedBy* string(200) User name of role last modificator.
    version* int A record version number.
    Clone this wiki locally