Sign in Registration
ruen

Creating a Bitrix24 site programmatically

1C-Bitrix recently introduced a new software product - Bitrix24 sites . Now anyone can create their own website in just a few minutes by selecting and placing ready-made blocks. All of this is reminiscent of existing site creation services - site builders . But Bitrix24 Sites is a more professional tool with much wider possibilities. This includes: integration with a CRM system, rich functionality of REST API , ease of working with the service, etc.

The choice of blocks is currently sufficient to create almost any site. In addition, blocks can be easily created by yourself using the API. But what can I say, using the API, you can create a completely entire site, and there are more opportunities than creating a site through the interface. To begin with, it is worth developing a site in the interface, then you can transfer the creation process to code. In order to migrate to the code, you need to add an application that will make API requests , thereby creating the site.

You can add an application by going to your Bitrix24 portal and selecting the "Applications" item in the left menu. Then click "Add Application" and select "Personal Use". Fill in the required fields, set the required rights (minimum rights are “Sites” and “Users”), then provide links to your server where the code will run or download the application as a ZIP archive.

Битрикс24 сайты

Click "Save", an application will be created that runs your code. For example, the simplest such application can be a button that starts the process of creating a website. By clicking on the button, you can send an Ajax request to the server and data about the actions performed will be returned from there. API requests can be made in various ways: via javascript, php, etc. It is convenient to use, for example, the PHP CURL for calling API methods. Documentation on the Bitrix24 sites API is located at: https://dev.1c-bitrix.ru/rest_help/landing/index.php . Anyone who is more or less versed in programming can write the most minimal code for creating a website. First, you need to create a site, for this the landing.site.add method is called.

Битрикс24 сайты: методы сайта

Then you need to add a page, call the landing.landing.add method.

Битрикс24 сайты: методы страниц

When the page is added, add the first block to it by calling the landing.landing.addblock method.

Битрикс24 сайты: методы блоков

Everything, the minimum actions have been completed, now it remains to remember to apply the changes, call the method to publish the page: landing.landing.publication . After that, you can call other necessary methods to create a fully functional site.

The screenshots also show other methods, a complete list and description of all methods is available on the official documentation page "Битрикс24 сайты". The site created programmatically will appear in the "Sites" section of your Bitrix24 portal , you can work with it as if you had created it manually. Creating a site programmatically may be useful for introducing such functionality into Bitrix24 applications or third-party services. The Bitrix24 Sites service is young and constantly evolving, it is a rather promising direction of the company's development.

Comments (0)
For commenting sign in or register.
Оставить заявку

Latest articles

Popular sections

Eqsash (Tools)

Android app - VK LAST USER ID, отучитель от зависимости и т.д.:
Available on Google Play

Amessage (Communication)

Login to the web version
Android app:
Available on Google Play

Share this

Subscribe to

YouTube

Books

IT notes - In simple language about the most necessary things (HTML, CSS, JavaScript, PHP, databases, Drupal, Bitrix, SEO, domains, security and more), PDF, 500 p.