• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion
  • Please beaware of a breaking change in the REST API on the next Plesk release (18.0.62).
    Starting from Plesk Obsidian 18.0.62, requests to REST API containing the Content-Type header with a media-type directive other than “application/json” will result in the HTTP “415 Unsupported Media Type” client error response code. Read more here

API Quesiton: AccountWebService.DeleteAccount

C

chortle

Guest
Hi all,

I am writing code to automate the creation and destruction of sites. The documentation is quite weak on the deletion process. Does anyone know what exactly gets deleted when AccountWebService.DeleteAccount is called? Is the end user's account deleted? Is their site deleted?

Thanks,

Mike
 
During user account deletion all sites, plans, hosts will be deleted which belongs to this particular user. Better way is to test it. It should work fine...
 
the api reference gives the c# example function code

[C#]
public�ServiceDeleteResultOfAccountDeleteStatus[]�DeleteAccount(
���string[]�accountIds
);

Does anyone know the format of the function in PHP?
 
Using the GetAccountByName method

Hi, following up on the above post: I am building an API between WHMcs and Sitebuilder. I have automatic user/site creation working. Now I wish to delete a certain account.

However, I am receiving this error concerning the DeleteAccount method. Listed below this error message is the code where I am using that method.

Type: SoapFault
Message: Action has been failed. list of users is empty
Fault code: ERROR_ACTION_FAILED
Details: list of users is empty
File: /home/goodhost/public_html/billing3/includes/actionhooks.php
Line: 352
Code: 0

$struct = new stdClass();
$result = new stdClass();
$result2 = new stdClass();

print $vars["username"];

$accountService = $this->_getWebService('/AccountWebService.asmx?WSDL');

// first we must search to see if the username exists as a site in sitebuilder.

$struct->username = $vars["username"];

$result = $accountService->GetAccountByName(new SoapVar($struct, SOAP_ENC_OBJECT));

$accountId = $result->UserAccount->AccountId;

print "<p>";
print $accountId;

$delsite = new stdClass();

$delsite->UserAccount->AccountId = $accountId;

print "<p>2: ";
print $delsite->UserAccount->AccountId;

// delete that site (line 352)

$result2 = $accountService->DeleteAccount(new SoapVar($delsite, SOAP_ENC_OBJECT));

I have also tried using the method by supplying the hardcoded string "sitetest1" for example, and the same error message above is generated.

Can you tell me how I should be using the DeleteAccount API method to process correctly?

This is the page of documentation:

http://download1.parallels.com/SiteBuilder/4.1.0/doc/api/ref_manual/en_US/html/4.1/index.html

where it says the syntax is:

public�ServiceDeleteResultOfAccountDeleteStatus[]�DeleteAccount(
���string[]�accountIds
);
 
Back
Top