• Debian 11 is approaching its end-of-life (vendor EOL date - August 31, 2026). Plesk Obsidian 18.0.80 will be the last release to support it.
    If you are running Plesk Obsidian on Debian 11, we recommend you upgrade those servers to Debian 12 using our dist-upgrade tool.
  • We plan to deprecate and remove the support for XML RPC protocol versions earlier than 1.6.9.1 in Plesk Obsidian 18.0.82. We strongly recommend that you update all existing integrations using earlier versions of the XML RPC protocol to comply with the version 1.6.9.1 specification.

How I have set expiration date for client add from API RPC XML(C#)

A

AvisS

Guest
Hi,

I am C# developer. I have written some code for clients (user) add from Local system to plesk web server through API. I have used API RPC protocol version is 1.4.2.0 .


The code is working fine for me. But main problem in that, I can’t set those clients expiration date.

Here is some XML request
<limits>
<disk_space>100000</disk_space>
<max_dom>50</max_dom>
<max_subdom>250</max_subdom>
<max_webapps>30</max_webapps>
<max_traffic>50000</max_traffic>
<max_db>200</max_db>
<mysql_dbase_space>50000</mysql_dbase_space>
<max_shared_ssl_links>50</max_shared_ssl_links>
<expiration>1134616208</expiration>
</limits>


Can you please suggest me, here which date format is used?


Thanks,
Avis
 
Hi IgorG,

No, it is not working properly.

Here is my code:sb.Append("<expiration>" + DateTime.Now.AddYears(1).Date.ToString("yyyyMMdd") + "</expiration>");

And XML request is: <expiration>20120112</expiration>

After that when I have added the client, it shows expiration date is 21- Aug – 1970


Thanks,
Avis
 
Same error here ...

yyyyMMdd format is not valid, I get a date of 1970

I change expiration with control panel and I get the date "1298329200" as 25-Feb-2011...
 
Try to use http://www.epochconverter.com/ to calc your date

"The Unix epoch (or Unix time or POSIX time or Unix timestamp) is the number of seconds that have elapsed since January 1, 1970 (midnight UTC/GMT), not counting leap seconds"

In C# you can try:
epoch = (DateTime.Now.ToUniversalTime().Ticks - 621355968000000000) / 10000000;
 
Back
Top