I'm trying to add a mailbox via API like this:
If I add mailbox from aaPanel webpage after submitting last form it sends POST request to https://<aapanel_url>:<aapanel_port>/plugin?action=a&name=mail_sys&s=add_mailbox with POST data:
- quota=5 GB
- username=<valid_email_address>
- password=***************
- full_name=SiteAdmin
- is_admin=1
It returns response like this: {"status": true, "msg": "Add a mailbox user successfully <valid_email_address>"}.
But if I try to add mailbox via API sending request to https://127.0.0.1:<aapanel_port>/plugin?action=a&name=mail_sys&s=add_mailbox it returns error 404 though it successfully executes next queries:
- /plugin?action=a&name=cloud_dns&s=list_hosting_domains
- /plugin?action=a&name=cloud_dns&s=add_record (except TXT records it's put content in quotes)
- /site?action=AddSite
- /v2/site?action=SetSiteRunPath
- /v2/files?action=exec_composer
- /plugin?action=a&name=mail_sys&s=add_domain
- /plugin?action=a&name=mail_sys&s=apply_cert
I'm using PHP code, got from https://www.bt.cn/api_demo_php.zip and main functions (getKeyData and getData) are used exactly as they were provided by aaPanel devs...