为给定服务运行终止操作。
请求参数
参数 | 类型 | 说明 | 必需的 |
---|---|---|---|
action | string | “ModuleTerminate” | Required |
serviceid | int | 为其运行操作的服务 ID | Required |
响应参数
参数 | 类型 | 说明 |
---|---|---|
result | string | 操作结果:成功或错误 |
示例请求 (CURL)
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://www.example.com/includes/api.php');
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS,
http_build_query(
array(
'action' => 'ModuleTerminate',
// See https://developers.whmcs.com/api/authentication
'username' => 'IDENTIFIER_OR_ADMIN_USERNAME',
'password' => 'SECRET_OR_HASHED_PASSWORD',
'serviceid' => '1',
'responsetype' => 'json',
)
)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec($ch);
curl_close($ch);
示例请求(本地 API)
$command = 'ModuleTerminate';
$postData = array(
'serviceid' => '1',
);
$adminUsername = 'ADMIN_USERNAME'; // Optional for WHMCS 7.2 and later
$results = localAPI($command, $postData, $adminUsername);
print_r($results);
示例响应 JSON
{
"result": "success"
}
错误响应
可能的错误条件响应包括:
- 服务 ID 为必填项
- 未找到服务 ID
- 服务未分配给模块
- 服务器响应消息
相关用法
- PHP WHMCS ModuleChangePackage用法及代码示例
- PHP WHMCS ModuleSuspend用法及代码示例
- PHP WHMCS ModuleChangePw用法及代码示例
- PHP WHMCS ModuleCustom用法及代码示例
- PHP WHMCS ModuleCreate用法及代码示例
- PHP WHMCS ModuleUnsuspend用法及代码示例
- PHP MySQL ROUND()用法及代码示例
- PHP Memcache::getExtendedStats()用法及代码示例
- PHP Memcached getByKey()用法及代码示例
- PHP Memcache::getServerStatus()用法及代码示例
- PHP Memcache::flush()用法及代码示例
- PHP Memcache::setCompressThreshold()用法及代码示例
- PHP Memcached add()用法及代码示例
- PHP Memcache::pconnect()用法及代码示例
- PHP Memcache::get()用法及代码示例
- PHP Memcache::replace()用法及代码示例
- PHP Memcache::set()用法及代码示例
- PHP Max()用法及代码示例
- PHP Memcache::connect()用法及代码示例
- PHP Memcache::increment()用法及代码示例
- PHP WHMCS ManualRefund用法及代码示例
- PHP Memcache::close()用法及代码示例
- PHP WHMCS MergeTicket用法及代码示例
- PHP Memcached addServer()用法及代码示例
- PHP Memcached get()用法及代码示例
注:本文由纯净天空筛选整理自whmcs.com大神的英文原创作品 ModuleTerminate。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。