GuidetocPanelAPI1GuidetocPanelAPI1ReturnDatacPanelTags(deprecated)Bandwidth::displaybwheaderBandwidth::displaybwBandwidth::displaydayBandwidth::displaymainbwheaderBoxTrapper::changestatusBoxTrapper::cleancfgfilelistBoxTrapper::editmsgBoxTrapper::fetchcfgfileBoxTrapper::getboxconfdirBoxTrapper::listmsgsBoxTrapper::logcontrolsBoxTrapper::messageactionBoxTrapper::multimessageactionBoxTrapper::resetmsgBoxTrapper::savecfgfileBoxTrapper::saveconfBoxTrapper::showautowhitelistBoxTrapper::showemailsBoxTrapper::showfromnameBoxTrapper::showlogBoxTrapper::showmessageBoxTrapper::showqueueBoxTrapper::showqueuesearchIntroductioncPanelAPI1accessesinformationfromthecPanelinterface.
BasicusageLiveAPIPHPClass$cpanel=newCPANEL();//ConnecttocPanel-onlydothisonce.
$your_variable=$cpanel->api1('Module','function',array('parameter','parameter','parameter'Callthefunction.
LiveAPIPerlModulemy$cpliveapi=Cpanel::LiveAPI->new();#ConnecttocPanel-onlydothisonce.
my$your_variable=$cpliveapi->api1('Module','function',['parameter','parameter','parameter']);#Callthefunction.
TemplateToolkitcPanelAPI1BasicsAvailablein:cPanel11+Languages:PHP,PerlMethods:GET,POSTReturnFormats:Seethedesiredfunctionforoutputinformation.
AboutcPanelAPI1cPanelAPI1accessesinformationaboutcPanelaccounts.
Warning:cPanelAPI1is.
WerecommendthatyouusedeprecatedstronglycPanelAPIorinstead.
2UAPIImportant:IncPanel&WHMversion76,weintroducedserverprofilesandroles.
Whenyouenableanon-StandardNodeserverprofile,thesystemdisablesAPIcallsassociatedwiththatprofile'sdisabledroles.
Note:YoucallthisAPI'sfunctionsviaanotherAPI'scallmethods.
Formorecannotinformation,readthesectionbelow.
APImethoddistinctionsNote:Formoreinformation,readour.
GuidetotheLiveAPISystemNote:Formoreinformation,readour.
GuidetotheLiveAPISystemNote:Currently,individualfunctiondocumentationdoesincludeTemplateToolkitnotexamples.
Warning:cPanelAPI1isde.
precatedWestronglyrecommendthatyouusecPanelorAPI2UAPIinstead.
Notes:BoxTrapper::showqueuetimeBoxTrapper::statusBoxTrapper::statusbuttonBranding::fileBranding::imageBranding::killimgBranding::setbrandingpkgBranding::setmyacctspkgBranding::setupdirsBranding::tempsetbrandingpkgCgi::backuplinkCgi::displayurchinCgi::phpmyadminlinkChkservd::geteximportChkservd::geteximport_sslClamScanner::barscPAddons::mainpgCron::crontab_permsCustInfo::getemailDenyIp::adddenyipDenyIp::deldenyipDenyIp::listdenyipsDiskUsage::showmanagerEmail::addautoresponderEmail::adddforwardEmail::addfilterEmail::addlistEmail::addmxEmail::addpopEmail::addspamEmail::addspamboxEmail::addspamfilterEmail::changemxEmail::checkfastmailEmail::checkpipefwd[%-USEApi1;SETmyvariable=execute('Module','function',{'parameter'=>'value','parameter'=>'value','parameter'=>'value',});%]cPanelTagSystem(deprecated)CommandLinecpapi1--user=username--output=typeModulefunctionparameter=valueparameter=valuecPanelAPI1callsthroughthecommandlineconsistofthefollowingbasicparts:PartDescriptionCommandThisvalueisalwaysforcallstocPanelAPI1.
cpapi1Note:Formoreinformation,readourdocumentation.
GuidetoTemplateToolkitWarning:IncPanel&WHMversion11.
30andlater,cPaneltagsare.
WedeprecatedprovidethisexampletohelpdevelopersmovefromtheoldcPaneltagsystemtooursystem.
WerecommendthatyouusetheLiveAPIstronglyonlyLiveAPIsystemtocallthecPanelAPIs.
Note:cPanel&WHMintroducedthecommandlinefeatureinversion56.
Note:IfyourunCloudLinux,youusethefullpathofthe1mustcpapicommand:/usr/local/cpanel/bin/cpapi1Thesefunctionsmayrequireafeaturelist.
ToviewtheavailablefeaturelistsonacPanelserver,viewWHM'sFeatureManagerinterface.
UnlessyoucaEmail::clearspamboxEmail::delautoresponderEmail::deldforwardEmail::delfilterEmail::dellistEmail::delmxEmail::delpopEmail::delspamEmail::delspamboxEmail::disable_spam_autodeleteEmail::editquotaEmail::enable_spam_autodeleteEmail::getagingEmail::getarsbodyEmail::getarscharsetEmail::getarsfromEmail::getarshtmlEmail::getarsintervalEmail::getarsstartEmail::getarsstopEmail::getarssubjectEmail::getmailserverEmail::getmailserveruserEmail::getpopquotaEmail::has_spam_as_aclEmail::has_spam_autodeleteEmail::listmaildomainsEmail::listmaildomainsoptEmail::listmaildomainsoptndefEmail::mainacctdiskusedEmail::passwdlistEmail::passwdpopEmail::setmxacceptEmail::spamboxstatusOutputTypeTheAPIoutputtypethatyouwishtoreceive.
UsetoreturnJSON-formattedoutput.
--output=jsonUsetoreturnindentedJSON-formatted--output=jsonprettyoutput.
UsetoreturnXML-formattedoutput.
--output=xmlUsetoreturnYAML-formattedoutput.
--output=yamlModuleThecPanelAPI1modulename.
FunctionThecPanelAPI1function.
UserThecPanelaccount-levelusername.
InputparametersandvaluesThefunction'sinputparametersandtheirvalues.
Youvalues.
mustURI-encodeSeparatemultiplepairswithaspacecharacter.
parameter=valueSpecialcharacterswithinakey'svaluemaycauseanerror.
Youmusteitherescapeanyspecialcharacterswithinvaluesorsurroundthevaluewithappropriatequotes.
Formoreinformation,readWikipedia'sEscapearticle.
CharactersForexample,abashshellcommandwithaJSON-encodedvaluemayappearsimilartooneofthefollowing:cpapi1--userusernameModulefunctionkey=[\"sslinstall\",\"videotut\"]"'{"videcpapi1--userusernameModulefunctionkey=otut","sslinstall"}'Theseexamplesusethefollowingvariables:VariableDescriptionExampleModuleThemoduleforthefunctionthatyouwishtouse.
EmailfunctionThecPanelAPI1functionthatyouwishtouse.
addpopImportant:cPanel&WHMversion66deprecatedXMLoutput.
Note:Thisparameterdefaultsto.
--output=yamlNote:Theterm"Boolean"inourdocumentationreferstoparametersthatacceptvaluesofor.
cPanel&WHM'sAPIsdosupportthe10notliteralvaluesofand.
truefalseNote:Formoreinformationaboutthisfeature,runthefollowingcommand:cpapi1--helpllthisAPIviatheWHMAPI,youmustusetheappropriatecPanelports(2082or2083).
YoucanalsocallsomefunctionsviacPanel'sWebmailporEmail::spamstatusEmail::tracefilterFileman::changepermFileman::delfileFileman::dofileopFileman::emptytrashFileman::extractfileFileman::fileimgFileman::fmmkdirFileman::fmmkfileFileman::fmpushfileFileman::fmrenameFileman::fmsavefileFileman::fmsavehtmlfileFileman::fullbackupFileman::getfileFileman::htmleditorFileman::killdirFileman::listfilesFileman::listfullbackupsFileman::listtemplatesFileman::restoreafFileman::restoredbFileman::restorefileFileman::restorefilesFileman::savehtmlfileFileman::showpermFileman::uploadfilesFileman::viewfileFrontPage::addfpFrontPage::delfpFrontPage::fpstatusFtp::addftpFtp::delftpFtp::ftpquotaFtp::ftpservernameFtp::ftpstatsloginFtp::get_anonftpparameterInputparametersthatyoupasstothefunction.
example.
comCallcPanelAPI1fromtheWHMAPIYoucanusetheWHMAPItocallcPanelAPIfunctions.
Formoreinformation,readourUsedocumentation.
WHMAPItoCallcPanelAPI&UAPICustomEventHandlersandStandardizedHooksYoucanusethetocustomizetheeventsbeforeandafteraStandardizedHookSystemcPanelAPIcall.
APImethoddistinctionsRelatedDocumentationUseWHMAPItoCallcPanelAPIandUAPI—YoucancallcPanelAPIandUAPIfunctionsthroughtheWHMAPI.
GuidetotheManage2API—TheManage2APIautomatescPanellicensemanagementprocedures.
GuidetoUAPI—UAPIaccessesthecPanelinterface'sfeatures.
GuidetoWHMAPI0—WHMAPI0accessestheWHMinterface'sfeatures.
GuidetocPanelAPI2—cPanelAPI2accessescPanelaccountinformationandmodifiessettings.
Important:cPanelAPI1functionsuseorderedparameters.
Youspecifyparametersinmusttheorderinwhichtheyappearinthisdocumentation.
cPanelAPI1parametersare.
case-sensitiveNote:Theterm"Boolean"inourdocumentationreferstoparametersthatacceptvaluesofor.
cPanel&10WHM'sAPIsdosupporttheliteralvaluesofnottrand.
uefalseWarning:DoattempttousecPanelorWHMinterfaceURLstoperformactionsinnotcustomcode.
YoucalltheappropriateAPIfunctionsinordertoperformmusttheactionsofcPanel&WHM'sinterfaces.
Forexample,dopassvaluestopages,asinthefollowingexample:not.
htmlhttp://example.
com:2082/frontend/x3/mail/doaddpop.
html/email=name&domain=user.
comWhilethismethodsometimesworkedinpreviousversionsofunsupportedcPanel&WHM,wediscourageitsuseanddoguaranteethatitwillstronglynotworkinthefuture.
Instead,thecorrectmethodtoperformthisactionistocalltheappropriateAPIfunction.
Warning:UnlessyoucallthisAPIviatheWHMAPI,youcallthisAPIviaWHM'scannotports(or).
20862087Important:BecausesomecPanelAPI1functionsreturnHTMLoutput,thismethodwillcauseparsingerrorsinmostXMLparsers.
WerecommendthatyoustronglyusecPanelAPI2instead.
ts(2095or2096).
Ftp::get_anonftpinFtp::get_welcomemsgFtp::getftpquotaFtp::kill_ftp_sessionFtp::listftpstatsurlFtp::passwdftpFtp::set_anonftpFtp::set_anonftpinFtp::set_welcomemsgGpg::deletekeyGpg::exportkeyGpg::exportsecretkeyGpg::genkeyGpg::importkeysHtaccess::checkprotectedHtaccess::del_userHtaccess::getindexHtaccess::htdirlsHtaccess::number_of_usersHtaccess::phpselectableHtaccess::resnameHtaccess::set_passHtaccess::set_protectHtaccess::setindexHtaccess::setphpreferenceHtaccess::showusersImageManager::convertImageManager::dimensionsImageManager::hdimensionImageManager::scaleImageManager::thumbnailImageManager::wdimensionLastLogin::lastlogincPanel,L.
L.
C.
producesfourcurrentandtwodeprecatedAPIs,andtheyallincludeseparatesetsoffunctions.
MakethatthefunctionandmodulethatyoucallexistincertaintheAPIversionthatyourcodeuses.
SelectatabtoviewexamplesofcallstothedesiredAPI:WHMAPI1https://hostname.
example.
com:2087/cpsess#json-api/accountsummaryapi.
version=1&user=usernamewhmapi1accountsummaryuser=usernameFormoreinformation,readourandGuidetoTestingCustomCode-WHMAPICallsGuidedocumentation.
toWHMAPI1UAPIhttps://hostname.
example.
com:2083/cpsess#execute/Module/functionparameter=value¶meter=value¶meter=valueuapi--user=username--output=typeModulefunctionparameter=valueparameter=value$cpanel=newCPANEL();//ConnecttocPanel-onlydothisonce.
//CallaUAPIfunction.
$function_result=$cpanel->uapi('Module','function',array('parameter'=>'value','parameter'=>'value','parameter'=>'value',));Important:APIcallsusethecorrectport:must2082—UnsecurecallstocPanel'sAPIs.
2083—SecurecallstocPanel'sAPIs.
2095—UnsecurecallstocPanel'sAPIsviaaWebmailsession.
2096—SecurecallstocPanel'sAPIsviaaWebmailsession.
2086—UnsecurecallstoWHM'sAPIs,ortocPanel'sAPIsviatheWHMAPI.
2087—SecurecallstoWHM'sAPIs,ortocPanel'sAPIsviatheWHMAPI.
Otherwise-correctcallswillreturnorPermissiondeniedFunctionnoterrorsiftheyuseanincorrectportnumber.
foundNote:Browser-basedcallstoWHMAPI1includetheWHMAPIversion(mustap).
Ifyouomittheversion,thesystemcallsWHMAPI0,whichi.
version=1maynotcontainthedesiredfunction,ormaycontainanolderversionofthatfunction.
LeechProtect::disableLeechProtect::enableLeechProtect::setupLeechProtect::showpasswdfileLeechProtect::statusLogManager::listdownloadsLogManager::savesettingsLogManager::showsettingsMagicRevision::uriMime::add_handlerMime::add_hotlinkMime::add_mimeMime::add_redirectMime::del_handlerMime::del_hotlinkMime::del_mimeMime::del_redirectMime::linkallownullMime::linkenableMime::linkextsMime::linkrurlMime::linkurlsMysql::adddbMysql::addhostMysql::adduserMysql::adduserdbMysql::checkdbMysql::deldbMysql::delhostMysql::deluserMysql::deluserdbMysql::gethostMysql::initcacheMysql::listdbsMysql::listdbsoptMysql::listusersMysql::listusersoptmy$cpliveapi=Cpanel::LiveAPI->new();#ConnecttocPanel-onlydothisonce.
#CallaUAPIfunction.
my$function_result=$cpliveapi->uapi('Module','function',{'parameter'=>'value','parameter'=>'value','parameter'=>'value',});[%execute('Module','function',{'parameter'=>'value','parameter'=>'value','parameter'=>'value',});%]cPanelAPI2https://hostname.
example.
com:2087/cpsess#json-api/cpanelcpanel_jsonapi_user=user&cpanel_jsonapi_apiversion=2&cpanel_jsonapi_module=Module&cpanel_jsonapi_func=function¶meter="value"cpapi2--user=username--output=typeModulefunctionparameter=valueparameter=value[%-USEApi2;SETmyvariable=execute('Module','function',{'parameter'=>'value','parameter'=>'value','parameter'=>'value',});%]Note:Formoreinformation,readourGuidetoTestingCustomCode-cPanelAPIandanddocumentation.
UAPICallsGuidetoUAPIMysql::number_of_dbsMysql::number_of_usersMysql::repairdbMysql::routinesMysql::updateprivsNet::dnslookupNet::dnszoneNet::sethastracerouteNews::displaynewsNVData::setOptimizeWS::loadoptimizesettingsOptimizeWS::loadoptimizesettings(bytes)OptimizeWS::optimizewsPark::disableredirectPark::getredirecturlPark::parkPark::setredirecturlPark::unparkPostgres::adddbPostgres::adduserPostgres::adduserdbPostgres::deldbPostgres::deluserPostgres::deluserdbPostgres::initcachePostgres::listdbsoptPostgres::listusersoptPostgres::number_of_dbsPostgres::number_of_usersProxyUtils::proxyaddressResellers::accountlistoptResellers::themelistoptServerinfo::servicestatus$cpanel=newCPANEL();//ConnecttocPanel-onlydothisonce.
//Callthefunction.
$my_variable=$cpanel->api2('Module','function',array('parameter'=>'value','parameter'=>'value','parameter'=>'value',));my$cpliveapi=Cpanel::LiveAPI->new();#ConnecttocPanel-onlydothisonce.
#Callthefunction.
my$my_variable=$cpliveapi->api2('Module','function',{'parameter'=>'value','parameter'=>'value','parameter'=>'value',});WHMAPI0(deprecated)https://hostname.
example.
com:2087/cpsess#json-api/accountsummaryuser=usernamewhmapi0accountsummaryuser=usernamecPanelAPI1(deprecated)cpapi1--user=username--output=typeModulefunctionparameter=valueparameter=valueNote:Formoreinformation,readourGuidetoTestingCustomCode-cPanelAPIandanddocumentation.
UAPICallsGuidetocPanelAPI2Warning:WHMAPI0is.
Werecommendthatyouusethedeprecatedstronglyonlyequivalentfunctionsinstead.
WHMAPI1Note:Formoreinformation,readourGuidetoTestingCustomCode-WHMAPICallsanddocumentation.
GuidetoWHMAPI0Warning:cPanelAPI1is.
WerecommendthatyouusedeprecatedstronglycPanelAPIorinstead.
2UAPISetLang::listlangsoptSetLang::setlangSpamAssassin::configSpamAssassin::saveconfigSSH::getportSSL::deleteSSL::deletecrtSSL::deletecsrSSL::deletekeySSL::gencrtSSL::gencsrSSL::genkeySSL::getcabundleSSL::getcnnameSSL::installSSL::installedhostSSL::listkeysoptSSL::showcrtSSL::showcsrSSL::showkeySSL::sslsharedstatusSSL::uploadcrtSSL::uploadkeyStatManager::doFormStatManager::updateUserConfigStats::analoglistStats::awstatsStats::bwbarStats::errlogStats::lastvisitorsStats::showbandwidthStats::webalizerStats::webalizerftpSubDomain::addsubdomainSubDomain::cplistsubdomainsSubDomain::disablesubrd$cpanel=newCPANEL();//ConnecttocPanel-onlydothisonce.
$your_variable=$cpanel->api1('Module','function',array('parameter','parameter','parameter'Callthefunction.
my$cpliveapi=Cpanel::LiveAPI->new();#ConnecttocPanel-onlydothisonce.
my$your_variable=$cpliveapi->api1('Module','function',['parameter','parameter','parameter']);#Callthefunction.
[%-USEApi1;SETmyvariable=execute('Module','function',{'parameter'=>'value','parameter'=>'value','parameter'=>'value',});%]Note:Formoreinformation,readourGuidetoTestingCustomCode-cPanelAPIandanddocumentation.
UAPICallsGuidetocPanelAPI1SubDomain::listsubdomainsopSubDomain::setsuburlUI::confirmUI::redirectUI::showresult
Budgetvm(原EZ机房),2005年成立的美国老品牌机房,主打美国4个机房(洛杉矶、芝加哥、达拉斯、迈阿密)和日本东京机房的独立服务器和VPS业务,而且不限制流量,默认提供免费的1800G DDoS防御服务,支持IPv6和IPMI,多种免费中文操作系统可供选择,独立服务器主打大硬盘,多硬盘,大内存,用户可以在后台自行安装系统等管理操作!内存可定制升级到1536G,多块硬盘随时加,14TBSA...
华为云怎么样?华为云用在线的方式将华为30多年在ICT基础设施领域的技术积累和产品解决方案开放给客户,致力于提供稳定可靠、安全可信、可持续创新的云服务,做智能世界的“黑土地”,推进实现“用得起、用得好、用得放心”的普惠AI。华为云作为底座,为华为全栈全场景AI战略提供强大的算力平台和更易用的开发平台。本次年终聚惠618活动相当给力,1核2G内存1m云耀云服务器仅88元/年起,送主机安全基础版套餐,...
关于HostYun主机商在之前也有几次分享,这个前身是我们可能熟悉的小众的HostShare商家,主要就是提供廉价主机,那时候官方还声称选择这个品牌的机器不要用于正式生产项目,如今这个品牌重新转变成Hostyun。目前提供的VPS主机包括KVM和XEN架构,数据中心可选日本、韩国、香港和美国的多个地区机房,电信双程CN2 GIA线路,香港和日本机房,均为国内直连线路,访问质量不错。今天和大家分享下...
.ftpquota为你推荐
outlookexpressoutlook express 是什么?cuteftpCuteFTP Pro如何使用?小型汽车网上自主编号申请机动车自主选号有几种办法小型汽车网上自主编号申请网上选号自编号怎么选如何发帖子请问在网上发帖子怎么发?站点管理谁有好的车站管理制度?社区动力你为什么想当一名社区工作者社区动力我是一名新入职社区员工,怎样做好社区工作?商务软件电子商务平台有哪些drupal主题如何在 drupal 上让网页呈现手机版页面以让智能手机更易浏览阅读
vps代理 edgecast a2hosting 英文站群 数字域名 柚子舍官网 韩国名字大全 太原网通测速平台 空间购买 沈阳主机托管 1美元 阿里云邮箱怎么注册 博客域名 葫芦机 移动王卡 godaddyssl apachetomcat 西部数码主机 热云 木马检测 更多