Article ID: 114862, created on Sep 29, 2012, last review on May 7, 2014

  • Applies to:
  • Plesk Sitebuilder 4.5 for Linux/Unix

Resolution

Documentation and examples of XML API requests of Parallels Plesk Sitebuilder 4.5 for Linux are available on the following page:

http://sitebuilder45.hostname/ServiceFacade/4.5/

Where sitebuilder45.hostname is hostname of your Parallels Plesk Sitebuilder 4.5. Documentaiotn with example of SOAP 1.1 request of API method [SiteWebService]:[CreateSite2] is available via the following URL:

http://sitebuilder45.hostname/ServiceFacade/4.5/SiteWebService.asmx?op=CreateSite2

The package may be sent to Parallels Plesk Sitebuilder 4.5 with the following command:

~# /opt/php52/bin/php5 /usr/local/sitebuilder/utils/api_cli_wrapper.php \
   --serviceUrl=http://sitebuilder45.hostname/ServiceFacade/SiteWebService.asmx \
   --authLogin=admin \
   --authPassword=<PASSWORD>\
   --method=CreateSite2 \
   --param_siteType=Regular \
   --param_siteAlias=<SITE NAME> \
   --param_publishingSettings_StandardLocation_Address=<HOST IP ADDRESS> \
   --param_publishingSettings_StandardLocation_UserName=<FTP USER> \
   --param_publishingSettings_StandardLocation_Password=<FTP PASSWORD> \
   --param_publishingSettings_StandardLocation_WorkingDirectory=<WORKING DIRECTORY> \
   --param_publishingSettings_StandardLocation_WebSiteUrl=<DOMAIN URL> \
   --param_publishingSettings_Mode=FTP \
   --param_ownerId=<USER UUID> \


Replace highlited fields with real values. The command is to create new site with alias <SITE NAME> for user whose uuid is <USER UUID>. IP Address <HOST IP ADDRESS> will be added to hosts for admin user and configured in publishing settings of the site.
Name of each parameter "--param_<PARAMETER>" from method [SiteWebService]:[CreateSite2] consists of ful path of fields from SOAP 1.1 request example from the documentaiotn page. For example name "--param_publishingSettings_StandardLocation_Address" consists of the following fields:

http://sitebuilder45.hostname/ServiceFacade/4.5/SiteWebService.asmx?op=CreateSite2
---8<---
<?xml version="1.0"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns="http://namespace-here">
  <SOAP-ENV:Body>
    <CreateSite2>
      <siteType>string</siteType>
      <siteAlias>string</siteAlias>
      <publishingSettings>
        <Id>string</Id>
        <StandardLocation>
          <Address>string</Address>
...
--->8---


Using method [HostWebService]:[FindHosts] you may get list of hosts. Example of API method is available via the following URL:

http://sitebuilder45.hostname/ServiceFacade/4.5/HostWebService.asmx?op=FindHosts

Here's an example showing the API XML package to get list of all hosts owned by admin:

~# /opt/php52/bin/php5 /usr/local/sitebuilder/utils/api_cli_wrapper.php \
  --serviceUrl=http://sitebuilder45.hostname/ServiceFacade/4.5/HostWebService.asmx \
  --authLogin=admin \
  --authPassword=<PASSWORD>\
  --method=FindHosts \
  --param_criteria='' \
  --param_pos=0 \
  --param_count='' \
  --param_sortType= \
  --param_sortDirection=Ascending \
  --param_type= \

 
Output is the following:

---8<---
    <ns1:FindHostsResponse>
      <ns1:FindHostsResult>
        <ns1:TotalCount>2</ns1:TotalCount>
        <ns1:Items>
          <ns1:HostValue>
            <ns1:Id>f00fc48e-4098-d793-4a01-6ccea7d5e568</ns1:Id>
            <ns1:Name>HOST_ADDRESS</ns1:Name>                     
            <ns1:Address>HOST_ADDRESS</:Address>             
            <ns1:IsActive>true</ns1:IsActive>
            <ns1:SmtpFrom/>
            <ns1:SmtpHost/>
            <ns1:SmtpPassword/>
            <ns1:SmtpUser/>
            <ns1:SmtpPort>0</ns1:SmtpPort>
          </ns1:HostValue>
        </ns1:Items>
      </ns1:FindHostsResult>
    </ns1:FindHostsResponse>
--->8---


Using method [AccountWebService]:[FindAccount] you may get list of all users existing in Parallels Plesk Sitebuilder 4.5. Example of API method is available via the following URL:

http://sitebuilder45.hostname/ServiceFacade/4.5/AccountWebService.asmx?op=FindAccount

Here's an example showing the API XML package to get all users owned by admin:

~# /opt/php52/bin/php5 /usr/local/sitebuilder/utils/api_cli_wrapper.php \
  --serviceUrl=http://sitebuilder45.hostname/ServiceFacade/AccountWebService.asmx \
  --authLogin=admin \
  --authPassword=<PASSWORD>\
  --method=FindAccount \
  --param_criteria='' \
  --param_startPos=0  \
  --param_count='' \
  --param_sortField=''  \
  --param_sortDirection='' \
  --param_roleFilter_AccountRoles=’’ \


Output is the following:

--->8---
        <ns1:Items>
          <ns1:AccountValue>
            <ns1:AccountId>ad7b0296-4f98-0573-82d2-522a140134fa</ns1:AccountId>      <== USER UUID
            <ns1:IsBuiltIn>false</ns1:IsBuiltIn>
            <ns1:CreationDate>2012-05-19T13:14:36+07:00</ns1:CreationDate>
            <ns1:UserName>USERNAME</ns1:UserName>
            <ns1:Email>EMAIL</ns1:Email>
            <ns1:FirstName>FIRST_NAME</ns1:FirstName>
            <ns1:LastName>LAST_NAME</ns1:LastName>
            <ns1:OwnerName>admin</ns1:OwnerName>
            <ns1:IsLockedOut>false</ns1:IsLockedOut>
            <ns1:Role>SiteOwner</ns1:Role>
            <ns1:Profile>
              <ns1:Language>
                <ns1:LanguageId>LANGUAGE_ID</ns1:LanguageId>
                <ns1:Code>en_US</ns1:Code>
                <ns1:Active>true</ns1:Active>
                <ns1:EnglishName>English, United States</ns1:EnglishName>
              </ns1:Language>
              <ns1:Theme>
                <ns1:ThemeId>THEME_ID</ns1:ThemeId>
                <ns1:Active>true</ns1:Active>
                <ns1:Name>WinXP Blue</ns1:Name>
                <ns1:Code>WinXPBlue</ns1:Code>
              </ns1:Theme>
              <ns1:ListSize>10</ns1:ListSize>
              <ns1:HideOverviewPage>false</ns1:HideOverviewPage>
              <ns1:ShowGettingStarted>true</ns1:ShowGettingStarted>
              <ns1:TemplateListSize>0</ns1:TemplateListSize>
            </ns1:Profile>
            <ns1:PlanId>PLAN_ID</ns1:PlanId>
            <ns1:IsChangePasswordAllowed>true</ns1:IsChangePasswordAllowed>
            <ns1:OwnerId>OWNER_ID</ns1:OwnerId>
          </ns1:AccountValue>
        </ns1:Items>
---8<---

f7f840260c1591440648a375a64b5b75 56797cefb1efc9130f7c48a7d1db0f0c fad6dc0c8e983c17ae70a51ac7952cd0 d055be4fdc562a8ecb8e6d0bf419f946 ea6a61e571a858aa6019ceb068ea403a

Email subscription for changes to this article
Save as PDF