Daļas no šīs lapas nav iztulkotas. Atvainojamies par sagādātajām neērtībām.

API documentation

Table of contents

Open builder (SSO)

To open builder you need to call API URL by posting JSON object with information about user, if all went successfully API will return JSON object with URL you will need to redirect client to, if error occurs API will return JSON object with error message. All request to API require HTTP Basic Authorisation. Username and password for API Authorisation can be found inside your brand on licenses page after you login to your account. All documentation on how to make requests to API and some request examples are below.

http://your-builder-domain.com/api/requestLogin
http://site.pro/api/requestLogin
HTTP Basic
[API Username from brand]
[API Password from brand]
POST
application/json
application/json

Currently builder supports 2 publishing types: external and internal:

  • external – this type uses FTP account to publish website. During API call you need to pass FTP details which builder will use for site publication. Example implementation: Download here.
  • internal – this type uses your API endpoint to publish website. During API call you need to pass your API endpoint URL which builder will call for site publication. Example implementation: Download here.
JSON Object Properties:

Required

  • String – "external" or "internal"
  • String – Client domain name. This field acts as a website identifier in builder. Make sure it is the same for one unique website. Do not pass different values for one website (for example "www" and "non-www" domain versions), otherwise the website will not be found in builder. You can also pass numeric ID for this parameter as website identifier in builder. Then we recommend to add extra parameter "baseDomain". Please see more information about it below.

For external publishing type

required:
  • String – Client FTP connection username.
  • String – Client FTP connection password.
  • String – Client FTP public_html directory ex.: /public_html.
  • String – IP address of client FTP server.

For internal publishing type

required:
  • Number – Website/User ID on your end. It will be passed during your API endpoint call as one of parameters during site publication.
  • String – Your API endpoint URL.
optional:
  • String – HTTP Basic Authorisation username to call API endpoint URL.
  • String – HTTP Basic Authorisation password to call API endpoint URL.

Optional for both publishing types

  • String – Language 2 letter code (ex. "en", "ru", ...) to open builder in.
  • String – Hosting plan identifier, will be used for builder feature limitations by plan.
  • String – Real client's domain name. We recommend to specify this parameter if it differs from what is specified for "domain". This parameter is used in URLs of website sitemap generation.
  • String – URL to image to use as builder logo (if not set will be taken from brand).
  • String – URL to image/icon to use as builder favicon (if not set will be taken from brand).
  • String – Title to use for builder (if not set will be taken from brand).
  • Boolean – Do not allow users to remove builder logo from their websites (if not set will be taken from brand).
  • String – URL to place on builder logo in users website.
  • String – Custom identifier accessible in builder plugins.
  • String – Custom templates path (absolute or relative). If set then will be used for loading templates instead of default path (on-premises only since v3.7.230)
  • Boolean – If set to true response will contain additional two properties: loginHash and builderApiUrl
Return Object Properties:
  • String – Url to redirect client to (only on success)
  • String – Hash that may be used with website controlling API calls (only on success when request property more is set to true)
  • String – Base API url that should be used for website controlling API calls (only on success when request property more is set to true)
  • Object – Error description object (only on error). Error object structure:
    • String – Text describing the error
API endpoint implementation for internal publication type:

During site publication builder will make periodic requests to your API endpoint. The request details are the following:

API endpoint URL
HTTP Basic (only if "username" and "password" parameters were passed to builder API call)
Value of parameter "username" passed to builder API call
Value of parameter "password" passed to builder API call
POST/GET
application/x-www-form-urlencoded
application/json

The publication starts with making POST request to URL API endpoint + /zyro/action and providing zip archive of generated client's website. With this request builder sets the following POST parameters:

  • String – URL to zip file containing website generated files. This zip must be downloaded and extracted to client's hosting.
  • Number – Value of parameter "resellerClientAccountId" passed to builder API.
  • String – Value of parameter "domain" passed to builder API.
  • String – Value of parameter "hostingPlan" passed to builder API (if was set).

API endpoint return result (JSON format):

  • Object – Result description object with structure:
    • String – (required) ID of publication process for further process identification in next builder requests. You can pass any non-empty value here.
    • String – (optional) Error message in case if your endpoint cannot process the publication request.

If endpoint returns error then publication stops in builder and error message in shown to the client which you provide in the response.

After getting successful response from endpoint (with no error) builder starts periodically sending GET requests to API endpoint to determine what status the publication of the site is on your end. It makes request to URL API endpoint + /zyro/action/[id] where [id] is a value returned in endpoint POST request.

During builder GET requests API endpoint must return the following result (JSON format):

  • Object – Result description object with structure:
    • String – (required) It can be one of these:
      • PENDING – the process has not yet started on your end.
      • EXECUTING – the process is being executed on your end.
      • FAILED – the process failed on your end.
      • FINISHED – the process has been complete on your end.
    • String – (optional) Error message if status = FAILED.

The builder will make GET requests to API endpoint every 5 seconds until it receives status "FINISHED" or "FAILED". If the publication lasts for more than 2 hours then GET requests and publication stop and builder will show "operation timed out" error message for client.

This process let's you use queue for publication processes. It can be convenient if you have many customers and there can be many publication processes started at one time then the zip downloading and extraction can slow down the server.
If you want making publication without queue then you can do this by extracting zip file at once on builder POST request and responding to builder first GET request with status "FINISHED".

Note:
Your API endpoint URL must support extra arguments. For example if your endpoint is http://myhostingsite.com/api/publish-site then it also must be accessible via URL http://myhostingsite.com/api/publish-site/zyro/action and http://myhostingsite.com/api/publish-site/zyro/action/[id] from which you will need to retrieve publication process ID.

Request Example (for external publication type):
POST /api/requestLogin HTTP/1.1
Host: your-builder-domain.com
Authorization: Basic W0FQSSBVc2VybmFtZSBmcm9tIGJyYW5kXTpbQVBJIFBhc3N3b3JkIGZyb20gYnJhbmRd
Content-Type: application/json

{
   "type": "external",
   "domain": "test.com",
   "apiUrl": "11.22.33.44",
   "lang": "en",
   "username": "test.com FTP username",
   "password": "test.com FTP password",
   "uploadDir": "/public_html"
}
Request Example (for internal publication type):
POST /api/requestLogin HTTP/1.1
Host: your-builder-domain.com
Authorization: Basic W0FQSSBVc2VybmFtZSBmcm9tIGJyYW5kXTpbQVBJIFBhc3N3b3JkIGZyb20gYnJhbmRd
Content-Type: application/json

{
   "type": "internal",
   "domain": "test.com",
   "apiUrl": "http://myhostingsite.com/api/publish-site",
   "resellerClientAccountId": 1234,
   "lang": "en"
}
Response Example:
HTTP/1.1 200 OK
Content-Type: application/json

{
   "url": "http://your-bulder-domain.com/?login_hash=4asf64df6465"
}
Response With Error Example:
HTTP/1.1 400 Bad Request
Content-Type: application/json

{
   "error": { "message": "some kind of error message" }
}

List template categories

Get list of template categories as JSON.

http://your-builder-domain.com/api/category-list
GET
application/json
JSON response Object Properties:
  • String - template category ID;
  • String - template category name;
  • Number - number of templates contained in this category;

List templates

Get list of templates as JSON.

http://your-builder-domain.com/api/template-list
GET
application/json
JSON response Object Properties:
  • String - template ID;
  • String - template ID (relative to category);
  • String - templates category ID;
  • String - template name;
  • String - template image URL;

Get page types available in template available since version 3.7.229 (on-premises only)

http://your-builder-domain.com/api/website/get-page-types
HTTP Basic
[API Username from brand]
[API Password from brand]
POST
application/json
application/json
JSON request Object Properties:
  • String - template id to create website from;
JSON response Object Properties:
  • Boolean - (optional) returned on success, contains value true, indicates successfully executed action;
  • String - (optional) returned on success, contains template;
  • Array of String - (optional) returned on success, contains list of page types;
  • String - (optional) returned on error, contains error message, indicates failure to execute action;

Create website available since version 3.7.229 (on-premises only)

This API action requires a loginHash, that can be received by using "Open builder" API call with additional parameter more = true. Furthermore http://your-builder-domain.com/api/ in Call API URL should be replaced with builderApiUrl received from "Open builder" API call, so new API url for this action would be builderApiUrl + website/create.

http://your-builder-domain.com/api/website/create (builderApiUrl + "website/create")
HTTP Basic
[API Username from brand]
[API Password from brand]
POST
application/json
application/json
JSON request Object Properties:
  • String - login hash you received from "Open builder" API call;
  • String - template id to create website from;
  • Array of String - (optional) list of page types to indicate pages that need to be added from template (if not specified all pages will be added). List of available page types can be received by using "Get page types available in template" API call;
  • Object - (optional) key value pair list of variables (reference IDs in template) and their values, that will replace website elements contents (available since version 3.7.256); Possible values for different element types:
    • String - text or HTML;
    • String - image URL/Data URL;
    • String - comma (,) separated coordinates;
JSON response Object Properties:
  • Boolean - (optional) returned on success, contains value true, indicates successfully executed action;
  • String - (optional) returned on success, contains template used to create website;
  • Object - (optional) returned on success, contains key value pair list of created pages where key is page ID and value is page type;
  • String - (optional) returned on error, contains error message, indicates failure to execute action;

Modify website available since version 3.7.229 (on-premises only)

This API action requires a loginHash, that can be received by using "Open builder" API call with additional parameter more = true. Furthermore http://your-builder-domain.com/api/ in Call API URL should be replaced with builderApiUrl received from "Open builder" API call, so new API url for this action would be builderApiUrl + website/modify.

http://your-builder-domain.com/api/website/modify (builderApiUrl + "website/modify")
HTTP Basic
[API Username from brand]
[API Password from brand]
POST
application/json
application/json
JSON request Object Properties:
  • String - login hash you received from "Open builder" API call;
  • Object - (optional) key value pair list of variables (reference IDs in template) and their values, that will replace website elements contents; Possible values for different element types:
    • String - text or HTML;
    • String - image URL/Data URL;
    • String - comma (,) separated coordinates;
JSON response Object Properties:
  • Boolean - (optional) returned on success, contains value true, indicates successfully executed action;
  • String - (optional) returned on error, contains error message, indicates failure to execute action;

Rename website available since version 3.7.295 (on-premises only)

http://your-builder-domain.com/api/website/rename (builderApiUrl + "website/rename")
HTTP Basic
[API Username from brand]
[API Password from brand]
POST
application/json
application/json
JSON request Object Properties:
  • String - domain you want to rename;
  • String - new domain name;
JSON response Object Properties:
  • Boolean - (optional) returned on success, contains value true, indicates successfully executed action;
  • String - (optional) returned on error, contains error message, indicates failure to execute action;

Publish website available since version 3.7.350 (on-premises only)

This API action requires a loginHash, that can be received by using "Open builder" API call with additional parameter more = true. Furthermore http://your-builder-domain.com/api/ in Call API URL should be replaced with builderApiUrl received from "Open builder" API call, so new API url for this action would be builderApiUrl + publish.

This API is for publishing website. Publishing website consists of 2 or more API calls:
    1) use "Open builder" API call with additional parameter more = true to get loginHash and builderApiUrl;
    2) with this API use received loginHash and builderApiUrl + 'publish' (as API URL) to initiate publishing process (when API call returns it only means that publishing has started);
    3) optionally call (same as in step 2) API call with additional parameter progress = true to get publishing progress (when you receive response with complete = true, then publishing process has completed);

http://your-builder-domain.com/api/publish (builderApiUrl + "publish")
HTTP Basic
[API Username from brand]
[API Password from brand]
POST
application/json
application/json
JSON request Object Properties:
  • String - login hash you received from "Open builder" API call;
  • String - (optional) if set then progress of specified publication process will be returned, otherwise new publication process will be started and its process ID will be returned in the response;
  • String - (optional) template id, if passed then current template (is exists) will be removed and replaced with this new template (all data will be lost);
JSON response Object Properties:
  • String - (optional) text describing current publish process progress;
  • Number - (optional) numeric value from 0 to 100 to show progress completeness (note publishing consists of multiple actions so this value will go multiple times to 100, so do not rely on it);
  • Boolean - (optional) if true then publishing process is complete;
  • String - (optional) error message, if this parameter is not empty that means publishing process stopped (unless this is authentication error);
  • String - (optional) publication process ID (set only when requested for new publication, that is "processId" property was not set in the request);

Delete website available since version 3.7.64 (on-premises only)

This API is for permanently deleting website from on-premises builder. This will only delete website project data from builder itself and leave published website intact.

http://your-builder-domain.com/api/delete-site
HTTP Basic
[API Username from brand]
[API Password from brand]
POST
application/json
application/json

  • String - website domain name (required)
  • Boolean - result of response (only on success)
  • Object - error description object (only on error). Error object structure:
    • String - text describing the error
POST /api/delete-site HTTP/1.1
Host: your-builder-domain.com
Authorization: Basic W0FQSSBVc2VybmFtZSBmcm9tIGJyYW5kXTpbQVBJIFBhc3N3b3JkIGZyb20gYnJhbmRd
Content-Type: application/json

{"domain": "test.com"}
HTTP/1.1 200 OK
Content-Type: application/json

{"ok": true}
HTTP/1.1 200 OK
Content-Type: application/json

{"error": {"message": "some kind of error message"}}

Create website backup available since version 3.7.316 (on-premises only)

Creates site source file backup and stores locally on builder server or returns as downloadable file.

http://your-builder-domain.com/api/create-site-backup
HTTP Basic
[API Username from brand]
[API Password from brand]
POST
application/json
application/json

  • String - domain name used to identify website witch will be backed up (required).
  • String - absolute folder path inside builder server where to store backup file (optional, if not set backup file will be returned in response for downloading). When backup file is stored locally in provided folder it will have file name: "[domain]_project.sitebuilder".

On success you get empty response (in case of local storage) or response with a file for downloading. HTTP response code should be 200.
On error you will get JSON encoded object as response. HTTP response code should be something other than 200.

  • Object - error description object (only on error). Error object structure:
    • Number - error code
    • String - text describing the error
POST /api/create-site-backup HTTP/1.1
Host: your-builder-domain.com
Authorization: Basic W0FQSSBVc2VybmFtZSBmcm9tIGJyYW5kXTpbQVBJIFBhc3N3b3JkIGZyb20gYnJhbmRd
Content-Type: application/json

{
    "domain": "site-to-backup.com",
    "dir": "/mnt/backup_storage"
}
HTTP/1.1 200 OK
HTTP/1.1 200 OK
Content-Type: application/octet-stream
Content-disposition: attachment; filename="site-to-backup.com_project.sitebuilder"

[some binary data]
HTTP/1.1 500 Internal Error
Content-Type: application/json

{"error": {"code": 1, "message": "some kind of error message"}}

Restore website backup available since version 3.7.316 (on-premises only)

Restores site backup from local file or remote URL.

http://your-builder-domain.com/api/restore-site-backup
HTTP Basic
[API Username from brand]
[API Password from brand]
POST
application/json
application/json

  • String - domain name used to identify web-site witch will be restored from backup (required).
  • String - absolute path inside builder server or absolute external URL to backup file to restore from (required).

On success you will get JSON encoded object as response. HTTP response code should be 200.

  • Boolean - it will be equal to true to indicate success.

On error you will get JSON encoded object as response. HTTP response code should be something other than 200.

  • Object - error description object (only on error). Error object structure:
    • Number - error code
    • String - text describing the error
POST /api/restore-site-backup HTTP/1.1
Host: your-builder-domain.com
Authorization: Basic W0FQSSBVc2VybmFtZSBmcm9tIGJyYW5kXTpbQVBJIFBhc3N3b3JkIGZyb20gYnJhbmRd
Content-Type: application/json

{
    "domain": "site-to-restore.com",
    "file": "/mnt/backup_storage/site-to-restore.com_project.sitebuilder"
}
HTTP/1.1 200 OK
Content-Type: application/json

{"ok": true}
HTTP/1.1 500 Internal Error
Content-Type: application/json

{"error": {"code": 1, "message": "some kind of error message"}}

Get website template available since version 3.7.344 (on-premises only)

This API action requires a loginHash, that can be received by using "Open builder" API call with additional parameter more = true. Furthermore http://your-builder-domain.com/api/ in Call API URL should be replaced with builderApiUrl received from "Open builder" API call, so new API url for this action would be builderApiUrl + website/get-template.

http://your-builder-domain.com/api/website/get-template (builderApiUrl + "website/get-template")
HTTP Basic
[API Username from brand]
[API Password from brand]
POST
application/json
application/json
JSON request Object Properties:
  • String - login hash you received from "Open builder" API call;
JSON response Object Properties:
  • Boolean - (optional) returned on success, contains value true, indicates successfully executed action;
  • String - (optional) returned on success, contains template ID [category/template] used to create website;

Get website pages available since version 3.7.344 (on-premises only)

This API action requires a loginHash, that can be received by using "Open builder" API call with additional parameter more = true. Furthermore http://your-builder-domain.com/api/ in Call API URL should be replaced with builderApiUrl received from "Open builder" API call, so new API url for this action would be builderApiUrl + website/get-pages.

http://your-builder-domain.com/api/website/get-pages (builderApiUrl + "website/get-pages")
HTTP Basic
[API Username from brand]
[API Password from brand]
POST
application/json
application/json
JSON request Object Properties:
  • String - login hash you received from "Open builder" API call;
JSON response Object Properties:
  • Boolean - (optional) returned on success, contains value true, indicates successfully executed action;
  • Array of Object - (optional) returned on success, contains list of website pages. Each page object has following structure:
    • String - page type.
    • Object - part of page definition containing the following structure:
      • String - page ID.
      • String - page title (defined in SEO settings).
      • String - page user friendly URL (defined in SEO settings).
      • Boolean - indicates if page is popup.
      • Number - popup page width (set only if page is popup).
      • Number - popup page height (set only if page is popup).
    • Object - part of page definition containing the following structure:
      • String - menu item name.
      • Boolean - indicates if menu item is hidden in Menu element.

Add pages to website available since version 3.7.229 (on-premises only)

This API action requires a loginHash, that can be received by using "Open builder" API call with additional parameter more = true. Furthermore http://your-builder-domain.com/api/ in Call API URL should be replaced with builderApiUrl received from "Open builder" API call, so new API url for this action would be builderApiUrl + website/add-pages.

http://your-builder-domain.com/api/website/add-pages (builderApiUrl + "website/add-pages")
HTTP Basic
[API Username from brand]
[API Password from brand]
POST
application/json
application/json
JSON request Object Properties:
  • String - login hash you received from "Open builder" API call;
  • String - template id to add pages from;
  • Array of String - list of page types to indicate pages that need to be added from template. List of available page types can be received by using "Get page types available in template" API call;
JSON response Object Properties:
  • Boolean - (optional) returned on success, contains value true, indicates successfully executed action;
  • String - (optional) returned on success, contains template used to add pages from;
  • Object - (optional) returned on success, contains key value pair list of created pages where key is page ID and value is page type;
  • String - (optional) returned on error, contains error message, indicates failure to execute action;

Duplicate pages in website available since version 3.7.229 (on-premises only)

This API action requires a loginHash, that can be received by using "Open builder" API call with additional parameter more = true. Furthermore http://your-builder-domain.com/api/ in Call API URL should be replaced with builderApiUrl received from "Open builder" API call, so new API url for this action would be builderApiUrl + website/duplicate-pages.

http://your-builder-domain.com/api/website/duplicate-pages (builderApiUrl + "website/duplicate-pages")
HTTP Basic
[API Username from brand]
[API Password from brand]
POST
application/json
application/json
JSON request Object Properties:
  • String - login hash you received from "Open builder" API call;
  • Array of String - list of page IDs to indicate pages that need to be duplicated;
JSON response Object Properties:
  • Boolean - (optional) returned on success, contains value true, indicates successfully executed action;
  • Array of String - (optional) returned on success, contains ID list of created pages;
  • String - (optional) returned on error, contains error message, indicates failure to execute action;

Remove pages from website available since version 3.7.229 (on-premises only)

This API action requires a loginHash, that can be received by using "Open builder" API call with additional parameter more = true. Furthermore http://your-builder-domain.com/api/ in Call API URL should be replaced with builderApiUrl received from "Open builder" API call, so new API url for this action would be builderApiUrl + website/remove-pages.

http://your-builder-domain.com/api/website/remove-pages (builderApiUrl + "website/remove-pages")
HTTP Basic
[API Username from brand]
[API Password from brand]
POST
application/json
application/json
JSON request Object Properties:
  • String - login hash you received from "Open builder" API call;
  • Array of String - list of page IDs to indicate pages that need to be removed;
JSON response Object Properties:
  • Boolean - (optional) returned on success, contains value true, indicates successfully executed action;
  • Array of String - (optional) returned on success, contains ID list of removed pages (will only contain pages that were actually removed, if they did not exist they will not be in this list);
  • String - (optional) returned on error, contains error message, indicates failure to execute action;

Import website available since version 3.7.312 (on-premises only)

This API action allows to import website to the builder without any user interaction.

Import limits specified in maxPages, maxFiles, maxGallerySize, maxImageSize, maxDocumentSize are capped at limits set by Site.Pro. For example setting maxPages to 1000 will still be reduced to 20 unless we had this limit increased.

Please be aware that once import is successfully complete old website is fully replaced with imported one.

This API action requires a loginHash, that can be received by using "Open builder" API call with additional parameter more = true. Furthermore http://your-builder-domain.com/api/ in Call API URL should be replaced with builderApiUrl received from "Open builder" API call, so new API url for this action would be builderApiUrl + website/import-begin.

http://your-builder-domain.com/api/website/import-begin (builderApiUrl + "website/import-begin")
HTTP Basic
[API Username from brand]
[API Password from brand]
POST
application/json
application/json
JSON request Object Properties:
  • String - login hash you received from "Open builder" API call;
  • String - URL of a website to import;
  • Number - (optional) maximum number of pages that import service can try to import from the website (defaults to 20 unless increased by Site.Pro);
  • Number - (optional) maximum number of files that can be downloaded into media library (defaults to 1000 unless increased by Site.Pro);
  • Number - (optional) maximum bytes that are allowed to be imported into media library (defaults to 52428800 [50MB] unless increased by Site.Pro);
  • Number - (optional) maximum bytes allowed for image files (jpg, png, gif) (defaults to 3145728 [3MB] unless increased by Site.Pro);
  • Number - (optional) maximum bytes allowed for files other than images (defaults to 20971520 [20MB] unless increased by Site.Pro);
  • Boolean - (optional) tells import service whether "Auto Layout" mode should be enabled on imported website (defaults to true);
JSON response Object Properties:
  • Boolean - (optional) returned on success, contains value true, indicates successfully executed action;
  • String - (optional) returned on success, contains import task ID that must be used with "Get import status" API call;
  • String - (optional) returned on error, contains error message, indicates failure to execute action;

Get import status available since version 3.7.312 (on-premises only)

This API action returns status of import task created with "Import website" API call.

Once import task is finished further "Get import status" API calls will return error "Import task not found.". Import task is considered finished on two conditions:

  • complete property of returned status object is set to true (successful import),
  • or error property exists in returned status object (unsuccessful import).

Please be aware that once import is successfully complete old website is fully replaced with imported one.

Make sure to do periodic "Get import status" API calls after starting import (recommended period is 3 to 10 seconds) since otherwise after 30 seconds of "silence" import service may consider the task to be abandoned and abort it.

This API action requires a loginHash, that can be received by using "Open builder" API call with additional parameter more = true. Furthermore http://your-builder-domain.com/api/ in Call API URL should be replaced with builderApiUrl received from "Open builder" API call, so new API url for this action would be builderApiUrl + website/import-status.

http://your-builder-domain.com/api/website/import-status (builderApiUrl + "website/import-status")
HTTP Basic
[API Username from brand]
[API Password from brand]
POST
application/json
application/json
JSON request Object Properties:
  • String - login hash you received from "Open builder" API call;
  • String - import task ID received from "Import website" API call;
JSON response Object Properties:
  • Boolean - (optional) returned on success, contains value true, indicates successfully executed action;
  • TaskStatus - (optional) returned on success, contains status of import task;
  • String - (optional) returned on error, contains error message, indicates failure to execute action;
TaskStatus object properties:
  • Boolean - value of true indicates that import task was completed successfully and website was replaced with imported one;
  • Object - (optional) returned only if there is an error related to import task. This object has following properties:
    • Boolean - value of true indicates that potentially the error is only temporary and trying to import same URL again has a chance to succeed;
    • String - error message from import service related to the import task. This message is displayed in builder to users, may be translated and may contain HTML code;
    • Number - numeric code of error message from import service (see table below);
  • String - (optional) current import task status text as displayed to users in builder (may be translated and contain HTML). This property will be available only if there are no errors and builder is still connected to import service;
  • Number - (optional) overall import task progress percentage (0 to 100). This property will be available only if there are no errors and builder is still connected to import service;
  • Object - (optional) import task progress information divided into steps (processes). This property will be available only if there are no errors and builder is still connected to import service. This object has following properties:
    • StepProgress - progress of waiting in import service queue;
    • StepProgress - progress of reading (crawling) website;
    • StepProgress - progress of processing found HTML pages;
    • StepProgress - progress of downloading resources (images, documents, etc.) into media library;
    • StepProgress - progress of loading imported website into builder;
StepProgress object properties:
  • String - status of step (process). Possible values are:
    • pending - not yet started,
    • active - currently in progress,
    • done - finished and will no longer be returned to.
  • String - step name as displayed in builder (may be translated and contain HTML code);
  • Number - step progress percentage (0 to 100);
  • String - step progress in form of text as displayed in builder over progress bar (may be translated and contain HTML code);
Possible values of TaskStatus.error.code:
Code Name Description
1 Service unavailable Import service is currently unavailable due to maintenance or network connectivity issues.
2 Refusal to serve Import service is not enabled for your account.
3 Internal error There was an internal import service error.
4 Invalid URL Invalid URL provided with "Import website" API call.
5 Cross-domain redirect Website redirects to a domain that differs from the one in URL provided with "Import website" API call. Redirects between www and non-www subdomains is not considered a cross-domain redirect.
6 Timeout There was a timeout in one of import service processes. Timeout usually happens due to slow website connection or due to very high website complexity.
7 Bad website There is a number of reasons, why this error may happen:
  • provided URL is valid, but domain name cannot be resolved;
  • import service is unable to connect to domain due to firewall or network connectivity issues;
  • requesting provided URL returns a HTTP status code that indicates an error;
  • URL points to a resource with Content-Type different than text/html;
  • URL points to a resource that is not a valid HTML page;
  • URL points to an attachment (Content-Disposition header received);
8 Bad website resources This is an extremely rare error when website cannot be imported into builder due to corruption in imported data (usually bad files imported into media library).
9 Website too complex This error happens when service is unable to handle import of website due to extremely high requirements to computational resources.
10 Website protected Imported website is located on a server belonging to one of our clients that has import protection enabled.
11 Task cancelled Import process was cancelled due to abandonment (no status requests received for 30 seconds). This error may also happen on rare occasions when import service detects that there is no progress for several minutes and import task gets cancelled to perform an automatic service maintenance (can be considered as timeout or too complex website).
12 Owner does not match This error may happen only if loginHash in current request differs from the one used in "Import website" API call.

Get list of published websites

Notes:
Statistics of on-premises builders are updated only several times a day. Please refrain from calling this method more than once per 3 hours.
Important:
When neither offset nor limit parameters are specified request must still contain an empty JSON object in the body. Otherwise you will receive a response with "Bad input data" error.
http://site.pro/api/hosting-accounts/get-domains
HTTP Basic
[API Username from brand]
[API Password from brand]
POST
application/json
application/json
JSON request Object Properties:
  • Number - (optional) starting offset in the list of domains;
  • Number - (optional) maximum number of domains to return;
  • String - (optional) if is set then will return info about this domain only (will ignore limit and offset);
JSON response Object Properties:
  • Boolean - (optional) returned on success, contains value true, indicates successfully executed action;
  • Array of Object - (optional) returned on success, contains a list of domains. Each domain object has following structure:
    • String - domain name;
    • Boolean - blocking state of the domain: false for not blocked and true for blocked domains;
  • String - (optional) returned on error, contains error message, indicates failure to execute action;

Block/unblock website

This API is for controlling accounts (websites).

Notes:
Information about websites quantity in licenses is updated once per hour.


Download here.

http://site.pro/api/hosting-accounts/set-blocked
HTTP Basic
[API Username from brand]
[API Password from brand]
POST
application/json
application/json
JSON request Object Properties:
  • String - websites domain to block/unblock;
  • Boolean - if true will be blocked, if false will be unblocked.
JSON response Object Properties:
  • Boolean - (optional) returned on success, contains value true, indicates successfully executed action;
  • String - (optional) returned on success, contains domain;
  • Boolean - (optional) returned on success, contains blocked state;
  • String - (optional) returned on error, contains error message, indicates failure to execute action;

Controlling IP list

This API request has multiple functions accessible via same URL. Function that must be performed on the IP list must always be specified in the action parameter of each request.


Download here.

http://site.pro/api/ipList
HTTP Basic
[API Username from brand]
[API Password from brand]
POST
application/json
application/json

Getting simple IP list

JSON request Object Properties:
  • String = list.
  • Number - ID of a license to get IP list for.
JSON response Object Properties:
  • Boolean - (optional) returned on success, contains value true, indicates successfully executed action.
  • Number - (optional) max. number of IPs that can be added to this license.
  • Array of String - (optional) returned on success, contains list of IP's.
  • Object - (optional) returned on error, contains error message, indicates failure to execute action. Error object structure:
    • String - text describing the error

Getting extended IP list

JSON request Object Properties:
  • String = list-full.
  • Number - ID of a license to get IP list for.
JSON response Object Properties:
  • Boolean - (optional) returned on success, contains value true, indicates successfully executed action.
  • Number - (optional) max. number of IPs that can be added to this license.
  • Array of Objects - (optional) returned on success, contains list of IP's and assigned brands. Each IP object has following structure:
    • String - an IP address.
    • Number - ID of brand assigned to IP.
  • Object - (optional) returned on error, contains error message, indicates failure to execute action. Error object structure:
    • String - text describing the error

Adding a new IP

JSON request Object Properties:
  • String = add.
  • Number - ID of a license to add IP to.
  • String - IP you want to add.
  • Number - ID of a registered brand to assign.
JSON response Object Properties:
  • Boolean - (optional) returned on success, contains value true, indicates successfully executed action.
  • Object - (optional) returned on error, contains error message, indicates failure to execute action. Error object structure:
    • String - text describing the error

Updating an IP

JSON request Object Properties:
  • String = update.
  • Number - ID of a license to update IP in.
  • String - IP you want to update.
  • String - IP to update to (optional if brandId is specified).
  • Number - ID of a registered brand to assign (optional if newIp is specified).
JSON response Object Properties:
  • Boolean - (optional) returned on success, contains value true, indicates successfully executed action.
  • Object - (optional) returned on error, contains error message, indicates failure to execute action. Error object structure:
    • String - text describing the error

Deleting an existing IP

JSON request Object Properties:
  • String = delete.
  • Number - ID of a license to delete IP from.
  • String - IP you want to delete.
JSON response Object Properties:
  • Boolean - (optional) returned on success, contains value true, indicates successfully executed action.
  • Object - (optional) returned on error, contains error message, indicates failure to execute action. Error object structure:
    • String - text describing the error

IP controlling example


POST /api/ipList HTTP/1.1
Host: site.pro
Authorization: Basic W0FQSSBVc2VybmFtZSBmcm9tIGJyYW5kXTpbQVBJIFBhc3N3b3JkIGZyb20gYnJhbmRd
Content-Type: application/json

{
   "action": "list-full",
   "suborderId": 123456789
}


HTTP/1.1 200 OK
Content-Type: application/json

{
   "ok": true,
   "list": [
      {
         "ip": "192.66.66.1",
         "brandId": 12345
      },
      {
         "ip": "192.66.66.2",
         "brandId": 12345
      }
   ]
}


HTTP/1.1 400 Bad Request
Content-Type: application/json

{
   "error": { "message": "some kind of error message" }
}

Check if imported website is owned by user available since version 3.7.312

Important:
This is a description of API endpoint that builder expects to exist when imported website ownership verification is enabled and set to use this API.

For builder to use this API it must be enabled and URL of API endpoint for this request (Call API URL) must be entered in the builder configuration. To do this you must:

  1. open brand properties dialog,
  2. open builder customization dialog ("Customize Builder" link),
  3. switch to configuration tab,
  4. make sure "Check website ownership" is checked,
  5. enter URL of your API endpoint in "Custom ownership checking API endpoint URL" field,
  6. apply changes.
http://your-domain.com/check-ownership.php
POST
application/json
application/json
JSON request Object Properties:
  • String - integration API secret key that is entered in brand configuration (since v3.7.314).
  • String - domain that must be checked if it is owned by the user.
  • String - domain that is currently open in website builder.
  • String - IP (for external publish type) or URL (for internal publish type) where current website is set to be published. See apiUrl property of "Open builder" API request.
  • String - (optional) Copy of extReferenceId property passed to website builder with "Open builder" API request. Available only when custom API is used to open website builder.
JSON response Object Properties:
  • Boolean - value must be set to true when requested domain is owned by the user and website may be imported;
Example

POST /check-ownership.php HTTP/1.1
Host: your-domain.com
Content-Type: application/json

{
    "key": "",
    "domain": "example.com",
    "id_domain": "my-new-website.com",
    "id_ip": "192.66.66.1"
}


HTTP/1.1 200 OK
Content-Type: application/json

{
   "ok": true
}


HTTP/1.1 200 OK
Content-Type: application/json

{
    "ok": false
}