Thank you for your reply. It works great.
Just one more thing, what is the xml api function to turn on/off for Password protect directories?
When i tried it through cPanel, the url looks like this below:
after turning on the option:
http_s://mydomain.com:2083/frontend/x3/htaccess/changepro.html?protected=1&resname=mysite&action2=Save&dir=%2Fhome%2Ffusername%2Fpublic_html%2F
after turning off the option:
http_s://mydomain.com:2083/frontend/x3/htaccess/changepro.html?resname=&action2=Save&dir=%2Fhome%2Fusername%2Fpublic_html%2F