Site.pro
  • Website Builder
    • Website Builder
    • Prices
    • Website Import
    • Online Stores
    • Plugins
    • Collaboration
    • Templates
    • Languages
    • Affiliate Program
    • Examples
    • AI Website Builder
    • For Design Studios
    • We Build for You
  • Domains
  • Email
  • Learn
    • Tutorials
    • Blog
    • FAQ
    • Growth Hacking
    • For Hostings
    • Domainity
    • For Education
  • For Resellers
    • Prices
    • White Label
    • Revenue Share
    • Panels
    • How it Works
    • Mass Import
    • Our Partners
    • Reselling Examples
    • Marketing Materials
    • Documentation
    • Free Websites
  • Website Builder
    • Website BuilderEverybody can easily create a website, landing page, or e-commerce store.
    • PricesSite.pro Prices: Templates 200+, Websites, Basic Builder Functions, Online Stores.
    • Website ImportTransfer your existing website from anywhere to Site.pro website builder.
    • Online StoresSell your goods or services anywhere on the website.
    • PluginsMany functions and plugins depending on geographical preferences.
    • CollaborationCollaborative Website Builder, Create a website with teammates in real-time in one space.
    • Templates
    • Languages
    • Affiliate Program
    • Examples
    • AI Website Builder
    • For Design Studios
    • We Build for You
  • Domains
  • Email
  • Learn
    • TutorialsVideos for Beginners. Download video tutorials for free New video tutorial.
    • BlogWebsite Builder Lifehacks: Shared Hosting tips from Hosting Market Leaders.
    • FAQHelp center. Payment Issues. Basic Tutorial. Quick search. Have questions? Enter your question here.
    • Growth HackingBoost your sales. Strategy
    • For HostingsEducation. Generate more website builder sales
    • DomainityDomainity: Domain quantity per 1000 people
    • For EducationFree Website Builder for Online and Offline Classrooms.
  • For ResellersWhite Label
    • PricesStart reselling. Pay for live websites. Free Websites.
    • White LabelThe most popular white label tool is ideal for reselling
    • Revenue ShareWebsite Builder: Provide free website builder and earn 50% commissions.
    • PanelsOne product for all platforms. Download plugin for your panel.
    • How it WorksCloud or On-Premises. Recommendations for Builder Server.
    • Marketing MaterialsVideo. Mockups. Website Blocks. Marketing Materials.
    • Mass Import
    • Our Partners
    • Reselling Examples
    • Documentation
    • Free Websites
  • Register

    Register

    (Buy Domain, Create email)
    (For Hosting Companies)
    By registering, you accept our Terms of Service
    Number of Customers: 1-100
    Number of Customers: 1-100
  • Log in

    Log in

    New user? Create account
    Forgot password?
  • $
  • English
Server Requirements
  • Published websites
  • Site.pro IPs
Builder installation / update
On-Premises
  • Server Requirements
  • Installation
  • CRON
  • Update
  • Migration to version v4
  • Collaboration Service
  • Extra configuration
  • Manual update
  • Changing PHP version
  • Support
Plugin installation
  • Hosting Panel
    • cPanel
    • DirectAdmin
    • Plesk
    • Sentora/ZPanel
    • ISPmanager
    • InterWorx
    • Vesta
    • Hosting Controller
    • CentOS Web Panel
    • Hestia
    • LiveConfig
    • Webuzo
    • Custom hosting (API)
  • Billing Panel
    • WHMCS
    • Blesta
    • Custom billing (API)
API documentation
  • Builder
    • Create session (SSO)
    • Remove existing session
    • Create website backup
    • Restore website backup
  • Templates
    • List template categories
    • List template category tags
    • List templates
    • Get page types available in templates
  • Import
    • Import website
    • Get website import status
    • Import website block
    • Get website block import status
    • Check if imported website is owned by user
  • Websites
    • Create website
    • Modify website
    • Rename website
    • Publish website
    • Edit website pages
    • Edit website settings
    • Delete website
    • Get website template
    • Get website pages
    • Get website variables
    • Get template variables
    • Get website settings
    • Add pages to website
    • Duplicate pages in website
    • Remove pages from website
  • Website Blocks
    • Create empty website
    • Modify website
    • Inspect website
    • Add empty page
    • Modify page
    • Remove page
    • Inspect page
    • Inspect composition
    • Modification descriptor structure by element type
    • Add blocks from compositions
    • Remove blocks
    • Move blocks
    • Modify blocks
    • Inspect block
  • Licenses
    • Get list of published websites
    • Get statistics of publications/openings
    • Block/unblock published website
    • Controlling IP list
    • Read/add/delete hosting plans
  • Integration with your system
    • Allow/disallow domain in builder
    • Check if domains are allowed in builder
  • FAQ
    • Get posts
    • Get categories
Add-ons documentation
  • For Website
    • Public demo URL
    • Editing plans
    • User registration from public demo
    • Website import
  • For Builder
    • Adding custom templates
    • Adding custom builder plugins
    • Scripts
For developers
  • Programming reference
  • Directory structure
  • Meta information (main.json)
  • Frontend logic (main.js)
  • Element template (main.html)
  • Backend logic (main.php)
  • Plugin testing
  • Custom element plugin
  • E-commerce plugin
  • Overriding UI
  • Other examples
Change Log
API documentation → Builder

Create session (SSO) available since version 4.0.0 / 3.7.23 Cloud On-Premises

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 implementation for http publication type

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

API endpoint URL
HTTP Basic
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/x-www-form-urlencoded, application/octet-stream

application/json

application/json, none

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 – (required if error is not returned) Result description object with structure:
    • String – (required if error is not returned) 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 then it also must be accessible via URL and from which you will need to retrieve publication process ID.

Your API endpoint must catch and process the following HTTP requests from builder:

Put file

Should create (or update) the specified file on the server with the content of the request body.

Request:

API endpoint URL + / [file path]
HTTP Basic
Value of parameter "username" passed to builder API call
Value of parameter "password" passed to builder API call
POST
application/octet-stream

Response:

  • 200 – OK.
  • 403 – Access denied.

Delete file

Should delete the specified file on the server.

Request:

API endpoint URL + / [file path] ?delete=1
HTTP Basic
Value of parameter "username" passed to builder API call
Value of parameter "password" passed to builder API call
GET

Response:

  • 200 – OK.
  • 403 – Access denied.

Create directory

Should create (if does not exist) the specified directory on the server.

Request:

API endpoint URL + / [directory path] ?mkDir=1
HTTP Basic
Value of parameter "username" passed to builder API call
Value of parameter "password" passed to builder API call
GET

Response:

  • 200 – OK.
  • 403 – Access denied.

Get directory files listing

Should return files listing of the specified directory on the server.

Request:

API endpoint URL + / [directory path] ?list=1
HTTP Basic
Value of parameter "username" passed to builder API call
Value of parameter "password" passed to builder API call
GET
application/json

Response:

  • 200 – OK.

    Return Object Properties:

    • Array of Objects – list of files, where each represents the following object:
      • String name – File name
      • Boolean isDir – true of false indicating if the file is a directory
      • Number size – (optional) File size in bytes
      • String size – (optional) File modification time (of format "YYYY-MM-DD HH:ii:ss")
  • 403 – Access denied.

Request Example:

POST /api/requestLogin HTTP/1.1
Host: 
Authorization: Basic W0FQSSBVc2VybmFtZSB3aWxsIGFwcGVhciBhZnRlciB5b3UgPGEgaHJlZj0iamF2YXNjcmlwdDp2b2lkKDApIiBjbGFzcz0iYnRuLWxvZ2luLXRyaWdnZXIiPmxvZyBpbjwvYT4gb3IgPGEgaHJlZj0iamF2YXNjcmlwdDp2b2lkKDApIiBjbGFzcz0iYnRuLXJlZ2lzdGVyLXRyaWdnZXIiPnNpZ24gdXA8L2E+XTpbQVBJIFBhc3N3b3JkIHdpbGwgYXBwZWFyIGFmdGVyIHlvdSA8YSBocmVmPSJqYXZhc2NyaXB0OnZvaWQoMCkiIGNsYXNzPSJidG4tbG9naW4tdHJpZ2dlciI+bG9nIGluPC9hPiBvciA8YSBocmVmPSJqYXZhc2NyaXB0OnZvaWQoMCkiIGNsYXNzPSJidG4tcmVnaXN0ZXItdHJpZ2dlciI+c2lnbiB1cDwvYT5d
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"
}
		
POST /api/requestLogin HTTP/1.1
Host: 
Authorization: Basic W0FQSSBVc2VybmFtZSB3aWxsIGFwcGVhciBhZnRlciB5b3UgPGEgaHJlZj0iamF2YXNjcmlwdDp2b2lkKDApIiBjbGFzcz0iYnRuLWxvZ2luLXRyaWdnZXIiPmxvZyBpbjwvYT4gb3IgPGEgaHJlZj0iamF2YXNjcmlwdDp2b2lkKDApIiBjbGFzcz0iYnRuLXJlZ2lzdGVyLXRyaWdnZXIiPnNpZ24gdXA8L2E+XTpbQVBJIFBhc3N3b3JkIHdpbGwgYXBwZWFyIGFmdGVyIHlvdSA8YSBocmVmPSJqYXZhc2NyaXB0OnZvaWQoMCkiIGNsYXNzPSJidG4tbG9naW4tdHJpZ2dlciI+bG9nIGluPC9hPiBvciA8YSBocmVmPSJqYXZhc2NyaXB0OnZvaWQoMCkiIGNsYXNzPSJidG4tcmVnaXN0ZXItdHJpZ2dlciI+c2lnbiB1cDwvYT5d
Content-Type: application/json

{
   "type": "internal",
   "domain": "test.com",
   "apiUrl": "",
   "resellerClientAccountId": 1234,
   "lang": "en"
}
		
POST /api/requestLogin HTTP/1.1
Host: 
Authorization: Basic W0FQSSBVc2VybmFtZSB3aWxsIGFwcGVhciBhZnRlciB5b3UgPGEgaHJlZj0iamF2YXNjcmlwdDp2b2lkKDApIiBjbGFzcz0iYnRuLWxvZ2luLXRyaWdnZXIiPmxvZyBpbjwvYT4gb3IgPGEgaHJlZj0iamF2YXNjcmlwdDp2b2lkKDApIiBjbGFzcz0iYnRuLXJlZ2lzdGVyLXRyaWdnZXIiPnNpZ24gdXA8L2E+XTpbQVBJIFBhc3N3b3JkIHdpbGwgYXBwZWFyIGFmdGVyIHlvdSA8YSBocmVmPSJqYXZhc2NyaXB0OnZvaWQoMCkiIGNsYXNzPSJidG4tbG9naW4tdHJpZ2dlciI+bG9nIGluPC9hPiBvciA8YSBocmVmPSJqYXZhc2NyaXB0OnZvaWQoMCkiIGNsYXNzPSJidG4tcmVnaXN0ZXItdHJpZ2dlciI+c2lnbiB1cDwvYT5d
Content-Type: application/json

{
   "type": "http",
   "domain": "test.com",
   "apiUrl": "",
   "lang": "en"
}
		
POST /api/requestLogin HTTP/1.1
Host: 
Authorization: Basic W0FQSSBVc2VybmFtZSB3aWxsIGFwcGVhciBhZnRlciB5b3UgPGEgaHJlZj0iamF2YXNjcmlwdDp2b2lkKDApIiBjbGFzcz0iYnRuLWxvZ2luLXRyaWdnZXIiPmxvZyBpbjwvYT4gb3IgPGEgaHJlZj0iamF2YXNjcmlwdDp2b2lkKDApIiBjbGFzcz0iYnRuLXJlZ2lzdGVyLXRyaWdnZXIiPnNpZ24gdXA8L2E+XTpbQVBJIFBhc3N3b3JkIHdpbGwgYXBwZWFyIGFmdGVyIHlvdSA8YSBocmVmPSJqYXZhc2NyaXB0OnZvaWQoMCkiIGNsYXNzPSJidG4tbG9naW4tdHJpZ2dlciI+bG9nIGluPC9hPiBvciA8YSBocmVmPSJqYXZhc2NyaXB0OnZvaWQoMCkiIGNsYXNzPSJidG4tcmVnaXN0ZXItdHJpZ2dlciI+c2lnbiB1cDwvYT5d
Content-Type: application/json

{
   "type": "ssh",
   "domain": "test.com",
   "apiUrl": "11.22.33.44",
   "lang": "en",
   "username": "test.com SSH username",
   "password": "test.com SSH password",
   "uploadDir": "/var/www/test.com/public_html"
}
		
POST /api/requestLogin HTTP/1.1
Host: 
Authorization: Basic W0FQSSBVc2VybmFtZSB3aWxsIGFwcGVhciBhZnRlciB5b3UgPGEgaHJlZj0iamF2YXNjcmlwdDp2b2lkKDApIiBjbGFzcz0iYnRuLWxvZ2luLXRyaWdnZXIiPmxvZyBpbjwvYT4gb3IgPGEgaHJlZj0iamF2YXNjcmlwdDp2b2lkKDApIiBjbGFzcz0iYnRuLXJlZ2lzdGVyLXRyaWdnZXIiPnNpZ24gdXA8L2E+XTpbQVBJIFBhc3N3b3JkIHdpbGwgYXBwZWFyIGFmdGVyIHlvdSA8YSBocmVmPSJqYXZhc2NyaXB0OnZvaWQoMCkiIGNsYXNzPSJidG4tbG9naW4tdHJpZ2dlciI+bG9nIGluPC9hPiBvciA8YSBocmVmPSJqYXZhc2NyaXB0OnZvaWQoMCkiIGNsYXNzPSJidG4tcmVnaXN0ZXItdHJpZ2dlciI+c2lnbiB1cDwvYT5d
Content-Type: application/json

{
   "type": "local",
   "domain": "test.com",
   "uploadDir": "/var/www/test.com/public_html",
   "lang": "en"
}
		

Response Example:

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

{
   "url": ""
}
	

Important: The session URL is active for 30 days per domain. Despite the fact one session URL can be used multiple times per domain during this period it is recommended to generate the fresh URL each time you need to open builder for a customer. Otherwise the session may contain outdated builder configuration and will not match your brand configuration on licenses page.

Response With Error Example:

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

{
   "error": { "message": "some kind of error message" }
}
	
© Site.pro 2011. Website Builder. United States.
Contact SalesTerms of Service